Skip to content

Browser exec continuations repeat final replies after private child work #166344

Closed

Description

@shakkernerd

What happens

A browser conversation can receive repeated final answers when a background command finishes, the continuation delegates a private native child, and the parent calls sessions_yield. The first final is visible in the conversation, but completion settlement rejects it and starts another synthesis turn without another user message.

This was reproduced against main at dd61952 using an isolated real Gateway and Control UI on Linux, with a loopback Responses provider supplying deterministic model decisions. Exec completion, child spawning, yield, transcript publication, and delivery settlement all use the normal runtime. No external model or channel API is involved.

Reproduction

  1. Start a background command from a browser conversation without an external delivery route.
  2. Let the initial turn finish while the command remains running.
  3. Complete the command normally so its completion resumes that conversation.
  4. Have the continuation start one native child with completionTarget: "parent", then call sessions_yield.
  5. Complete the child and let the parent produce a visible final answer.

The browser showed two identical final answers, including after reload. The fixture recorded one child execution and two requester-settle synthesis requests. After the first answer, the child still had a pending delivery obligation with lastError: "completion agent did not produce a visible reply".

Cause and expected behavior

The heartbeat execution context assigns its synthetic sender to To. The normal tool-context path then stores {to: "heartbeat"} as the child's requester origin, without a channel. A debugger observation at the actual classification boundary confirmed a successful, non-silent terminal response with visible text, no delivery error, and those malformed origins. The classifier rejected it as visible_reply_missing because an unresolved destination requires delivery evidence.

The continuation should retain the browser conversation's absent external destination and accept its visible final once. Real unresolved external destinations must continue to require delivery evidence; treating every destination without a channel as delivered would conceal other failures.

Activity

  1. added
    P1
    clawsweeper:fix-shape-clear
    clawsweeper:queueable-fix
    clawsweeper:source-repro
    impact:message-loss
    issue-rating: 🦞 diamond lobster
    no-stale
    on Oct 6, 2026
  2. clawsweeper commented on Oct 6, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work. Reviewed October 6, 2026, 7:20 PM ET / 23:20 UTC.

    Summary
    Current main still supports the reported failure mechanism. This is a bounded runtime bug with concrete reproduction details, and no specifically linked fix PR was found; the MEMBER-authored issue must remain open.

    Reproducibility: yes. the issue supplies a precise real-Gateway scenario, and unchanged current source supports its synthetic-destination rejection and retry mechanism. This read-only review did not execute the reproduction.

    Next step
    The source-supported defect has a narrow producer repair and no specifically linked implementation PR; obviyus and Marvinthebored are the likely related routing candidates.

    Review details

    Best possible solution:

    Preserve the browser continuation’s absent external destination at the context producer, while retaining delivery-evidence requirements for unresolved external routes.

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

    Yes: the issue supplies a precise real-Gateway scenario, and unchanged current source supports its synthetic-destination rejection and retry mechanism. This read-only review did not execute the reproduction.

    Is this the best way to solve the issue?

    Yes: repairing destination propagation at its producer is the narrowest approach; accepting every channel-less destination in settlement would conceal genuine external delivery failures.

    AGENTS.md: found and applied where relevant.

    Codex review notes: model internal, reasoning medium; reviewed against 2c620bbfe84c.

    Label changes

    Label changes:

    • add P1: A concretely reported browser agent workflow repeats completed answers without another user message.
    • add impact:message-loss: The reported failure duplicates visible conversation messages through settlement retries.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P1: A concretely reported browser agent workflow repeats completed answers without another user message.
    • impact:message-loss: The reported failure duplicates visible conversation messages through settlement retries.
    Evidence reviewed

    Acceptance criteria:

    • pnpm test src/infra/heartbeat-runner.webchat-exec-completion.test.ts src/infra/heartbeat-runner.webchat-exec-explicit-target.test.ts --maxWorkers=1
    • pnpm test src/agents/subagents/announce/subagent-announce-delivery.yielded-settle.test.ts --maxWorkers=1
    • Replay the reported isolated Gateway and Control UI scenario; verify one child execution, one parent synthesis, one persisted final, and completed delivery settlement.
    • git diff --check

    What I checked:

    • Verified review revision: The clean checkout is main at the supplied fetched revision. The origin remote identifies openclaw/openclaw. (2c620bbfe84c)
    • Synthetic destination producer: The heartbeat runner assigns sender to both From and To. Sender selection falls back to heartbeat when no real destination or allowlist candidate exists, while OriginatingTo remains absent for the reported browser route. (src/infra/heartbeat-runner-run.ts:80, 2c620bbfe84c)
    • Destination reaches child origin: Embedded tool context uses OriginatingTo ?? To as messageTo; agent-tools maps messageTo to agentTo, and the native child planner normalizes agentTo into requesterOrigin.to without requiring a channel. (src/auto-reply/reply/agent-runner-utils.ts:290, 2c620bbfe84c)
    • Settlement rejection and retry: The classifier accepts transcript-visible output for a channel-less origin only when its destination is absent. A channel-less heartbeat destination therefore fails this condition. Requester-settle wake retries ordinary undelivered outcomes, matching repeated parent synthesis. (src/agents/subagents/announce/subagent-announce-direct-response.ts:291, 2c620bbfe84c)
    • Existing completion contract: Private parent completion resumes a yielded parent under the conversation’s normal reply rules. Existing yielded-settle coverage deliberately rejects unsent external text; repairing the synthetic origin must preserve that behavior. Public docs: docs/tools/subagents/tool-reference.md. (docs/tools/subagents/tool-reference.md:230, 2c620bbfe84c)
    • Reported real runtime reproduction: The captured issue body describes an isolated Linux Gateway and Control UI using deterministic loopback Responses inference: one child execution, two settlement synthesis requests, duplicate finals persisting after reload, and the malformed origin observed at classification. This review did not execute that setup. (dd619529b24a)

    Likely related people:

    • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • Marvinthebored: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.
  3. clawsweeper commented on Oct 6, 2026

    @clawsweeper
    Contributor

    🦞⚠️
    Automatic implementation stopped before completion.
    Reason: The automatic implementation worker stopped before all deterministic gates completed. Open the workflow run for the exact blocker.
    Worker: https://github.com/openclaw/clawsweeper/actions/runs/37546148122

  4. added a commit that references this issue on Oct 7, 2026
    513871f
  5. added a commit that references this issue on Oct 7, 2026
    0f8156d
  6. added a commit that references this issue on Oct 11, 2026
    c3da32e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1clawsweeper:fix-shape-clearclawsweeper:queueable-fixclawsweeper:source-reproimpact:message-lossissue-rating: 🦞 diamond lobsterno-stale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions