fix(heartbeat): align response tool prompts#76458
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Source inspection on current main shows heartbeat runs can be prompted to call Next step before merge Security Review detailsBest possible solution: Land this PR or an equivalent narrow fix after maintainer review and exact-head validation, preserving structured heartbeat prompts only when Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows heartbeat runs can be prompted to call Is this the best way to solve the issue? Yes. The proposed fix is the narrowest maintainable path I found: carry the prompt/tool decision through reply options into tool construction, and force commitment-only runs back to the legacy text ack contract. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against f696be950bdd. |
pashpashpash
left a comment
There was a problem hiding this comment.
Thanks @vincentkoc. This is the right follow-up to #76338: the prompt contract and tool-availability contract need to move together, and keeping tool-disabled commitment check-ins on the legacy ack path is the correct boundary.
* fix(heartbeat): align response tool prompts * docs(changelog): credit heartbeat prompt fix
* fix(heartbeat): align response tool prompts * docs(changelog): credit heartbeat prompt fix
Summary
heartbeat_respondprompt mode even when the runtime has not enabled theheartbeat_respondtool.notify=falseoutcomes stop being reliable.HEARTBEAT_OKack path because that path intentionally disables tools.agentRuntime.fallbackconfig key remains retired.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
heartbeat_respond/ Codex tool-reply foundation.Root Cause (if applicable)
GetReplyOptionsinto embedded PI tool construction, and without accounting for commitment-only runs that deliberately setdisableTools: true.agentRuntime.fallbackkey.Regression Test Plan (if applicable)
src/infra/heartbeat-runner.tool-response.test.ts,src/infra/heartbeat-runner.commitments.test.ts,extensions/qa-lab/src/scenario-catalog.test.tsenableHeartbeatTool/forceHeartbeatTool; tool-disabled commitment prompts do not mentionheartbeat_respond; QA/live Codex fixtures no longer write removed fallback config.User-visible / Behavior Changes
Heartbeat quiet/no-notify paths are more reliable for Codex/provider-Codex runs. Live Codex QA fixtures use the current
agentRuntime: { id: "codex" }shape.Diagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
messages.visibleReplies: "message_tool",agentRuntime.id: "codex"Steps
Expected
Actual
Evidence
Human Verification (required)
pnpm test:serial src/infra/heartbeat-runner.tool-response.test.ts src/infra/heartbeat-runner.commitments.test.ts -- --reporter=verbosepnpm test:serial extensions/qa-lab/src/scenario-catalog.test.ts -- --reporter=verboseOPENCLAW_TESTBOX=1 pnpm check:changedvia Testboxtbx_01kqp3gh7gxvw8dv8qp2z2yqr6Review Conversations
Compatibility / Migration
agentRuntime.id-only schema after Stop heartbeat tool turns from asking for HEARTBEAT_OK #76338 retiredfallback.Risks and Mitigations
disableTools: trueand useHEARTBEAT_OK; only structured heartbeat prompts enable the heartbeat response tool.