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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3590b70f21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -102,8 +102,6 @@ export async function prepareTerminalWithSettledTurnFinalization(input: { | |||
| prepared.recoveredFinalAssistantPayloadsAfterPromptTimeout, | |||
| hasTerminalToolPresentation: input.finalization.hasTerminalToolPresentation, | |||
| terminalState: initial.terminalState, | |||
There was a problem hiding this comment.
Skip durable fallback writes for detached runs
When sessionPersistence is "detached" and a third-party harness omits the optional finalizer, this newly enters the fallback path. The orchestrator still supplies the resolved durable session identity, and persistSettledToolFallbackTranscript() writes through it without checking sessionPersistence, violating the contract in src/agents/embedded-agent-runner/run/params.ts:98-99 that detached runs never write durable transcript state. If the borrowed session row exists, an ephemeral/helper run can therefore leak this fallback into the durable conversation; skip mirror persistence for detached runs and cover the absent-callback case.
Useful? React with 👍 / 👎.
| tools. Canonical failed-tool metadata remains attached to the terminal result. | ||
| Runs with `silentExpected` never synthesize or persist this fallback. | ||
|
|
||
| Cancellation remains terminal and does not produce the fallback. Finalization |
There was a problem hiding this comment.
Make fallback persistence cancellation-atomic
When the callback is absent and cancellation arrives after appendAssistantMirrorMessageByIdentity() commits its append but before its post-append abort check, the resulting abort is swallowed by persistSettledToolFallbackTranscript() and the outer function returns the original cancelled attempt, while the fallback remains durably visible in the transcript. This contradicts the new cancellation guarantee; make persistence/building cancellation-atomic or retain the committed outcome, and test a committed append followed by cancellation rather than only an ok: false mock.
AGENTS.md reference: AGENTS.md:L135-L135
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. What this changesThe branch lets settled tool turns receive a deterministic fallback when their agent harness lacks a final-summary callback, and adjusts transcript handling, regression coverage, and harness documentation. Review scores
Merge readiness⛔ Blocked before merge - 7 items remain This PR still addresses a distinct missing-callback gap on current main and the latest release. Maintainer discussion supports retaining it, but all four prior findings remain unresolved. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherAgent harnesses execute model turns and report completed tool work to OpenClaw. Terminal recovery converts those results into transcript entries and replies that the channel dispatcher can deliver. flowchart TD
A[Completed tool work] --> B[Terminal recovery]
B --> C[Final-summary callback available]
C -->|Yes| D[Tool-free summary]
C -->|No or failed| E[Deterministic fallback]
E --> F[Transcript commitment]
D --> G[Outer settlement]
F --> G
G --> H[Channel reply]
Technical reviewBest possible solution: Use one committed terminal outcome across transcript persistence, cancellation settlement, and delivery, with deduplication scoped to the admitted turn. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the missing-callback early return and the remaining cancellation and deduplication failures. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? The existing host fallback is the right owner, but the patch is incomplete: commitment must survive transcript notification and outer settlement, and its key must distinguish admitted turns. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 314bae176cb5. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfaceSource +3, Tests +321, Docs +5. Total +329 across 9 files. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 HistoryReview history (9 earlier review cycles; latest 8 shown)
Reviewed October 2, 2026, 9:30 PM ET / October 3, 2026, 01:30 UTC (Revision 10). |
|
Updated the branch at What changed
Evidence
Please re-review the updated SHA, especially the detached and pre/post-append cancellation boundaries. @codex review |
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Correct terminal boundary. An absent finalizer should enter the same deterministic no-model fallback as an exhausted finalizer, while silence, cancellation and persistence fencing remain authoritative. This avoids replaying settled tools.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f3705e72e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| sessionTarget: committedSessionTarget, | ||
| }) | ||
| : undefined; | ||
| if (!transcriptIdempotencyKey && input.finalization.abortSignal.aborted) { |
There was a problem hiding this comment.
Preserve the committed fallback through outer cancellation
When a normal channel turn is cancelled after the transcript append commits, this check lets the helper return the fallback, but the outer lifecycle still sees the same aborted signal: src/agents/embedded-agent-runner/run-entry.ts:581-590 declines the accepted terminal and src/auto-reply/reply/agent-runner-fallback-settlement.ts:47-51 returns aborted before committing the outcome. Fresh evidence in this update is that the new integration invokes the helper directly and calls setNoAbort(), bypassing those production checks. The race therefore still leaves a durable assistant row while the channel run drops its returned/delivered payload; carry the committed-append fact through the outer cancellation owner.
AGENTS.md reference: AGENTS.md:L45-L48
Useful? React with 👍 / 👎.
| @@ -509,6 +510,9 @@ async function persistSettledToolFallbackTranscript(input: { | |||
| idempotencyKey, | |||
| signal: input.abortSignal, | |||
| text: SETTLED_TOOL_FINALIZATION_FALLBACK_TEXT, | |||
| // The append commit owns the cancellation cutoff. Publishing afterward | |||
| // must not turn an already-durable fallback into a cancelled terminal. | |||
| updateMode: "none", | |||
There was a problem hiding this comment.
Broadcast the committed fallback transcript update
For every durable missing-finalizer fallback, updateMode: "none" makes appendAssistantMirrorMessageByIdentity skip its publishTranscriptUpdate call. The resulting payload is marked assistantTranscriptOwned, so downstream delivery uses mirror: false and does not publish later either. Consequently gateway transcript subscribers and transcript-derived session-list previews remain stale until another transcript mutation or reload; preserve the post-commit cancellation cutoff while still broadcasting the successful append without another abort check.
Useful? React with 👍 / 👎.
| sessionTarget: committedSessionTarget, | ||
| }); | ||
| if (input.finalization.abortSignal.aborted) { | ||
| const transcriptIdempotencyKey = persistSession |
There was a problem hiding this comment.
Scope fallback idempotency to the admitted turn
For the newly enabled missing-finalizer path, two distinct admitted turns in one session can reuse a runId, yet this persistence call ultimately uses only ${runId}:settled-finalization-fallback as its key at src/agents/embedded-agent-runner/run/settled-turn-finalization.ts:494. Because the fallback bytes are fixed and replay comparison ignores timestamps, the second append returns the first row as an idempotent success, while the second reply is delivered and marked transcript-owned without its own durable entry. Include immutable admission/turn identity in the key while retaining same-turn retry deduplication.
AGENTS.md reference: AGENTS.md:L159-L159
Useful? React with 👍 / 👎.
|
CI completed with 162 successful checks. The only test failure is I attempted both the workflow and job-specific rerun. GitHub rejected the workflow rerun and the job endpoint requires upstream repository admin rights. Could a maintainer please rerun failed jobs for Actions run The requested Codex re-review on |
|
Related merge: #140367 landed in main on September 6, 2026 (04081aa). It aligns commentary-aware recovery-context capture with the downstream synthetic provider-error payload gate, allowing an available tool-free finalizer to run after a truncated completions stream. It does not remove the early return when |
f3705e7 to
601c46c
Compare
|
Thanks for clarifying the boundary and for landing #140367. I rebased this PR onto current The refreshed diff now isolates the distinct case you identified: when The refresh also makes the lifecycle contract explicit:
Fresh proof on |
601c46c to
2ed37d1
Compare
|
Rebased again onto current To reduce review load, the branch is now a single commit with no orchestration ledgers or intermediate planning commits. The remaining delta is specifically the absent-callback boundary: settled post-tool work receives the deterministic host fallback when The refresh preserves the newer upstream delivery policy:
Fresh evidence on the rebased SHA:
|
2ed37d1 to
609eaf3
Compare
609eaf3 to
d11773d
Compare
|
Hi! I’ve refreshed the branch and resolved the documentation conflict introduced by the agent harness reference split. The focused tests (74/74), check:changed, docs checks, and full build all pass locally. CI is rerunning on the new head. When convenient, I’d appreciate a maintainer review and merge once the refreshed checks are green. Thanks! |
|
Related: #154930 merged into main and silences the host-generated missing-summary fallback for cron-triggered runs, preserving that silent outcome through terminal resolution. Release availability and deployment are unverified. This does not supersede the absent-callback work here. Main still skips settled-turn finalization when the harness callback is absent; the cron change only alters fallback handling after that path is reached. Detached persistence and post-append cancellation semantics are also outside its scope. Keeping this PR open; the merge does not establish that these behaviors are resolved. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
dispatchReplyFromConfigWhat Problem This Solves
Codex can complete a turn after tool side effects without emitting a final assistant message. Current
mainrecovers this when a tool-free finalizer is available, including truncated completion streams after commentary. A distinct gap remained when the selected harness exposed nofinalizeSettledTurncallback: OpenClaw returnednot-attemptedbefore reaching its existing safe host fallback.This refresh keeps the merged available-finalizer behavior and removes only that stale availability precondition.
Why Each Change Exists
User Impact
A settled tool turn no longer ends silently merely because its harness omits the optional finalizer. OpenClaw emits the deterministic no-model fallback once, while preserving deliberate silence, failure-honest terminal errors, detached non-persistence, and cancellation semantics.
Evidence
601c46ccf71224c6a5b20c6040009cd4e19fbc35pnpm check:changed: exit 0pnpm build: exit 0git diff --check origin/main...HEAD: exit 0NO_MATERIAL_FINDINGSitem/completedapplies item-side effects separately;turn/completedmay contain no loaded assistant items04081aa1361d6a4097d0b489126a737481220f53is preserved and remains an ancestorScope and Risk