Repository navigation
Scope Codex heartbeat guidance to heartbeat turns - #76788
Conversation
|
Codex review: needs changes before merge. Summary Reproducibility: yes. Current main source has Next step before merge Security Review findings
Review detailsBest possible solution: Keep the trigger-scoped prompt split, correct the changelog attribution, resolve the dirty merge state, and land after required CI and maintainer review complete. Do we have a high-confidence way to reproduce the issue? Yes. Current main source has Is this the best way to solve the issue? Mostly yes. The PR uses the narrow trigger-scoped overlay and existing Codex collaborationMode contract, but the changelog credit and dirty merge state should be fixed before merge. Full review comments:
Overall correctness: patch is correct Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4e82cacc84dc. |
43ef6f0 to
eefc0be
Compare
|
Addressed the changelog review: the Codex/heartbeat entry now credits |
* fix(codex): scope heartbeat guidance to collaboration mode * fix heartbeat tool direct context * test prompt heartbeat collaboration snapshots * fix heartbeat changelog credit
* fix(codex): scope heartbeat guidance to collaboration mode * fix heartbeat tool direct context * test prompt heartbeat collaboration snapshots * fix heartbeat changelog credit
* fix(codex): scope heartbeat guidance to collaboration mode * fix heartbeat tool direct context * test prompt heartbeat collaboration snapshots * fix heartbeat changelog credit
* fix(codex): scope heartbeat guidance to collaboration mode * fix heartbeat tool direct context * test prompt heartbeat collaboration snapshots * fix heartbeat changelog credit
The prompt audit showed that OpenClaw's heartbeat philosophy was still living in the shared GPT-5 friendly overlay. That meant ordinary Telegram and Discord chat turns could read proactive-heartbeat guidance even when the turn was just a normal user reply.
This moves that guidance onto the heartbeat turn itself. OpenClaw now sends Codex a Default collaboration mode on every app-server turn. Normal turns ask Codex to use its built-in Default mode text, while heartbeat turns provide OpenClaw's heartbeat guidance as turn-scoped collaboration-mode developer instructions.
The snapshots now make that boundary visible: regular direct and group turns no longer include the Heartbeats section, and the heartbeat snapshot has a Codex Collaboration Mode Instructions layer. The shared OpenAI/GPT-5 overlay follows the same split, so non-Codex OpenAI paths only get heartbeat initiative guidance when the run trigger is actually a heartbeat.
Observed heartbeat behavior
I restarted Pash's dev agent on this branch and waited for real scheduled heartbeats rather than relying on a manual system-event trigger. The first real interval heartbeat proved that the structured heartbeat tool path was active, but it also exposed a remaining prompt conflict: the heartbeat prompt no longer contained
HEARTBEAT_OK, while the compiled direct-chat context still contained staleNO_REPLYguidance. This PR now fixes that by marking heartbeat tool turns as message-tool-only source delivery before prompt composition.After that fix, the next real scheduled heartbeat had the shape we want. The submitted heartbeat trigger prompt did not contain
HEARTBEAT_OK, the compiled system prompt did not containNO_REPLY, and the model did not treat the wake as a visible chat response. It used OpenClaw tools to do proactive work: it listed Discord channels, read the active public Discord follow-up channel, checked the live Lobstar counters, recorded the fresh state in memory, and then calledheartbeat_respondwithnotify:false.The heartbeat tool summary was concrete: it had checked
HEARTBEAT.md, the Discord #general follow-ups, and the Lobstar counters; it found no new messages after the prior public response, confirmed the visible List and/api/testcounts, and logged the check in memory. Its reason for not notifying was also the right product behavior: there was no user-visible blocker, decision, safety issue, or notable completed result worth interrupting Pash about. That meets the bar for the heartbeat behavior because the agent woke up, oriented itself from durable heartbeat instructions, used tools to inspect the live workstream, made forward progress by updating memory, and stayed quiet for an explicit reason instead of spamming Telegram or returning a text sentinel.