Skip to content

NO_REPLY silence reply counted as empty turn - retry + candidate_failed(format) + full fallback cascade on heartbeats (2026.6.5) #92038

Closed

Description

@vultusv

Bug type: Behavior
Beta blocker: No

Summary

When an assistant turn consists only of the silence token NO_REPLY (with or without reasoning), the embedded agent runner strips the payload as "silent" before the turn-completion check, so the run sees payloads=0, logs empty response detected, retries with visible-answer continuation, then surfaces an incomplete-turn error and marks the model candidate failed with reason=format — cascading through every fallback model (which each also reply NO_REPLY) until a codex-harness model answers via the heartbeat_respond tool.

Environment

Steps to reproduce

  1. Configure a text-reply (non-codex-harness) model — any zai GLM model reproduces reliably — as the active model for heartbeats (or any embedded run where the model may legitimately choose silence).
  2. Configure several fallback models of the same family.
  3. Trigger a heartbeat with nothing actionable (openclaw system event --mode now --session-key agent:<id>:main, or just wait for the cadence).
  4. The model replies NO_REPLY (the system prompt advertises it as the correct way to stay silent, and an idle heartbeat poll is exactly that case).

Expected behavior

A NO_REPLY-only assistant turn is a successful silent turn: suppress delivery, complete the run, no retry, no candidate failure, no model fallback.

Actual behavior

Every fallback candidate is tried and "fails" in sequence (~2 minutes per heartbeat, ~10 LLM calls), ending on the codex-harness primary. The surviving model is then persisted as a session modelOverride (modelOverrideSource: "auto"), so subsequent heartbeats permanently run on the expensive primary instead of the configured cheap heartbeat model.

15:26:45 [agent/embedded] empty response detected: runId=b7fc606b… provider=zai/glm-5.1 — retrying 1/1 with visible-answer continuation
15:26:50 [agent/embedded] empty response retries exhausted: … provider=zai/glm-5.1 attempts=1/1 — surfacing incomplete-turn error
15:26:50 [agent/embedded] incomplete turn detected: … stopReason=stop hasLastAssistant=yes hasCurrentAttemptAssistant=yes payloads=0 tools=0 replaySafe=yes … emptyRetries=1/1 … — surfacing error to user
15:26:50 [model-fallback/decision] decision=candidate_failed requested=zai/glm-5.1 candidate=zai/glm-5.1 reason=format next=zai/glm-5 detail=zai/glm-5.1 ended with an incomplete terminal response
   …identical sequence repeats for glm-5, glm-5-turbo, glm-4.6, glm-4.5-air…
15:28:03 [model-fallback/decision] decision=candidate_succeeded requested=zai/glm-5.1 candidate=openai/gpt-5.5 reason=unknown next=none

The session transcript proves the models were never empty — every "failed" turn is a well-formed NO_REPLY reply, exactly as instructed:

ASSISTANT model=glm-5.1     stop=stop content=[thinking:"Heartbeat poll - nothing to do." | text:"NO_REPLY"]
ASSISTANT model=glm-5       stop=stop content=[text:"NO_REPLY"]
ASSISTANT model=glm-5-turbo stop=stop content=[text:"NO_REPLY"]
ASSISTANT model=glm-4.6     stop=stop content=[thinking:"The user is sending heartbeat poll messages…" | text:"NO_REPLY"]

Root cause (from the 2026.6.5 published bundle)

In buildEmbeddedRunPayloads (src/agents/embedded-agent-runner/run/payloads.ts), a NO_REPLY-only payload is removed by the final filter:

if (payload.text && isSilentReplyPayloadText(payload.text, "NO_REPLY")) {
    const silentText = payload.text;
    payload.text = void 0;
    if (hasReplyPayloadContent(payload)) return payload; // keep if media etc. remain
    payload.text = silentText;                           // restore: text-only silent reply
}
return payload;
}).filter((p) => {
    if (!hasReplyPayloadContent(p)) return false;
    if (p.text && isSilentReplyPayloadText(p.text, "NO_REPLY")) return false; // ← dropped here
    return true;
});

