Skip to content

[discord] Discord-originated subagent tasks default to done_only, leaving channel stuck on typing indicator #87665

Closed

Description

@zacharyhofbauer

Symptom

A Discord-originated session that spawns a subagent / child task shows only the Discord typing indicator with no visible progress or state updates. The operator has no visibility into long-running work until terminal status.

Concrete repro (local, OpenClaw 2026.5.26 + @openclaw/discord 2026.5.26 + @openclaw/codex 2026.5.26):

  1. In a Discord channel routed to an OpenClaw agent, send a message that triggers the agent to spawn a subagent (e.g. ask Codex to run a child task).
  2. Discord shows the typing indicator for the agent.
  3. No progress messages appear; the channel sits silently until the parent task reaches terminal status (often minutes later).
  4. openclaw tasks list shows notifyPolicy=done_only for the parent and notifyPolicy=silent for the child CLI task.

Root cause

In the bundled chunk task-registry-CU9A1ECz.js (likely source src/tasks/task-registry.ts):

function ensureNotifyPolicy(params) {
    if (params.notifyPolicy) return params.notifyPolicy;
    return (params.deliveryStatus ?? ensureDeliveryStatus({
        ownerKey: params.ownerKey,
        scopeKind: params.scopeKind
    })) === "not_applicable" ? "silent" : "done_only";
}

