feat(execution-history): add plugin-owned run persistence - #81
feat(execution-history): add plugin-owned run persistence#81aryasaatvik wants to merge 1 commit into
Conversation
Greptile SummaryThe PR adds an owner-scoped execution-history plugin that persists runs, tool calls, and interactions through plugin storage.
Confidence Score: 3/5The PR is not yet safe to merge because synthetic anchors can become permanent and completed runs can remain hidden from filtered history while recovery fails. A combined outbox and terminal-publication failure can leave an unrecoverable running anchor, and best-effort replay still allows completed executions whose replay fails to be excluded from completed-only list results. Files Needing Attention: packages/plugins/execution-history/src/sdk/store.ts
|
| Filename | Overview |
|---|---|
| packages/plugins/execution-history/src/sdk/store.ts | Implements buffered lifecycle persistence, atomic terminal publication, outbox recovery, cleanup, and read APIs; two previously reported recovery behaviors remain outstanding. |
| packages/plugins/execution-history/src/sdk/store.test.ts | Covers completed history, waiting-state persistence, restart replay, unavailable outbox fallback, replay cleanup failure, and cleanup exhaustion. |
| packages/plugins/execution-history/src/sdk/collections.ts | Defines owner-scoped run, tool-call, interaction, and terminal-cleanup storage schemas and indexes. |
| packages/plugins/execution-history/src/sdk/plugin.ts | Registers the storage collections, SDK extension, and execution observer as one plugin. |
| packages/plugins/execution-history/package.json | Adds package metadata, workspace dependencies, and package-local build, typecheck, and test scripts. |
Sequence Diagram
sequenceDiagram
participant Engine
participant History as Execution History
participant Blob as Blob Outbox
participant DB as Plugin Storage
participant Reader
Engine->>History: ExecutionStarted
History->>DB: Persist running run
Engine->>History: Tool calls and interactions
History->>History: Buffer details
Engine->>History: ExecutionFinished
History->>Blob: Write terminal publication
History->>DB: Atomically publish run, details, marker
History->>Blob: Delete outbox
History->>DB: Remove cleanup marker
Reader->>History: Read nonterminal run
History->>Blob: Load pending publication
History->>DB: Replay atomic publication
History-->>Reader: Return terminal history
Reviews (16): Last reviewed commit: "feat(execution-history): add plugin-owne..." | Re-trigger Greptile
910ddb3 to
9d79021
Compare
9d79021 to
264f999
Compare
3179d07 to
1d5dd93
Compare
1d5dd93 to
0155e02
Compare
0155e02 to
29e6ea1
Compare
865b3c8 to
cfe8467
Compare
2203aff to
599ade0
Compare
599ade0 to
b0fadaf
Compare
b0fadaf to
f96c62a
Compare
f96c62a to
48532a2
Compare
|
Iterative review now continues locally with |
Summary
Add an owner-scoped execution-history plugin that records runs, tool calls, and interactions without coupling persistence to the execution engine. The SDK surface stays intentionally small:
list,get, andlistToolCalls.Lifecycle
Review context
This review branch uses a temporary integration base containing the exact patches from upstream PRs UsefulSoftwareCo#1097, UsefulSoftwareCo#1098, and UsefulSoftwareCo#1119. PR UsefulSoftwareCo#1098 wraps generic FumaDB bulk writes in a transaction and uses native D1 batching where interactive transactions are unavailable, keeping each terminal publication atomic across supported adapters.
HTTP APIs, React surfaces, actor attribution, Cloudflare service-token identity, and host wiring remain follow-up layers.
Validation
oxfmt --check . '!.scratchpad/**'oxlint -c .oxlintrc.jsonc . --deny-warnings --ignore-pattern '.scratchpad/**'bun run lint:changelog-stubsbun run typecheck(45/45 tasks)TURBO_TEST_CONCURRENCY=1 bun run test(39/39 non-e2e tasks)b0fadaf7a: 4/5 configured threshold, zero commentsThe repository-wide formatter excludes the ignored
.scratchpadworking-memory directory, which has unrelated pre-existing violations.