Repository navigation
feat: show confirmed AO actions in chat - #6507
harshitsinghbhandari wants to merge 12 commits into
Conversation
🏆 Review leaderboardOct 3–10, 2026 · UTC
Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded. Show 6 more reviewers
|
illegalcall
left a comment
There was a problem hiding this comment.
Requesting changes for three verified defects in the new action history: SQLite rejects the new activity kind, asynchronous agent switches never settle their activity, and repeated rename transitions overwrite earlier history.
Verification: the existing session service suite and the real manager's TestSwitchAgentReturnsAfterDurableAdmission pass. A temporary regression against the fully migrated SQLite store fails with the kind CHECK constraint; service regressions reproduce the stuck switch status and the missing third rename. Full local CI and a live desktop run were not repeated; the current remote checks are green.
illegalcall
left a comment
There was a problem hiding this comment.
Re-reviewed the three original findings at 9e119b2.
- Fixed: SQLite accepts
ao_action.TestMigration0195AllowsAOActionAndKeepsActivitySchemaandTestUpsertActivityPersistsAOActionOnMigratedStorepass. - Still needs a fix: a terminal switch callback can be overwritten by the later admission write, leaving the activity Running again.
- Still needs a fix: the process-local rename counter resets on daemon restart and reuses an earlier operation ID.
The new happy-path switch/rename tests and five focused real-manager tests pass. Temporary regressions against the real migrated SQLite store reproduce the restart collision and the callback-before-admission ordering for both completed and failed switches. This re-review is scoped to the three original findings; live desktop UI and full local CI were not repeated.
Record daemon session and pull request claim outcomes as ao_action activities with a stable operation id, and render them as short batched labels.
Drop the unused session lookup result and group test imports with the local prefix.
SQLite still rejected the new kind, so action writes never landed. Widen the check without rebuilding rows, indexes, or CDC triggers.
A durable terminal switch updates the activity admitted as running, including later recovery of the same switch. Each successful rename gets its own operation id, while an unchanged name still writes nothing.
The pending approval is still the only provider activity. The new session.spawned row is recorded beside it.
The worker can finish before SwitchAgent records admission. A running write now leaves an existing completed, failed, or cancelled row in place. Migration 0195 is recorded in the shipped version ledger.
A process-local counter reused provider item IDs after the daemon started again. Successful renames now use a UUID, and an unchanged name still writes nothing.
6118462 to
6d98a92
Compare
|
Adil is already working on the agent-switch issue. We ran the rename sequence live with a real Codex agent on The rename issue did not reproduce on that build. This does not confirm a fix in this PR: #6507 is still unmerged, and |
Main claimed migration 0196, so the ao_action kind check moves to 0197. Orchestrator rename refusal and the action activity behavior stay.
illegalcall
left a comment
There was a problem hiding this comment.
Retested the latest PR head, 13d4391.
Verified fixed:
- SQLite accepts
ao_action: the migration 0197 schema test and real-store persistence test pass. - Rename history survives restart: the real-store regression passes. I also ran the actual PR desktop build with a real Codex agent through Reviewer -> Ship -> Reviewer -> full app/daemon restart -> Ship. All three completed rename activities remain, with distinct operation IDs and the correct order. This live test used the PR build, rather than the earlier main-only demonstration.
Still open:
- The switch guard has a gap between its status read and its activity write. A terminal callback arriving in that gap is still overwritten by Running. The inline comment gives the reproduced ordering.
The original full session-service suite passes (122.446s), as does the PR's callback-before-admission regression. A temporary deterministic regression against the real SQLite store fails for both completed and failed outcomes when the callback runs between the status read and the admission write. I did not reproduce this forced switch timing in the live UI or repeat all local CI jobs.
The admission status read can finish before the terminal callback writes. The store now decides from the row it just loaded under the writer lock, so a later running upsert leaves a completed or failed switch in place.
The replay can finish with almost none of the five minute context left. The snapshot and provider-event checks now use their own deadline.
Code changes: +1061 -50
Tests: +867 -37
Others: +2 -1 (generated OpenAPI and frontend schema)
Summary
Chat records daemon-confirmed AO session mutations as
ao_actionactivities. The collapsed label is a short verb. Expansion holds the target, prior value, link, and status. Replay of the same operation settles one row. A write failure does not change the mutation result.Desktop Archive calls
POST /api/v1/sessions/{id}/kill. Kanban archive is derived fromisTerminated. The daemon emitssession.terminatedfor that kill. There is no separate archive mutation.There is no daemon pull-request creation path (
CreatePullRequestdoes not exist).pull_request.createdis renderer vocabulary only. A shellao spawnor an MCPcreate_pull_requeststays an ordinary command or tool activity. This PR does not claim end-to-end capture of pull request creation.Changes
ao_actionwithdetail.action(nodetail.event, so existing run batching stays intact). Actions:session.spawned,session.terminated,session.renamed,session.restored,session.agent_switched,pull_request.claimed, plus render-onlypull_request.created.providerItemIdao-action:{action}:{operationID}. Spawn success uses the child session id and is written on the parent conversation whenParentSessionIDis set. Failures and cancellations use the pre-wrap error socontext.Canceledstays cancelled.javascript:and other non-allowlisted links. Text is capped at 160 runes.ao_action:{action}, counts repeats, and renders an accessible expandable row with session links. Labels are in all eight catalogs. MobileActivityKindincludesao_action.Regression coverage
go test ./internal/service/sessionpassed with task AO environment variables unset.golangci-lintv2.13.2 (--path-mode=abs) reported 0 issues.Validation gaps
These failed in
go test ./...against this machine and are outside this diff:opencodev2TestV2RejectsFailuresWithoutSideEffects/malformed_version: local~/.opencode/bin/opencodereports OpenCode 1.18.32, and the test expects the word "version".codexappserverTestGeneratedProtocolMatchesTheInstalledProvider: installed provider method set does not match the generated protocol (29 extra installed methods, generatedthread/rollbackmissing from the install).cliTestBrowserRequiresSessionAndValidWait: capability errorUnknown session (SESSION_NOT_FOUND)against a live daemon.go test -race ./...was not run. CLI e2e (go test -tags e2e) was not run. Frontendtsc --noEmitpassed before the main merge; the merge and the lint commit did not change TypeScript.Rollout
Ships with the desktop app and daemon together. Existing conversations gain activities only for mutations after this build. No migration.
Omissions
pull_request.created.