When no explicit notifyPolicy is passed (typical for ACP spawns and @openclaw/discord/dist/subagent-hooks-DHA_1pBI.js's handleDiscordSubagentSpawning path), the parent task defaults to done_only. Combined with:

  • shouldAutoDeliverTaskStateChange only firing on state_changes policy (task-registry-CU9A1ECz.js:89-91)
  • shouldAutoDeliverTaskTerminalUpdate only firing at terminal status (:83-87)
  • Discord typing module being a fixed 5s start with no task-state link (@openclaw/discord/dist/typing-BhIpRSfR.js) and a 20-min wall-clock cap (message-handler.process-DO17vBlT.js:1003-1016)

…the operator sees a typing indicator with no payload for the duration of the run.

Proposed fix

ensureNotifyPolicy should default to state_changes (not done_only) when the task carries a Discord origin marker, so Discord-originated work surfaces progress and state-change events:

 function ensureNotifyPolicy(params) {
     if (params.notifyPolicy) return params.notifyPolicy;
-    return (params.deliveryStatus ?? ensureDeliveryStatus({
+    const deliveryStatus = params.deliveryStatus ?? ensureDeliveryStatus({
         ownerKey: params.ownerKey,
         scopeKind: params.scopeKind
-    })) === "not_applicable" ? "silent" : "done_only";
+    });
+    if (deliveryStatus === "not_applicable") return "silent";
+    if (params.requesterOrigin?.channel === "discord") return "state_changes";
+    return "done_only";
 }

Both ensureNotifyPolicy call sites (mergeExistingTaskForCreate and the main task-create path) need to pass requesterOrigin: params.requesterOrigin. requesterOrigin is already available in the surrounding params at both call sites; this is a pure pass-through.

Side-effect surface

  • Non-Discord callers (cron, system, ACP from other channels): unchanged — fallback still done_only or silent.
  • Tasks with an explicit notifyPolicy (codex native subagents at silent): unchanged — the early-return if (params.notifyPolicy) return params.notifyPolicy still wins.
  • Discord channels will see more messages per task (the goal).

Related / follow-up

  1. Discord typing watchdog. typing-BhIpRSfR.js is a one-shot 5s start; the 20-min wall-clock cap lives in message-handler.process-DO17vBlT.js:1003-1016. A task-state-driven watchdog that posts an explicit "still working" message after N seconds of no state event would close the residual case where a task is genuinely silent (e.g. tool with no progress emit). Worth a separate issue.
  2. Codex child task visibility. Filed separately — the @openclaw/codex native subagent mirror is silent/not_applicable. Will link companion issue after filing.
  3. CLI documentation. openclaw subagents … does not exist (No built-in command or plugin CLI metadata owns "subagents"); the real surface is openclaw tasks {cancel, flow cancel, notify}. Consider an alias or a doc clarification.

Workaround until merged

Operators can manually promote a silent / done_only task with:

openclaw tasks notify <taskId> state_changes

…which works via the existing updateTaskNotifyPolicyById runtime override (task-registry-CU9A1ECz.js:2446).

Sites that can patch the dist directly can apply the diff above plus requesterOrigin pass-through at both call sites as a local mitigation.


Environment: macOS, OpenClaw 2026.5.26, @openclaw/discord 2026.5.26, @openclaw/codex 2026.5.26, node 22.

Activity

  1. zacharyhofbauer commented on May 28, 2026

    @zacharyhofbauer
    Author

    Companion issue for codex-side native subagent visibility filed: #87666

  2. clawsweeper commented on May 28, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 24, 2026, 4:12 PM ET / 20:12 UTC.

    Summary
    Keep open: current main and v2026.6.10 still default deliverable tasks without an explicit notify policy to done_only, the Discord subagent hook passes a Discord delivery origin but no task notify policy, and the direct fix PR is closed unmerged. The remaining decision is the owner seam and message-volume policy for Discord-visible task progress.

    Reproducibility: Do we have a high-confidence way to reproduce the issue? Yes from source: Discord-originated subagent registration can pass a requester origin and pending delivery without a notify policy, current registry defaulting makes that done_only, and state-change delivery only fires for state_changes.

    Root-cause cluster
    Relationship: canonical
    Canonical: #87665
    Summary: This issue is the canonical Discord-originated task notify-default report; related open items cover Codex-native child visibility, per-tool Discord progress, broader default-policy configuration, and Discord placeholder/heartbeat UX.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Next step
    Maintainer review is needed because the source-reproducible fix changes Discord-visible notification volume and must choose the core-versus-Discord ownership seam before implementation.

    Review details

    Best possible solution:

    Choose the maintainer-approved policy seam, then make Discord-originated background task progress visible with focused coverage for Discord origin, unchanged non-Discord defaults, and explicit notify-policy preservation.

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

    Do we have a high-confidence way to reproduce the issue? Yes from source: Discord-originated subagent registration can pass a requester origin and pending delivery without a notify policy, current registry defaulting makes that done_only, and state-change delivery only fires for state_changes.

    Is this the best way to solve the issue?

    Is this the best way to solve the issue? Unclear: the reporter's core-default patch matches the observed source path, but repository policy favors owner-specific channel behavior in the channel plugin or a generic seam rather than a Discord literal in core.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • A live Discord end-to-end reproduction was not run in this read-only review; confidence comes from current source, shipped-source parity, and the issue's concrete report.
    • Changing the default would intentionally increase Discord task-progress messages, so maintainers still need to approve whether that policy belongs in the Discord plugin path, a generic channel capability, or core task defaults.

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

    Label changes

    Label changes:

    • remove clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.

    Label justifications:

    • P2: The issue affects Discord operator visibility for background work, but the blast radius is limited to task notification policy and channel delivery UX.
    • impact:message-loss: The reported failure suppresses visible nonterminal task progress messages in Discord until terminal status.
    Evidence reviewed

    What I checked:

    Likely related people:

    • vincentkoc: GitHub path history shows recent work on src/tasks/task-registry.ts and the extracted task delivery policy, including current task-registry changes and the delivery-policy extraction. (role: recent task delivery policy contributor; confidence: high; commits: 273eed4c51cb, d9a38130b1a8, 817ac551b655; files: src/tasks/task-registry.ts, src/tasks/task-executor-policy.ts)
    • steipete: GitHub path history shows repeated recent task-registry and subagent-run-manager maintenance, including requester attribution, SQLite task state, and subagent registry work adjacent to this delivery path. (role: recent adjacent task and subagent area contributor; confidence: high; commits: 1fef20c96bdc, d115fb4cf9f9, 77d9ac30bb8d; files: src/tasks/task-registry.ts, src/agents/subagent-registry-run-manager.ts)
    • onutc: The Discord thread-bound subagent hook path appears to originate in the thread-bound subagents feature, which introduced Discord subagent routing and hook delivery target behavior. (role: Discord thread-bound subagent feature contributor; confidence: medium; commits: 8178ea472db1; files: extensions/discord/src/subagent-hooks.ts)
    • Craig: GitHub path history attributes the direct Discord subagent thread delivery-origin fix to Craig, which is the origin signal consumed by the affected task path. (role: recent Discord subagent delivery contributor; confidence: medium; commits: 61d583d59d1a; files: extensions/discord/src/subagent-hooks.ts)
    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. added
    P2Normal backlog priority with limited blast radius.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    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:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on May 28, 2026
  4. zacharyhofbauer commented on May 28, 2026

    @zacharyhofbauer
    Author

    Companion issue for Discord per-tool message visibility filed: #87704

  5. added
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    and removed
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 19, 2026
  6. Jackten commented on Jul 29, 2026

    @Jackten
    Contributor

    I filed the separate residual-watchdog issue suggested in this report:
    #115914.

    It adds a WhatsApp production timeline, current-main source evidence, and a
    channel-generic one-shot acceptance invariant: after a bounded interval with no
    confirmed visible delivery, send one policy-aware status receipt; cancel it on
    visible progress/final/abort; and serialize a final behind any in-flight routed
    receipt. This complements the Discord notifyPolicy fix here rather than changing
    its scope.

  7. vincentkoc commented on Jul 29, 2026

    @vincentkoc
    Member

    Fixed on current main.

    Discord now defaults unset preview streaming to progress mode and has regression coverage for draft/final cleanup. Residual Discord progress or typing-state failures should be reported against the current implementation; the active related tracker is #115914.

  8. locked as resolved and limited conversation to collaborators on Oct 13, 2026
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

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.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