fix: reset websocket lineage after final answers#78142
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: no. high-confidence live reproduction was established here. Source inspection does show the planner-level path on current Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land a narrow version after the contributor adds redacted real behavior proof, a changelog entry, and targeted validation; keep the broader stale subagent/history work tracked separately. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was established here. Source inspection does show the planner-level path on current Is this the best way to solve the issue? Yes for the narrow WebSocket lineage slice: forcing one full-context send across a final-answer-to-new-user boundary is targeted and preserves incremental sends for ordinary continuations. It is not merge-ready until proof and changelog are supplied. Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0da9f7e88d6f. Re-review progress:
|
|
Merge-tree is clean against current main and the review threads are clean. Three required checks are still red and blocking:
Otherwise this is the cleanest of the three #78055-cluster PRs (#78142 / #78146 / #78147) — surgical guard, narrow blast radius, planner regression in place. |
8b572f2 to
db85f7f
Compare
|
Thanks @100yenadmin. Closing this as superseded by #79726. This PR works around a suspected stale replay by changing OpenClaw's custom OpenAI Responses WebSocket lineage planner. We are removing that planner instead. #79726 deletes the custom That is the cleaner boundary: OpenAI/Codex Responses chaining stays inside the PI/Codex transport that owns it, and OpenClaw no longer needs to decide when to disable Proof in #79726:
#78055 is still referenced, but the remaining issue scope includes subagent announce/session-history contamination beyond this custom-WS lineage theory. |
Summary
final_answerand the next suffix starts with a new user message.Why
#78055 shows a fresh second final answer replaying an already-completed task after a newer user request and unrelated tool calls. That points at stale
previous_response_idlineage being reused across completed final-answer boundaries. This surgical guard forces a full-context send for the first request after a phased final answer, then allows incremental behavior to resume inside the new turn.Related
Tests
git diff --check✅node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/agents/openai-ws-stream.test.ts --maxWorkers=1node_modules/vitestnode_modulessymlink from sibling checkout:node scripts/run-vitest.mjs run --config test/vitest/vitest.agents.config.ts src/agents/openai-ws-stream.test.ts --maxWorkers=1ENOSPC: no space left on device, write; root volume had ~120MiB available)--no-verifybecause the local hook tried to run missingoxfmtin this worktree.