Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
04707cd to
722337d
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
722337d to
5c70037
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs real behavior proof before merge. Reviewed August 24, 2026, 2:26 AM ET / 06:26 UTC. ClawSweeper reviewWhat this changesThe branch finalizes caller-owned group history on every channel-turn exit and preserves explicit Telegram reply targets while filtering stale cached group context. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain The cleanup boundary is sound and covers the previously missed terminal exits, but the current head also changes Telegram reply-context behavior without exact-head real Telegram proof; keep this PR open until that proof and its queued channel checks complete. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherChannel turns record an inbound message and dispatch an agent response while group-history maps feed later prompts. Telegram separately filters cached chat-window context before it is attached to the agent’s inbound context. flowchart LR
A[Incoming group message] --> B[Channel turn]
B --> C[Session record]
C --> D[Agent dispatch]
D --> E[Finalize pending history]
A --> F[Telegram cached context]
F --> G[Reply-target filter]
G --> B
Before merge
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +155. Total +164 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the single core finalizer, then add a redacted real Telegram group-turn proof showing an explicit reply target survives a failed prior turn without stale chat-window context before merging green exact-head checks. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the prior failure path: the base implementation cleared history only after successful dispatch, while the focused regression cases exercise each earlier terminal escape. Is this the best way to solve the issue? Yes for the core defect: one post-admission finally is the narrow canonical owner boundary, and the Telegram filter preserves an explicit reply target while dropping unselected cached context. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f40cb158b1d8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
a4df39c to
1fd77ac
Compare
|
@clawsweeper re-review Addresses the P2 finding "Finalize history around transcript-context failures". Change: Replaced the per-catch and success-path Why this closes the finding: Regression test added: "clears pending group history when transcript-context merge fails before recording" — mocks Pre-fix / post-fix proof (local, exact head Pre-fix (HEAD reverted to the prior per-catch implementation): Post-fix (head Early-drop returns (outbound-echo, bot-loop-protection) already call oxfmt --check, oxlint (-c .oxlintrc.json), and tsgo on execution.ts are clean. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
1fd77ac to
bfb35ec
Compare
|
@clawsweeper re-review Addresses the new P2 finding "Start finalization before record-key validation". Change: Moved Why this closes the finding: Regression test added: "clears pending group history when the explicit record session key is invalid" — passes Pre-fix / post-fix proof (local, exact head Pre-fix (HEAD reverted to the prior Post-fix (head Behavior matrix now covered: oxfmt --check, oxlint (-c .oxlintrc.json), and tsgo on execution.ts are clean. Rebased onto latest origin/main (ahead 1, behind 0). |
60cf75e to
8be9210
Compare
The caller-owned group pending-history map is retained across turns; a turn must finalize it on every terminal exit so the next group turn does not replay stale context. Wrap the transcript-context merge, session recording, and dispatch in a single post-drop try/finally that calls clearPendingHistoryAfterTurn once, replacing the per-catch and success-path calls. The previous per-catch cleanup left the map populated when the pre-record transcript-context merge threw before either catch ran, so the next group turn replayed stale context. Adds regression tests for both the session-recording and transcript-merge failure paths. Closes openclaw#123193
8be9210 to
35e934d
Compare
…3193) Failed channel turns could leave caller-owned pending group history in the next prompt. Finalize it on every terminal path, and filter Telegram rolling context while preserving explicit reply ancestry. Co-authored-by: SunnyShu0925 <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Failed group turns could replay stale context on the next turn.
Two current owners participate:
runPreparedChannelTurnCoreInTracecleared caller-owned pending history only after successful dispatch. Record-key validation, transcript merge, session recording, and dispatch failures escaped cleanup.The result was a duplicated failed user turn in the next Telegram model request: once from the canonical transcript and once from stale Telegram chat-window context.
Fix
finallyafter admission. Early drops keep their existing pre-callback cleanup.is_reply_targetrows even when older ambient chat-window rows are filtered.Production delta: net
+9judged lines (+5channel terminal ownership,+7/-3Telegram context ownership). Test delta: net+155lines. The large raw channel diff is the existing record/dispatch body moving under onetry/finally.Evidence
Head:
cd41e4e798c452635a4d8ca78d801e8fcd9cdec4Regression proof before repair:
ChannelStructuredContext.Local proof after repair:
oxfmt --checkon all changed files.pnpm tsgo,pnpm tsgo:extensions, andpnpm check:test-types.historyLimitkey/filter pass.gpt-5.6-terra, high): PASS; correct patch, 0 findings, security clear, no maintainer decision, 0 Rank-up moves.Hosted CI: exact-head run 32696855590 green; 0 pending, 10 obsolete checks superseded.
Real Telegram userbot evidence
Exact head, real QA user, Telegram group/topic, deterministic provider fixture:
50461). Provider returned intentional HTTP 503; SUT surfacedLLM request failed.(50462).50463) to SUT message50462.1— canonical transcript only; stale chat-window copy absent;1;LLM request failed.strings:1— explicit reply target retained.FAILED_TURN_HISTORY_COUNT_1.Recorded artifacts include
summary.json,events.ndjson,gateway.log, andmock-openai-requests.ndjson. The first-turn 503, Telegram-native reply relation, raw request counts, and recovery response agree.Inspectable redacted exact-head artifact excerpts
summary.json/events.ndjson:{ "head": "cd41e4e798c452635a4d8ca78d801e8fcd9cdec4", "recordingComplete": true, "actions": [ {"actionType":"send","status":"completed","botApiMessageId":50461}, {"actionType":"reply","status":"completed","botApiMessageId":50463,"messageId":52914290688,"replyToMessageId":52913242112} ], "sutMessages": [ {"botApiMessageId":50462,"messageId":52913242112,"text":"LLM request failed."}, {"botApiMessageId":50464,"text":"FAILED_TURN_HISTORY_COUNT_1"} ], "observedRecoveryMessage": {"botApiMessageId":50463,"replyToMessageId":52913242112} }gateway.log:{"status":503,"message":"503 INTENTIONAL_FIRST_TURN_FAILURE"} {"event":"embedded_run_agent_end","isError":true,"error":"LLM request failed.","rawErrorPreview":"503 INTENTIONAL_FIRST_TURN_FAILURE"}mock-openai-requests.ndjson, counts over every string field in each raw request:[ {"request":1,"failed":1,"recovery":0,"reply_error":0}, {"request":2,"failed":1,"recovery":0,"reply_error":0}, {"request":3,"failed":1,"recovery":0,"reply_error":0}, {"request":4,"failed":1,"recovery":1,"reply_error":1} ]Request 4 is the changed-path recovery request.
failed: 1proves the stale duplicate is absent;reply_error: 1proves native reply ancestry remains present. Account, token, chat, session, trace, and filesystem fields are redacted.Risk