Repository navigation
fix: preserve queued skill invocation outcomes - #4054
Conversation
Generated-by: OpenAI Codex
|
This is a synthesis of the independent blind review by @Sol-404ARE at exact head What I checked myself:
Findings from Sol's review (file:line anchored): Standards — GO (0 P0–P3)
Spec — GO (0 P0–P3)
Explicit exclusions noted: blocked outcomes intentionally admit nothing and can succeed later; legacy rows migrate to empty because historical failures were never recorded; a consumed queued receipt may still answer What I did not judge: a full live Host recovery with a queued Skill failure across a real restart was not executed beyond unit/integration coverage — verification was by code inspection and the suites noted above. Gate: Standards 0 and Spec 0 — no P0–P2,
|
…ueued-skill-outcomes Generated-by: OpenAI Codex # Conflicts: # packages/runtime-host/src/__tests__/message-coordinator.test.ts # packages/runtime-host/src/protocol/index.ts # packages/runtime-host/src/server/message-coordinator.ts # packages/storage/src/sqlite-session-metadata-schema.ts # packages/storage/src/sqlite-session-metadata-store.ts
…ueued-skill-outcomes # Conflicts: # packages/runtime-host/src/protocol/index.ts
…ueued-skill-outcomes # Conflicts: # packages/runtime-host/src/protocol/index.ts # packages/storage/src/__tests__/sqlite-session-metadata-store.test.ts
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for carrying queued Skill outcomes through the Host-owned admission and SQLite recovery paths. I reviewed exact head 1553a2149e5b752510031a3bb211fa05e1892f00; the normal steering/follow-up paths now preserve the structured result, and I left one P2 durable-proof recovery suggestion inline. The branch is currently conflicting and its exact-head required test is failing, so it will need rebase and fresh verification after the recovery case is addressed. Please do push back if the intended contract is explicitly ‘feedback only on the first response’ rather than the retry/durable-proof behavior described in the PR.
中文摘要
谢谢把 queued Skill outcome 接入 Host admission 和 SQLite 恢复。正常 steering/follow-up 已修复,但响应丢失后从 durable proof 重试时,已持久化的 outcome 仍被丢弃;Desktop/CLI 因 outcome_unknown 不再展示 Skill 反馈。若产品合同明确是“只在第一次响应报告一次”,欢迎 push back;否则建议补齐该恢复分支。当前还需重基并恢复 exact-head test。
AI-assisted review disclosure: Codex ran an independent analysis lane; Astro-Han independently verified the exact head, production path, and severity, and owns this review.
There was a problem hiding this comment.
I found one P2 in the durable retry path. The normal queued Skill outcome flow and the previously reported durable replay case are fixed, but a follow-up that is promoted before handoff can no longer be matched by the original request after a Host restart. The inline comment includes the reproducing sequence and the missing invariant. Local build, typecheck, focused Runtime Host/Storage/Desktop/CLI tests, full CLI, and exact-head hosted checks passed; unrelated baseline/environment failures remain in the full Runtime Host and Desktop suites.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
hqhq1025
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 3409e15d20033f37ff0b5d7d79a4f594591fc214. I found no remaining P0-P3 issues.
The previous durable-retry issue is fixed by preserving the immutable submitted placement alongside the promoted live placement, carrying it through storage normalization and recovery, and comparing retries against submittedPlacement ?? placement. The new regression covers the exact queued next_turn -> promotion -> terminal handoff -> old-Epoch retry sequence and verifies that the original retry replays the stored Skill outcome while a current_turn retry still conflicts.
Local build, full typecheck, focused Runtime Host/Storage tests, changed-file formatting, diff checks, and merge-tree validation passed. The full Runtime Host and Storage suites each retained one environment/baseline failure that reproduces on the previous head. Exact-head hosted test and windows_recovery are green.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for the durable-retry update. I confirmed that submittedPlacement now stays immutable through admission, promotion, handoff, restart recovery, and retry matching; the earlier functional findings are fixed. I have one test-quality suggestion below. This was an AI-assisted review using Codex; I independently traced the storage/coordinator paths and exact-head CI. Please push back if this fixture exercises a persistence seam that I have overlooked.
| submittedContent, | ||
| skillInvocation, | ||
| ); | ||
| fixture.receipts.set(source.messageId, { |
There was a problem hiding this comment.
Thanks for adding the exact promotion/retry regression. [P3] This test manually manufactures the durable receipt in the fixture Map after beginTerminalTransition, so it verifies coordinator payload comparison but not the production RootTurnCoordinator / admission store / SQLite / reopen path that must actually preserve submittedPlacement. A future persistence omission could therefore leave this test green. Could we either rename/comment it as coordinator-level only, or replace it (rather than add another duplicate matrix) with one focused persistence round-trip through the real owner? Please push back if fixture.receipts is backed by the production durable store in this fixture.
There was a problem hiding this comment.
Replaced the coordinator-only fixture test in 7f9759b with a focused RootAdmissionOwner → AgentRunStore → SQLite close/reopen → recoverSession round-trip. The new test verifies that a promoted source recovers submittedPlacement=next_turn while its effective placement remains current_turn, and the old duplicate matrix was removed.
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for the durable-retry fixes. I rechecked exact head 3409e15: the original Skill outcome now survives admission, promotion, handoff, restart recovery, and replay, and the required checks are green. The remaining test-boundary P3 is non-blocking. This was an AI-assisted review using Codex; I independently verified the production ownership path, recovery behavior, exact head, and CI. Please push back if any invariant has been misread.
…ueued-skill-outcomes # Conflicts: # packages/runtime-host/src/protocol/index.ts
|
@Astro-Han I've addressed the remaining non-blocking P3 by replacing the coordinator-only fixture with a focused production persistence round-trip test. This PR is ready to merge—could you please merge it when convenient? Thanks! |
…ueued-skill-outcomes # Conflicts: # packages/runtime-host/src/protocol/index.ts
hqhq1025
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 05ede86ffe95b78b7c10573a9687b38b4bc5af79. I found no remaining P0-P3 issues.
The three previously reviewed functional commits are unchanged. The new delta replaces the synthetic persistence fixture with a production SQLite close/reopen regression: root-admission-owner.test.ts now admits a promoted source through RootAdmissionOwner, closes and reopens the real store, recovers the session, and verifies both the immutable submittedPlacement and effective promoted placement. Together with the existing coordinator promotion/update coverage, this resolves the prior test-boundary concern. The merge from current main also resolves the protocol conflict correctly at compatibility epoch 79 while preserving the epoch 78 OAuth history.
Local clean install, build:test, full typecheck, focused coordinator/admission/protocol tests (74/74), lint, formatting, diff checks, and a clean merge-tree passed. The full Runtime Host and Storage suites each retained the same single environment/baseline failure recorded on the previous reviewed head; neither failing path is changed by this PR. Exact-head hosted test and windows_recovery are green.
The local review host used Node 22.22.1. The existing APPROVED review is bound to the older 3409e15 head and does not independently cover this commit.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
Summary
Preserve the Host-produced
SkillInvocationResultfor every admitted message disposition instead of dropping it when a Skill message is steered or queued behind a running Turn.skillInvocationonsteering,followup,turn_started, andblockedsubmit resultsFixes #4026
Verification
npm test -w @maka/storage— 981 passed, 0 failed, 16 platform skipsnpm test -w @maka/runtime-host— 1315 passed, 0 failed, 9 platform skipsnpm test -w @maka/desktop— 1624 passed, 0 failednpm test --prefix packages/cli— 545 passed, 0 failednpm run lint— passednpm run typecheck— passedgit diff --check— passednpm test— all workspaces passed except the pre-existingpackages/runtimemacOS Bash executable-root assertion, which expects/usr/localeven when that root is already represented by the current/usr/local/bin/node; the same failure was reproduced before this changeMigration and compatibility
TurnMessageSubmitResult.skillInvocationis now required for every dispositionAI use
Select exactly one:
Tool(s) and scope:
OpenAI Codex implemented the protocol, Runtime Host, storage migration, Desktop/CLI forwarding, tests, documentation, and verification described above.
Checklist
Does this PR entail a change in behavior?