Merge branch 'main' of github.com:openclaw/openclaw#46858
Conversation
Greptile SummaryThis PR adds template variable interpolation (e.g. Key changes:
One thing worth noting: the Confidence Score: 4/5
Last reviewed commit: c28f542 |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded. Current main still has the heartbeat responsePrefix interpolation gap, but the same remaining work is now tracked by the newer focused replacement PR #73996, which explicitly lists this PR as a superseded source, carries the same fix boundary, adds stronger regression coverage, and preserves @JunJD credit. So I’m closing this here and keeping the remaining discussion on the canonical linked item. Review detailsBest possible solution: Use #73996 as the canonical implementation path, review or land that replacement after CI, and keep both the original reporter and this overlapping source PR credited in the final changelog/body. Security review: Security review cleared: The PR only changes heartbeat TypeScript code and a focused Vitest regression test; it does not touch CI, dependencies, scripts, package metadata, permissions, secrets, or other supply-chain surfaces. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 70ddeef0e8cd. |
Summary
messages.responsePrefixas a raw string, so template variableslike
{model}were delivered literally instead of being interpolated.{model},{provider}, and{thinkingLevel}from the actual selected model, but heartbeat alerts did not, which made channeloutput inconsistent and broke model-aware prefixes.
actual provider/model/think level, and resolved the heartbeat response prefix template before
building outbound heartbeat text.
itself are unchanged.
Change Type
Scope
Linked Issue/PR
User-visible / Behavior Changes
messages.responsePrefixtemplate variables the same waynormal replies do.
responsePrefix: "[{model}]"now sends[gemini-2.5-flash] Check completeinstead of[{model}] Check complete.HEARTBEAT_OKdetection still strips the resolved prefix before ack suppression logic runs.Security Impact
Repro + Verification
Environment
messages.responsePrefix: "[{model}]"Steps
messages.responsePrefixto a template such as"[{model}]".HEARTBEAT_OK.Expected
Actual
[gemini-2.5-flash] Check complete.Evidence
Focused verification run:
pnpm test -- src/infra/heartbeat-runner.respects-ackmaxchars-heartbeat-acks.test.ts -t "interpolates responsePrefix template variables for heartbeat alert replies|strips responsePrefix before HEARTBEAT_OK detection and suppresses short ack text"pnpm test -- src/infra/heartbeat-runner.model-override.test.ts -t "passes heartbeatModelOverride from defaults heartbeat config|uses isolated session key when isolatedSession is enabled"Human Verification
{model}inresponsePrefix; acksuppression still works with prefixed
HEARTBEAT_OKreplies.still works.
branch.
Compatibility / Migration
Failure Recovery
variables again, or ack-only heartbeat replies no longer being suppressed correctly.
Risks and Mitigations
refactors.
change on the existing
onModelSelectedpath.