fix #75452: Heartbeat per-turn model override persists after turn completes (2026.4.29)#75557
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. Configure a heartbeat model that differs from the primary model, run a heartbeat on a shared session, and inspect session_status or the session row; current main writes the heartbeat provider/model/context window into shared runtime fields. Next step before merge Security Review findings
Review detailsBest possible solution: Preserve heartbeat model selection as run-scoped while ensuring session status/listing derives any missing context window from the preserved runtime model rather than from the latest heartbeat transcript. Do we have a high-confidence way to reproduce the issue? Yes. Configure a heartbeat model that differs from the primary model, run a heartbeat on a shared session, and inspect session_status or the session row; current main writes the heartbeat provider/model/context window into shared runtime fields. Is this the best way to solve the issue? No. The preservation flag is the right boundary, but the missing-context branch should also cover the status/listing transcript fallback path or add status-level regression coverage before merge. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 2244ba87b362. |
d897cb6 to
2045115
Compare
2045115 to
b6bbc23
Compare
b6bbc23 to
9d34b68
Compare
9d34b68 to
ed8881b
Compare
ed8881b to
21e5e49
Compare
21e5e49 to
4103489
Compare
…ion state - Skip setting runtime model when preserveRuntimeModel is true and no prior model exists - Preserve model-only entries without borrowing heartbeat provider to avoid invalid cross-provider pairs
4103489 to
c89b3fa
Compare
BunsDev
left a comment
There was a problem hiding this comment.
Reviewed the updated head 42a00dcf38.
This is merge-ready from the maintainer review side:
- fixes the heartbeat runtime-model bleed at the session-store persistence boundary
- preserves existing runtime model/provider/context metadata for heartbeat turns without creating invalid model/provider pairs
- keeps normal non-heartbeat runtime persistence unchanged
- covers the prior blockers with focused regression tests, including model-only entries and empty prior runtime state
- refreshes the heartbeat docs and changelog attribution
Validation:
pnpm test src/agents/command/session-store.test.ts src/agents/openclaw-tools.session-status.test.tspassed locally (67 tests)pnpm exec oxfmt --check --threads=1 src/agents/agent-command.ts src/agents/command/session-store.ts src/agents/command/session-store.test.ts CHANGELOG.md docs/gateway/heartbeat.mdpassed locallygit diff --checkpassed locally- GitHub checks on
42a00dcf38are clean: no active checks, no relevant failures.
Fixes openclaw#75452. Heartbeat runs can use a per-turn model override via agents.defaults.heartbeat.model. Before this change, the run metadata was written back to the shared session store, so the next normal turn could inherit the heartbeat provider/model and a smaller context window. This lands the contributor fix plus maintainer polish: - preserve existing session runtime model/provider/context metadata when persisting heartbeat turns - avoid creating invalid provider/model pairs for legacy model-only session entries - leave empty prior runtime state unset for heartbeat-only turns - keep normal non-heartbeat runtime persistence unchanged - add focused regression coverage for the session-store edge cases - refresh heartbeat docs and changelog attribution Validation: - pnpm test src/agents/command/session-store.test.ts src/agents/openclaw-tools.session-status.test.ts - pnpm exec oxfmt --check --threads=1 src/agents/agent-command.ts src/agents/command/session-store.ts src/agents/command/session-store.test.ts CHANGELOG.md docs/gateway/heartbeat.md - git diff --check - GitHub checks on 42a00dc: clean; no active checks and no relevant failures Duplicate PR openclaw#75567 was already closed; openclaw#75557 is the canonical fix.
Fixes openclaw#75452. Heartbeat runs can use a per-turn model override via agents.defaults.heartbeat.model. Before this change, the run metadata was written back to the shared session store, so the next normal turn could inherit the heartbeat provider/model and a smaller context window. This lands the contributor fix plus maintainer polish: - preserve existing session runtime model/provider/context metadata when persisting heartbeat turns - avoid creating invalid provider/model pairs for legacy model-only session entries - leave empty prior runtime state unset for heartbeat-only turns - keep normal non-heartbeat runtime persistence unchanged - add focused regression coverage for the session-store edge cases - refresh heartbeat docs and changelog attribution Validation: - pnpm test src/agents/command/session-store.test.ts src/agents/openclaw-tools.session-status.test.ts - pnpm exec oxfmt --check --threads=1 src/agents/agent-command.ts src/agents/command/session-store.ts src/agents/command/session-store.test.ts CHANGELOG.md docs/gateway/heartbeat.md - git diff --check - GitHub checks on 42a00dc: clean; no active checks and no relevant failures Duplicate PR openclaw#75567 was already closed; openclaw#75557 is the canonical fix.
Summary
Fixes #75452
Issue
Heartbeat per-turn model override persists after turn completes (2026.4.29)
Solution
Testing