Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesAllow authorized late structured output to repair a collector’s frozen missing-output failure after successful execution. Example: A successful collector submits schema-valid {"answer":42} after its missing-output failure is frozen.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR provides a focused repair for a current collector bug, with no actionable correctness findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCollector agents submit validated results through the registry’s existing mutation owner, which persists completion facts consumed by agents_wait. flowchart LR
A[Collector agent] --> B[Schema tool]
B --> C[Current run authority]
C --> D[Registry mutation owner]
E[Lifecycle freezer] --> D
D --> F[SQLite collector result]
F --> G[Native agents wait]
Technical reviewBest possible solution: Keep the narrow reconciliation in the existing atomic registry owner and retire the local capture only after its committed completion is returned. Do we have a high-confidence way to reproduce the issue? Current main deterministically rejects the reported frozen-completion state, supported by datrab’s boundary trace and the supplied built-Gateway base comparison; this read-only review executed no target code. Is this the best way to solve the issue? The patch repairs the authoritative completion through the existing mutation owner, preserves genuine failures and current authority, and avoids adding a competing state writer. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c11c11b7055f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +36, Tests +185, Other +2. Total +223 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 29, 2026, 4:37 AM ET / 08:37 UTC (Revision 2). |
|
@clawsweeper re-review The PR body now includes the required actual built Gateway/agent/model comparison for unchanged head |
|
🦞👀 Re-review progress:
|
Closes #138018
What Problem This Solves
Fixes:
agents_waitkeeps reporting a collector as failed when valid structured output arrives after successful execution has frozen a missing-output result.User Impact
User impact: an authorized late result repairs that missing-output failure and remains available to later waits. Real execution failures, other schema failures, existing results, expired authority, and duplicate submissions remain rejected.
Why This Change Was Made
The existing registry mutation owner now reconciles only a successful execution with a payload-free failure whose diagnostic is exactly
structured_output was not called. It preserves the existing atomic commit and authority checks. The result tool consumes the committed completion fact after awaiting persistence, so it cannot recreate the retired in-memory capture.Thanks to @datrab for the report and production-boundary reproduction. The related merged fixes #146715 and #146716 handle CLI tool exposure and yielded collectors; #112989 and #157940 handle other persistence and retirement ordering. Open #164949 concerns cron result-consumption receipts. This fixes the late-result rejection in the current registry owner.
AI-assisted implementation and verification. Simplification kept the repair in two existing owners: production +47/-11 lines, regression tests +185, and a separate exact test-line allocation +2. No new store, schema, rollback mechanism, permission, or state writer is introduced.
Evidence
The committed public-tool regression fails on unchanged main
9a3bf9584db0d1f6be90e46d0224d228118fc3b6withFailed to persist structured_output: collector run is unavailable(1 failed / 3 passed). It passes with the fix. Seven owner/consumer suites passed 393 tests across four canonical Vitest shards in 340.01 seconds. The final lint-only edits remove an unused initial assignment and add braces; the two directly affected suites were rerun afterward: all 28 tests passed in 98.27 seconds (the changed integration file has 12 cases; the schema-tool file has 16).The main regression uses the production swarm tool group, collector authority checks, schema tool, actual SQLite writer, and native
agents_wait. It verifies the frozen failure, late success, revoked writer/requester refusal, duplicate refusal, cache retirement, and repeated retained reads after clearing resident state. A separate worker-failure case verifies no publication before commit; a shared table retains execution errors, timeout, killed, other schema errors, existing payloads, and yielded-without-result failures. The main regression took 936 ms in the seven-suite run; hosted CI passed as linked below, without a separate per-test hosted timing claim.Independent final
autoreview --mode local --base 9a3bf9584db0d1f6be90e46d0224d228118fc3b6 --max-priority P3reviewed the complete changed owners and tool assembly, collector freezer, native wait, mutation, generation, memory, and schema-tool consumers: scoped-clean, no actionable findings. The earlier authentication-failed attempt is not counted as a successful review. The reviewer inspected source; the commands below were executed separately.Built Gateway, actual agent/tool execution, and SQLite capture
The same external recorder ran against separately built base
9a3bf9584db0d1f6be90e46d0224d228118fc3b6and the exact production bytes of headc71502019fcd1fd488aadafb93002d47d2182778. Each run starts an isolated built Gateway and its normal OpenClaw agent with a loopback Responses provider. Authenticatedchat.sendstarts the parent; the model invokes realsessions_spawn,structured_output, and threeagents_waitcalls. Deferred tools use the advertiseddispatch_actionand normal catalog authorization. The capture retains normalized provider call IDs and returned tool results.The test plugin only controls the reported ordering: in the actual child's
before_tool_callhook, it uses the public SDKemitAgentEventto deliver a successful lifecycle observation before letting that same tool continue. The ordinary registry listener/freezer creates the missing-output result. The recorder waits for the SQLite row using a read-only connection, lets the parent collect the failure, then releases the pending real schema tool. The hook receives the actual run/session identity; its abort signal is false before and after execution. No registry/result writer, tool implementation, returned wait result, or authority check is replaced. This deterministic ordering does not measure how often a real scheduler produces the race.Captured unchanged base (
exit 0means the expected bug was observed):Captured current head with the unchanged recorder:
Actual commands, from the isolated checkout:
The recorder SHA-256 is
e8df4eed3da3fdd640bfcff76571a5db4e084ba7b4df8e0494c3367a63be72a0. Capture directory/phase change only evidence output and assertions. Both builds and both complete flow captures exited 0. Earlier recorder setup attempts and the ENOSPC interruption are excluded from the verdict.The earlier separate source-runtime capture additionally clears resident registry/read caches, proves two retained reads, confirms the process-local structured-output cache is absent after publication, and rejects revoked/duplicate writes. Those assertions support the full Gateway evidence above; they are not described as Gateway execution.
Limits: the Responses provider is a deterministic loopback fixture; no external account or live-model service result is claimed. The successful lifecycle observation is deliberately ordered by the test plugin. This does not claim natural race frequency, release-upgrade behavior, or a process-restart test. No state layout or stored schema changes.
Validation commands
Node 24, pnpm 12, task-owned checkout and physical dependencies:
Targeted canonical lint and format cover the two production files and changed test file. The line-cap/max-lines, test-mock-export, assertion-safety ratchets and
git diff --cached --checkpass. The separate 185-line allocation covers the meaningful regression growth; shared ceilings and check rules are unchanged.The Ready-triggered hosted CI run completed successfully, and the current-head hosted review accepts the scoped Gateway proof with no actionable findings. The Gateway evidence update changes no product or test code.