Q158: run history and run output come from the database, not the snapshot window

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-09 02:31:43 -04:00
1 parent a075f931d5
commit 9d166e3fc9
18 files changed
+222 -35

No files matched your search

+3 -1
View File
@@ -1,4 +1,4 @@
import type { TaskDeleteImpact } from "./domain";
import type { RunCursor, RunHistoryPage, TaskDeleteImpact } from "./domain";
import type { SpaceHistoryPage, ThreadHistory } from "./chat-domain";
import type { RunRequestRecord } from "./provider-runtime-domain";
import type { ApprovalDrift } from "./approval-pin";
@@ -207,6 +207,8 @@ export interface DesktopApi {
taskDeleteImpact(input: { orgId: string; taskId: string }): Promise<DesktopResult<TaskDeleteImpact>>;
/** Cancels a run that has not started yet. */
cancelQueuedRun(input: { orgId: string; runId: string }): Promise<DesktopResult<AppSnapshot>>;
/** Runs older than a loaded one, for history beyond the snapshot's recent runs. */
runHistory(input: { orgId: string; beforeRunId: string | null } & ({ limit: number } | { from: RunCursor })): Promise<DesktopResult<RunHistoryPage>>;
chatSpaceHistory(input: { orgId: string; spaceId: string; beforeMessageId: string | null } & ({ limit: number } | { fromMessageId: string })): Promise<DesktopResult<SpaceHistoryPage>>;
revokeConnector(input: RevokeConnectorInput): Promise<DesktopResult<AppSnapshot>>;
search(input: SearchInput): Promise<DesktopResult<SearchResultRecord[]>>;
+14
View File
@@ -105,6 +105,20 @@ export interface TaskDeleteImpact {
pendingApprovals: number;
}
/** A position in run history (time, then insertion), which stays valid after its run is deleted. */
export interface RunCursor {
createdAt: string;
seq: number;
}
/** A page of older runs, oldest first: whether older ones exist, the position of its oldest run, and of the run it was read before. */
export interface RunHistoryPage {
runs: TaskRunRecord[];
hasMore: boolean;
oldest: RunCursor | null;
boundary: RunCursor | null;
}
export interface TaskRecord {
id: string;
orgId: string;
+1
View File
@@ -86,6 +86,7 @@ export const IPC_CHANNELS = {
setTaskBlocked: "agentcompany:set-task-blocked",
taskDeleteImpact: "agentcompany:task-delete-impact",
cancelQueuedRun: "agentcompany:cancel-queued-run",
runHistory: "agentcompany:run-history",
revokeConnector: "agentcompany:revoke-connector",
search: "agentcompany:search",
rendererEvent: "agentcompany:renderer-event",
+3
View File
@@ -56,4 +56,7 @@ export interface RunRequestRecord {
costCents: number | null;
createdAt: string;
completedAt: string | null;
inputCharCount: number;
outputCharCount: number;
responseText: string | null;
}