Repository navigation
fix(agents): freeze every embedded dispatch and let harnesses declare who builds the prompt - #207022
Conversation
- Held, not pushed: Fable found the captures check fails fallbacks after embedded image-only or targetless dispatches. See DECISIONS.md D32 execution note.
…aration per attempt - The embedded runner freezes a turn the prompt transform could not project (it left the request, or has no text) as its own transcript text before marking it sent. - A harness declaration binds one attempt; an attempt that never sent clears it. - An empty projection of a text-free turn replays without an empty text block.
…ree handling - Fable review: skip the freeze after this attempt's first send; no producer stores a text-free array, so the empty-projection replay change and its tests go.
|
🦞👀 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: passed. What this changesThis PR freezes previously uncaptured embedded prompts and lets harnesses declare whether they capture model-facing text. Example: An embedded candidate sends “Continue the delegated task.” through sessions_send and then encounters a rate limit.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides a focused follow-up to the fallback repair, and no definite introduced correctness defect was found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe harness lifecycle selects an attempt’s projection contract; the embedded submission boundary records user text through the transcript recorder before sending a provider request. flowchart LR
A[Admitted user turn] --> B[Harness lifecycle]
B --> C[Embedded prompt boundary]
B --> D[Native runtime]
C --> E[Transcript recorder]
E --> F[Stored projection]
C --> G[Provider request]
F --> B
Technical reviewBest possible solution: Keep projection enforcement in the existing recorder and freeze embedded turns at the production submission boundary while retaining native-runtime tolerance. Do we have a high-confidence way to reproduce the issue? Current-main source shows unchanged inter-session turns bypassing capture, and the changed database-backed submission tests exercise both that path and a compacted keyless turn; no target code was executed during this review. Is this the best way to solve the issue? The patch repairs the embedded producer and keeps enforcement in the existing transcript owner, with focused changes that preserve the intentional provenance envelope and undeclared harness behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 819935f64a4a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +59, Tests +40, Docs +8. Total +107 across 13 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed November 27, 2026, 6:49 PM ET / 23:49 UTC. |
|
Maintainer override:
|
… who builds the prompt (#207022) ## Problem #206969 stopped a fallback model from failing a turn that an earlier model had already sent without a frozen model prompt (a "projection"). It did that by tolerating the missing projection for every harness. That tolerance also hid real gaps in the embedded runner, which is supposed to freeze every turn before sending it: - An inter-session message (`sessions_send`) whose text was unchanged was sent without a projection. This is the case that failed a production turn. - A turn that compaction removed from the request (a keyless turn) was sent without a projection. ## Fix - Harnesses declare who builds the prompt with a new optional field, `promptProjection: "captures" | "external"`. The default is `"external"`, so undeclared third-party harnesses behave as before. - The built-in embedded harness declares `"captures"`. Codex declares `"external"`, because its app-server builds its own turn input. - The harness lifecycle records the declaration for one attempt only. The first send locks it in, and an attempt that never sent clears it. - After a `"captures"` send, a late capture is an error again. The #206969 tolerance now applies only to `"external"` sends. - The embedded runner makes that true. Unchanged inter-session text is now frozen too. Before the first send of an attempt, a turn that the prompt transform could not project is frozen as its own transcript text, so no fallback ever re-captures it. - The new field is documented in `docs/plugins/sdk-agent-harness/core-ownership.md`. ## User impact None visible on the normal path. A turn the embedded runner sends now always carries the text the provider received, so a later fallback on any harness replays the same bytes. Third-party harnesses that do not declare the field keep the current behavior. ## Evidence - Red on main, green here: - The compacted keyless turn is frozen before dispatch, and the retained turn keeps no projection. - Inter-session turns are stored with their sent envelope (plain, forwarded and hook bodies). - A built-in (`"captures"`) send without a projection makes a later capture throw; an undeclared harness keeps the tolerance. - An attempt that never sent cannot apply its `"captures"` declaration to a later send outside the lifecycle. - Projection and fallback suites on both routes pass: embedded submit, context and boundary, the recorder, the harness lifecycle, and the Codex app-server prompt projection. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 4266586) Backport adaptation: Applies cleanly after the batch fallback-projection fix; retain the source harness declaration and transcript freeze unchanged. Co-authored-by: RomneyDa <[email protected]>
… who builds the prompt (openclaw#207022) ## Problem openclaw#206969 stopped a fallback model from failing a turn that an earlier model had already sent without a frozen model prompt (a "projection"). It did that by tolerating the missing projection for every harness. That tolerance also hid real gaps in the embedded runner, which is supposed to freeze every turn before sending it: - An inter-session message (`sessions_send`) whose text was unchanged was sent without a projection. This is the case that failed a production turn. - A turn that compaction removed from the request (a keyless turn) was sent without a projection. ## Fix - Harnesses declare who builds the prompt with a new optional field, `promptProjection: "captures" | "external"`. The default is `"external"`, so undeclared third-party harnesses behave as before. - The built-in embedded harness declares `"captures"`. Codex declares `"external"`, because its app-server builds its own turn input. - The harness lifecycle records the declaration for one attempt only. The first send locks it in, and an attempt that never sent clears it. - After a `"captures"` send, a late capture is an error again. The openclaw#206969 tolerance now applies only to `"external"` sends. - The embedded runner makes that true. Unchanged inter-session text is now frozen too. Before the first send of an attempt, a turn that the prompt transform could not project is frozen as its own transcript text, so no fallback ever re-captures it. - The new field is documented in `docs/plugins/sdk-agent-harness/core-ownership.md`. ## User impact None visible on the normal path. A turn the embedded runner sends now always carries the text the provider received, so a later fallback on any harness replays the same bytes. Third-party harnesses that do not declare the field keep the current behavior. ## Evidence - Red on main, green here: - The compacted keyless turn is frozen before dispatch, and the retained turn keeps no projection. - Inter-session turns are stored with their sent envelope (plain, forwarded and hook bodies). - A built-in (`"captures"`) send without a projection makes a later capture throw; an undeclared harness keeps the tolerance. - An attempt that never sent cannot apply its `"captures"` declaration to a later send outside the lifecycle. - Projection and fallback suites on both routes pass: embedded submit, context and boundary, the recorder, the harness lifecycle, and the Codex app-server prompt projection. Co-authored-by: Ayaan Zaidi <[email protected]>
* fix: show Claude CLI document uploads only once in chat * fix: show Claude CLI document uploads only once in chat OpenClaw-Publication: 4555cb04-bff2-43b3-aff8-ec271d6567b2 * fix: keep Claude document uploads on the message that sent them * fix: preserve the released message queue result contract Release adaptation: Use an optional accepted-input observer instead of widening queueMessage's released Promise<void> contract. Reuse the stable steering and transcript-rewrite handlers; leave source admission, native image steering, config, and all SQLite schemas unchanged. The existing history index columns also carry exact document correlation. Keep the released model-hook test layout. Companion audit through be407a4: no later #203866 reference. PRs #208535 (Claude compacted fork summaries), #206158 (native subagent status), and #205663 (image dimensions) are separate. PRs #208252 (Codex source), #207022 (embedded prompt dispatch), #206969 (fallback), #205963 (Copilot question policy), and 50a7368 (snooze) do not own this path. SHA mentions in #204700 and #204685 are update/qualification records, not follow-ups. (cherry picked from commit 269f884) Co-authored-by: RomneyDa <[email protected]>
Problem
#206969 stopped a fallback model from failing a turn that an earlier model had already sent without a frozen model prompt (a "projection"). It did that by tolerating the missing projection for every harness. That tolerance also hid real gaps in the embedded runner, which is supposed to freeze every turn before sending it:
sessions_send) whose text was unchanged was sent without a projection. This is the case that failed a production turn.Fix
promptProjection: "captures" | "external". The default is"external", so undeclared third-party harnesses behave as before."captures". Codex declares"external", because its app-server builds its own turn input."captures"send, a late capture is an error again. The fix(sessions): let a fallback run after the turn was dispatched without a projection #206969 tolerance now applies only to"external"sends.docs/plugins/sdk-agent-harness/core-ownership.md.User impact
None visible on the normal path. A turn the embedded runner sends now always carries the text the provider received, so a later fallback on any harness replays the same bytes. Third-party harnesses that do not declare the field keep the current behavior.
Evidence
"captures") send without a projection makes a later capture throw; an undeclared harness keeps the tolerance."captures"declaration to a later send outside the lifecycle.