refactor: streamline query requests and session storage
This commit is contained in:
@@ -17,7 +17,7 @@ it("keeps historical question invalidation across the next live snapshot", async
|
||||
const root = await mkdtemp(join(tmpdir(), "question-persistence-"));
|
||||
const workspaces = new SessionWorkspaceStore(join(root, "workspaces"));
|
||||
const sessions = new SessionMetadataStore(join(root, "metadata"), workspaces);
|
||||
const states = new SessionUiStateStore(join(root, "unused"), workspaces);
|
||||
const states = new SessionUiStateStore(workspaces);
|
||||
const context = { ...getLocalAgentContext(), sessionId: "history-session" };
|
||||
await sessions.ensure(context);
|
||||
const history: UIMessage[] = [{ id: "old-answer", role: "assistant", parts: [
|
||||
@@ -35,7 +35,7 @@ it("keeps historical question invalidation across the next live snapshot", async
|
||||
stream.apply("token", { content: "正在核查" });
|
||||
await states.write(context, { sessionId: context.sessionId, isTitleManuallyEdited: true, messages: stream.uiMessages() });
|
||||
let nativeReads = 0;
|
||||
const runtime = { getQuestionStatus: async () => { nativeReads++; return "missing"; } } as unknown as OpencodeRuntimeAdapter;
|
||||
const runtime = { getQuestion: async () => { nativeReads++; return null; } } as unknown as OpencodeRuntimeAdapter;
|
||||
const app = express();
|
||||
registerChatInteractionRoutes(app, { activeRuns: new Map([[context.sessionId, run]]), runtime,
|
||||
sessionMetadataStore: sessions, sessionUiStateStore: states });
|
||||
|
||||
Reference in New Issue
Block a user