The caller (src/agents/embedded-agent-runner/run.ts) then computes payloadCount = payloadsForTerminalPath?.length ?? 0 → 0, and the empty-response retry path fires:

if (!nextPlanningOnlyRetryInstruction && !nextReasoningOnlyRetryInstruction
    && nextEmptyResponseRetryInstruction
    && emptyResponseRetryAttempts < maxEmptyResponseRetryAttempts) {
  emptyResponseRetryAttempts += 1;
  log.warn(`empty response detected: … retrying … with visible-answer continuation`);
  continue;
}

After exhaustion the incomplete-turn error surfaces and the model-fallback layer classifies the candidate as reason=format ("ended with an incomplete terminal response"). There is an emptyAssistantReplyIsSilent flag consulted when building the incomplete-turn payload text, but the retry trigger and the candidate-failure classification fire regardless, so silence is still treated as failure.

Codex-harness models escape because the heartbeat response arrives via the heartbeat_respond tool — createHeartbeatToolResponsePayload (src/auto-reply/heartbeat-tool-response.ts) stores the token in channelData, which the silent-text filter never touches.

Suggested fix

Detect "the only payload was a silence token" before (or inside) the empty-response check — e.g. have buildEmbeddedRunPayloads return a wasSilentReply signal, or set emptyAssistantReplyIsSilent earlier — and treat that as a completed silent turn: no empty response detected retry, no incomplete-turn error, no candidate_failed, no sticky auto modelOverride.

Workaround (for anyone else hitting this)

Override the heartbeat prompt to forbid the silence token:

agents: { defaults: { heartbeat: {
  prompt: "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply with exactly HEARTBEAT_OK. Never reply NO_REPLY to a heartbeat poll."
} } }

HEARTBEAT_OK passes the payload filter and is still suppressed from delivery by the heartbeat visibility filter. (A first-attempt NO_REPLY retry can still occur with small models, but the in-run visible-answer retry now recovers on the same model instead of cascading.)

Related (all closed; none covers this mechanism)

Activity

  1. clawsweeper commented on Jun 10, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 11, 2026, 6:25 AM ET / 10:25 UTC.

    Summary
    Codex review failed: timeout (exit 0).

    Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Include the exact command, prompt, or workflow that triggered it.
    • Add expected vs actual behavior.

    Next step
    Review did not complete, so no work-lane recommendation was made.

    Review details

    Best possible solution:

    Retry the Codex review after fixing the execution failure.

    Do we have a high-confidence way to reproduce the issue?

    Unclear. The review failed before ClawSweeper could establish a reproduction path.

    Is this the best way to solve the issue?

    Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

    AGENTS.md: unclear because the file could not be read completely.

    Remaining risk / open question:

    • No close action taken because the review did not complete.

    Codex review notes: model internal, reasoning high; reviewed against c692fabeba07.

    Label changes

    Label changes:

    • add issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.
    • add clawsweeper:needs-info: Current issue advisory state selects this label.
    • remove P1: Current review triage priority is none.
    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.
    • remove clawsweeper:queueable-fix: Current issue advisory state no longer selects this label.
    • remove clawsweeper:source-repro: Current issue advisory state no longer selects this label.
    • remove impact:auth-provider: Current review selected no impact labels.
    • remove issue-rating: 🦞 diamond lobster: Current issue advisory state no longer selects this label.
    Evidence reviewed

    What I checked:

    • failure reason: timeout.
    • codex failure detail: Codex review failed for this issue: spawnSync codex ETIMEDOUT.
    • codex stderr: sAssistantVisibleText || incompleteTerminalAssistant)
    • codex stdout: No stdout captured.

    Likely related people:

    • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 10, 2026
  3. self-assigned this
    on Jun 10, 2026
  4. locked as resolved and limited conversation to collaborators on Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions