Skip to content

fix(discord): hide internal Code Mode wait progress - #99893

Merged
steipete merged 1 commit into
mainfrom
fix/hide-code-mode-wait-progress
Jul 4, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/hide-code-mode-wait-progress

Conversation

@steipete

@steipete steipete commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Code Mode exposes an internal wait control so the model can resume suspended JavaScript runs. Channel progress treated that control like ordinary work, producing repeated Wait cards between real tool operations.

Why This Change Was Made

Add invocation-specific channel-progress metadata to agent tool lifecycle events. The Code Mode wait control opts out of transient channel progress, while telemetry and lifecycle accounting remain intact. Synthetic catalog calls propagate metadata from their concrete tool instance, so an unrelated catalog or plugin tool also named wait stays visible.

User Impact

Discord and other channel progress UIs no longer show internal Code Mode Wait rows. Real operations such as exec and catalog tools continue to appear normally.

Evidence

  • Focused Vitest: 5 files, 474 tests passed across unit, agent, and auto-reply shards.
  • pnpm check:changed passed remotely for core and core-test lanes, including typechecks, all core lint shards, import-cycle checks, and runtime guards.
  • Autoreview: clean; no accepted/actionable findings.
  • Regression coverage verifies primary and queued follow-up channel paths, full start/update/end propagation, successful final payload delivery, and the same-name catalog-tool collision case.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Jul 4, 2026
@clawsweeper

clawsweeper Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 4, 2026, 4:41 AM ET / 08:41 UTC.

Summary
The PR adds optional lifecycle metadata to hide Code Mode's internal wait tool from channel progress while preserving telemetry, then propagates that flag through agent loop, embedded-run, auto-reply, follow-up, and regression-test paths.

PR surface: Source +72, Tests +258. Total +330 across 14 files.

Reproducibility: yes. at source level: current main creates Code Mode wait as an ordinary tool and the auto-reply path forwards ordinary tool/item lifecycle events into channel progress. I did not run a live Discord reproduction in this read-only review.

Review metrics: 1 noteworthy metric.

  • Lifecycle metadata surface: 1 optional tool flag propagated to tool/item events. The new optional event metadata is the contract channel progress uses to suppress internal work without hiding unrelated tools.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🌊 off-meta tidepool
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Mantis proof suggestion
A real Discord progress run would materially show the user-visible absence of internal Wait rows while normal tool progress still appears. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify a Discord Code Mode run no longer shows internal Wait progress rows while exec progress still appears.

Risk before merge

  • [P1] The user-visible Discord symptom was not independently live-verified in this review; the source path and regression tests support the behavior, and optional Mantis visual proof would close that gap.

Maintainer options:

  1. Decide the mitigation before merge
    Keep the instance-scoped lifecycle flag approach, merge only after exact-head checks and maintainer review, and prefer optional live Discord proof for visual confidence.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] No repair job is needed because no concrete patch defect was found; the remaining action is ordinary maintainer review, exact-head checks, and optional live visual proof.

Security
Cleared: The diff only adds optional in-process lifecycle metadata and tests; it does not touch workflows, dependencies, secrets, package scripts, or external code execution surfaces.

Review details

Best possible solution:

Keep the instance-scoped lifecycle flag approach, merge only after exact-head checks and maintainer review, and prefer optional live Discord proof for visual confidence.

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

Yes, at source level: current main creates Code Mode wait as an ordinary tool and the auto-reply path forwards ordinary tool/item lifecycle events into channel progress. I did not run a live Discord reproduction in this read-only review.

Is this the best way to solve the issue?

Yes; the proposed fix is better than a Discord-only or name-based filter because it marks the concrete hidden tool instance and preserves telemetry plus unrelated catalog tools named wait.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P2: This fixes a user-facing channel progress bug with limited blast radius and focused regression coverage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-labeled PR, so the external-contributor real-behavior-proof gate does not apply; the PR body provides test/check evidence but no live Discord artifact was inspected.

Label justifications:

  • P2: This fixes a user-facing channel progress bug with limited blast radius and focused regression coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-labeled PR, so the external-contributor real-behavior-proof gate does not apply; the PR body provides test/check evidence but no live Discord artifact was inspected.
Evidence reviewed

PR surface:

Source +72, Tests +258. Total +330 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 9 77 5 +72
Tests 5 258 0 +258
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 335 5 +330

What I checked:

  • Repository policy read and applied: Root and scoped agent policies were read; the protected maintainer label and whole-surface review guidance shaped the keep-open/no-close result. (AGENTS.md:18, 9a0c9f83952d)
  • Current main exposes Code Mode wait as ordinary tool progress: On current main, createCodeModeTools creates the internal wait control as a normal tool with label wait and no metadata for suppressing channel progress. (src/agents/code-mode.ts:1172, 9a0c9f83952d)
  • Current main forwards all tool/item progress: The current auto-reply path forwards every tool event to onToolStart and every unsuppressed item event to onItemEvent, so a Code Mode wait lifecycle is visible to channel progress. (src/auto-reply/reply/agent-runner-execution.ts:2700, 9a0c9f83952d)
  • PR adds instance-scoped suppression metadata: The PR adds optional hideFromChannelProgress metadata to AgentTool and tool lifecycle events, avoiding a name-only wait filter. (packages/agent-core/src/types.ts:462, 7ddc5ac7e046)
  • PR propagates the flag through runtime and channel-progress gates: The diff marks only the Code Mode wait tool, emits the flag on start/update/end lifecycle events, carries it through embedded tool execution, and suppresses flagged tool/item progress in primary and queued channel paths. (packages/agent-core/src/agent-loop.ts:605, 7ddc5ac7e046)
  • Regression coverage targets the important invariants: The PR adds tests for hidden concrete tool lifecycle events, preserving an unrelated catalog tool also named wait, primary auto-reply progress suppression, and queued follow-up progress suppression. (src/auto-reply/reply/agent-runner-execution.test.ts:4566, 7ddc5ac7e046)

Likely related people:

  • steipete: Shortlog and targeted history show the strongest recent authorship signal across Code Mode, agent loop, and auto-reply execution paths, including structured item/lifecycle work. (role: recent area contributor; confidence: high; commits: d0581ca66fd2, 996dccb19ca1, af81ee9fee8b; files: src/agents/code-mode.ts, src/auto-reply/reply/agent-runner-execution.ts, packages/agent-core/src/agent-loop.ts)
  • vincentkoc: Recent history shows release/current-baseline and reply/agent runtime touches near these paths, useful for upgrade and CI context. (role: adjacent recent contributor; confidence: medium; commits: e085fa1a3ffd, 8a9ead62113b, af694def5b8e; files: src/auto-reply/reply/agent-runner-execution.ts, packages/agent-core/src/agent-loop.ts)
  • victorGPT: Prior merged Discord status/progress work touched the auto-reply execution surface that channel progress consumes. (role: adjacent Discord progress contributor; confidence: low; commits: 7c240a2b5858; files: src/auto-reply/reply/agent-runner-execution.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

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.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 4, 2026
@steipete
steipete merged commit 3d40447 into main Jul 4, 2026
141 of 149 checks passed
@steipete
steipete deleted the fix/hide-code-mode-wait-progress branch July 4, 2026 08:45
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 5, 2026
Hide invocation-specific Code Mode wait controls from channel progress while preserving telemetry and visible non-internal tools.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant