Repository navigation
Fix dashboard history projection and approval followups - #92328
Hidetsugu55 wants to merge 1 commit into
Conversation
|
Codex review: needs changes before merge. Reviewed June 21, 2026, 2:57 PM ET / 18:57 UTC. Summary PR surface: Source +41, Tests +47. Total +88 across 4 files. Reproducibility: yes. by source inspection rather than an executed failing run: current main slices recent projected history after projection and omits suppressPromptPersistence on exec approval follow-up agent requests. The PR body also supplies after-fix live gateway logs for both fixed paths. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Rebase on current main, preserve the current projector behavior, extend recent-display filtering to all hidden reasoning block variants, and land the focused regression coverage with the exec follow-up suppression fix. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection rather than an executed failing run: current main slices recent projected history after projection and omits suppressPromptPersistence on exec approval follow-up agent requests. The PR body also supplies after-fix live gateway logs for both fixed paths. Is this the best way to solve the issue? No, not yet. The approach uses the right shared projector and existing backend-only prompt-suppression contract, but the recent filter should also handle hidden reasoning/redacted thinking blocks and the branch needs a clean rebase before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against edd1d3319cce. Label changesLabel justifications:
Evidence reviewedPR surface: Source +41, Tests +47. Total +88 across 4 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Fixes dashboard history projection so toolCall-only assistant messages do not hide recent user context, and suppresses prompt persistence for exec approval follow-up resumes.
This is a clean replacement for #92312 with only the intended minimal diff.
Tests:
Real behavior proof
Behavior or issue addressed: Two operator-dashboard regressions. (1) The most recent user prompt vanished from chat history when the last assistant turn was a toolCall-only message (a read/exec tool call with no visible text): the recency window kept the toolCall-only assistant turn and dropped the user prompt. (2) After an async exec approval completed, the synthetic resume prompt ("An async command the user already approved has completed...") was persisted as a
role: "user"message, polluting the visible transcript and model context with a fake user turn.Real environment tested: A real OpenClaw gateway runtime started from this branch's worktree on macOS (Darwin, Apple Silicon), exercising the genuine gateway server, session store, exec approval manager, and chat-history projection. The model backend is a deterministic local stub HTTP server (no real LLM) so the exec tool call and the approval follow-up fire reproducibly; every other layer is the real runtime path.
Exact steps or command run after this patch: For fix 1, against a normally-started gateway over the operator socket,
node openclaw.mjs gateway call agentseeds a turn, thennode openclaw.mjs gateway call chat.historywithlimit: 1reads it back. At that point the transcript holds exactly two turns (seq 1 user "RUN_PROOF_EXEC now", seq 2 assistant toolCall-only exec), andlimit: 1is the worst case for the bug. For fix 2, a real in-process gateway with an operator client runsclient.request("agent", ...), thenclient.request("exec.approval.resolve", { id, decision: "allow-once" }), then the on-disk session transcript JSONL is read and its roles counted.Evidence after fix: Fix 1 live
chat.historyruntime output withlimit: 1returns the user prompt, not the toolCall-only assistant turn:Fix 2 live gateway runtime log of the approval cycle, plus the resulting on-disk transcript role breakdown and per-record dump (the exec result reaches the agent as a toolResult and the turn continues, with no second user turn synthesized):
Observed result after fix: For fix 1, with a
limit: 1recency window the live gateway returns the seq 1 user prompt; before this patch the same query returned only the seq 2 toolCall-only assistant turn and the user prompt disappeared. For fix 2, the async approval completion is delivered to the agent through the toolResult channel (record 6) and the assistant continues the turn (record 7), while the transcript retains a singlerole: "user"turn (the original prompt) and the "already approved has completed" resume is not written as a user message. The completion payload still reaches model context; only the spurious user-turn persistence is suppressed.What was not tested: A real third-party LLM was not used (the backend was a deterministic local stub so the tool call and follow-up are reproducible); the projection and persistence code under test is provider-independent. Multi-session and cross-channel delivery variants were covered only by the existing unit suites, not this live run.