You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "1625567290 (via GitHub)" <gi...@apache.org> on 2026/08/21 14:51:08 UTC
Re: [PR] fix(desktop): search fixture-seeded transcripts for content hits [maka]
1625567290 commented on code in PR #3069:
URL: https://github.com/apache/maka/pull/3069#discussion_r3831213990
##########
apps/desktop/src/main/runtime-host-search-ipc-main.ts:
##########
@@ -22,19 +32,27 @@ export function registerRuntimeHostSearchIpc(
runThreadSearch(request, {
listSessions: async () =>
(await deps.client.listSessions()).map(toDesktopHostSessionSummary),
- readMessages: (sessionId) =>
- readWithFallback(async () => {
- const session = await deps.client.openSession(sessionId);
- try {
- return await session.loadTranscript();
- } finally {
- await session.close();
- }
- }, null),
+ readMessages: async (sessionId) =>
+ (await deps.readFixtureMessages?.(sessionId)) ??
Review Comment:
Addressed in the current head (`10d0597c4`). The separate fixture transcript reader and fallback wiring have been removed. Thread search now uses `openSession().loadTranscript()` as the sole transcript source, closes the session in `finally`, and retains the fixture-seeded E2E regression. The focused Runtime Host search tests passed 2/2.
##########
apps/desktop/src/main/runtime-host-search-ipc-main.ts:
##########
@@ -22,19 +32,27 @@ export function registerRuntimeHostSearchIpc(
runThreadSearch(request, {
listSessions: async () =>
(await deps.client.listSessions()).map(toDesktopHostSessionSummary),
- readMessages: (sessionId) =>
- readWithFallback(async () => {
- const session = await deps.client.openSession(sessionId);
- try {
- return await session.loadTranscript();
- } finally {
- await session.close();
- }
- }, null),
+ readMessages: async (sessionId) =>
+ (await deps.readFixtureMessages?.(sessionId)) ??
+ readHostTranscript(deps.client, sessionId),
Review Comment:
Addressed in the current head (`10d0597c4`) by removing the optional fixture reader entirely. Runtime Host `loadTranscript()` is the only transcript source and is wrapped with the existing `readWithFallback` seam, so Host read failures yield no content result without bypassing active-overlay messages. The focused tests passed 2/2.
##########
apps/desktop/src/main/runtime-host-search-ipc-main.ts:
##########
@@ -22,19 +32,27 @@ export function registerRuntimeHostSearchIpc(
runThreadSearch(request, {
listSessions: async () =>
(await deps.client.listSessions()).map(toDesktopHostSessionSummary),
- readMessages: (sessionId) =>
- readWithFallback(async () => {
- const session = await deps.client.openSession(sessionId);
- try {
- return await session.loadTranscript();
- } finally {
- await session.close();
- }
- }, null),
+ readMessages: async (sessionId) =>
+ (await deps.readFixtureMessages?.(sessionId)) ??
+ readHostTranscript(deps.client, sessionId),
Review Comment:
Addressed in the current head (`10d0597c4`) by removing the optional fixture reader entirely. Runtime Host `loadTranscript()` is the only transcript source and is wrapped with the existing `readWithFallback` seam, so Host read failures yield no content result without bypassing active-overlay messages. The focused tests passed 2/2.
##########
apps/desktop/e2e/fixture-thread-search.spec.ts:
##########
@@ -0,0 +1,30 @@
+import { PROMPT_RAIL_SESSION_ID } from "../src/main/e2e-fixture/seed-helpers";
+import { expect, test } from "./fixtures";
+
+test("fixture-seeded transcripts return content hits with turn ids", async ({
+ promptRailWindow: page,
+}) => {
+ const outcome = await page.evaluate(async () =>
+ window.maka.search.thread({
+ source: "thread",
+ query: "第 3 个问题",
+ limit: 10,
+ }),
+ );
+
+ expect(Array.isArray(outcome), JSON.stringify(outcome)).toBe(true);
+ if (!Array.isArray(outcome)) return;
+
+ const content = outcome.find(
+ (hit) =>
+ hit.target?.kind === "thread" &&
+ hit.target.turnId === "turn-prompt-rail-3",
+ );
+ expect(content?.summary).toBe("用户消息");
+ expect(content?.target).toEqual({
+ kind: "thread",
Review Comment:
Addressed in the current head (`10d0597c4`). The E2E now parses the scoped result identity and compares it with `desktopSessionKey({ hostId, sessionId })`; the focused unit test expects the current `任务标题` copy. The Runtime Host search tests passed 2/2.
##########
apps/desktop/src/main/runtime-host-search-ipc-main.ts:
##########
@@ -22,19 +32,27 @@ export function registerRuntimeHostSearchIpc(
runThreadSearch(request, {
listSessions: async () =>
(await deps.client.listSessions()).map(toDesktopHostSessionSummary),
- readMessages: (sessionId) =>
- readWithFallback(async () => {
- const session = await deps.client.openSession(sessionId);
- try {
- return await session.loadTranscript();
- } finally {
- await session.close();
- }
- }, null),
+ readMessages: async (sessionId) =>
+ (await deps.readFixtureMessages?.(sessionId)) ??
Review Comment:
Addressed in the current head (`10d0597c4`). The separate fixture transcript reader and fallback wiring have been removed. Thread search now uses `openSession().loadTranscript()` as the sole transcript source, closes the session in `finally`, and retains the fixture-seeded E2E regression. The focused Runtime Host search tests passed 2/2.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org