fix(auto-reply): preserve session model display for heartbeat usage#82267
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. Source inspection shows current main receives heartbeat state but persists the heartbeat Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the narrow heartbeat-aware persistence fix after redacted real runtime proof is added and protected-label handling clears; keep heartbeat cost attribution and CLI binding policy questions separate. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main receives heartbeat state but persists the heartbeat Is this the best way to solve the issue? Yes for the code shape. Passing the existing heartbeat flag into the shared persistence boundary is the narrow maintainable fix because it preserves display identity only for heartbeat runs while leaving usage, cost, context, and normal model updates unchanged. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 16e5d6692dcc. Re-review progress:
|
OpenClaw QA ArtifactsSummaryHeartbeat session model display proof for PR #82267.
Evidence
|
00e8977 to
4e85f6d
Compare
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
c61c83d to
1420f5f
Compare
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs
…penclaw#82267) * Preserve session model display for heartbeat usage * Refresh checks after proof update * chore: refresh CI after main repairs

Summary
model/modelProviderdisplay fields when a heartbeat run persists usage for a different heartbeat modelFixes #62954.
Tests
CI=1 node scripts/run-vitest.mjs src/auto-reply/reply/session.test.ts src/auto-reply/reply/followup-runner.test.tspnpm exec oxfmt --check --threads=1 src/auto-reply/reply/session-usage.ts src/auto-reply/reply/session-run-accounting.ts src/auto-reply/reply/agent-runner.ts src/auto-reply/reply/followup-runner.ts src/auto-reply/reply/session.test.ts src/auto-reply/reply/followup-runner.test.tspnpm check:changedReal behavior proof
Behavior or issue addressed: heartbeat turns using
agents.defaults.heartbeat.modelcould overwrite a session's persisted displaymodel/modelProvider, making UI/history show the heartbeat model until the next user turn.Real environment tested: local OpenClaw checkout on Ubuntu 24.04 under WSL, exercising the real session usage persistence path used after agent runs.
Exact steps or command run after this patch:
CI=1 node scripts/run-vitest.mjs src/auto-reply/reply/session.test.ts src/auto-reply/reply/followup-runner.test.ts.Evidence after fix: before/after proof bundle published via Crabbox artifacts:
Observed result after fix:
origin/mainplus only the new regression spec fails because heartbeat usage overwrites the stored display model; this PR branch passes the same focused shard and preservesmodel/modelProviderwhile usage/cache/token fields update.What was not tested: a live heartbeat tick in the control UI; this PR validates the source-level persistence path that caused the stale UI model.