Skip to content

Fix CLI and plugin edge-case bugs - #85893

Merged
steipete merged 22 commits into
mainfrom
bugfix/clawpatch-sweep-cli-runtime
May 24, 2026
Merged

steipete merged 22 commits into
mainfrom
bugfix/clawpatch-sweep-cli-runtime

Conversation

@steipete

@steipete steipete commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fixes a sweep of CLI parsing, generated completion, option-state, plugin command metadata, command-runner, progress, history import, media-write, ACP auto-approval, browser, secrets, node TLS, Twitch, IRC, and Signal edge cases found during the clawpatch bug sweep.
  • Adds focused regression coverage for the touched CLI, gateway, ACP, browser, node, secrets, IRC, Twitch, and Signal paths.
  • Updates the changelog for the user-visible CLI and plugin fixes, and fixes the repo-local autoreview helper to ignore/drop out-of-scope reviewer findings instead of failing the wrapper.
  • Addresses PR review comments for pending Twitch handler cleanup and command-scoped fish completion value-option parsing.

Verification

Behavior addressed: CLI/plugin runtime edge cases now reject malformed inputs, preserve explicit command/config state, bound waits and file writes, cancel or fail stalled plugin operations, avoid stale TLS pins, redact remote browser URLs, and keep Twitch/Signal setup paths from regressing. Autoreview now keeps valid in-scope findings but ignores valid findings that point outside the reviewed diff. Pending Twitch disconnects now clear stale handlers and manual disconnects during auth retry cancel immediately. Fish completion command-path parsing now only skips values for options active in the current command path.

Real environment tested: local macOS checkout rebased on origin/main at 6e03d1ca5b.

Exact steps or command run after this patch: node scripts/run-vitest.mjs src/cli/parse-timeout.test.ts src/cli/update-cli/shared.command-runner.test.ts src/cli/progress.test.ts src/cli/completion-cli.test.ts src/cli/profile.test.ts src/cli/plugins-authoring-command.test.ts src/gateway/cli-session-history.test.ts extensions/twitch/src/twitch-client.test.ts extensions/irc/src/send.test.ts src/cli/nodes-camera.test.ts src/cli/cron-cli/register.cron-edit.test.ts src/cli/cron-cli.test.ts src/cli/update-cli.option-collisions.test.ts src/acp/client.test.ts extensions/signal/src/client-adapter.test.ts extensions/browser/src/cli/browser-cli-manage.test.ts src/cli/secrets-cli.test.ts src/cli/node-cli/register.test.ts && pnpm tsgo && pnpm lint --threads=8 && git diff --check; .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main; gh pr checks 85893 --watch=false.

Evidence after fix: 20 test files passed, 383 tests passed; pnpm tsgo passed; pnpm lint --threads=8 passed; git diff --check passed; autoreview passed with no accepted/actionable findings; GitHub PR checks passed.

Observed result after fix: focused regression suite, type check, lint, diff check, autoreview, and GitHub Actions completed successfully after addressing the PR comments.

What was not tested: no live Twitch service or interactive fish shell session was run; the fixed behavior is covered by focused unit/regression tests and generated-script assertions.

@openclaw-barnacle openclaw-barnacle Bot added channel: signal Channel integration: signal gateway Gateway runtime cli CLI command changes channel: twitch Channel integration: twitch channel: irc extensions: codex channel: synology-chat size: XL maintainer Maintainer-authored PR labels May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Latest ClawSweeper review: 2026-05-24 02:18 UTC / May 23, 2026, 10:18 PM ET.

Workflow note: Future ClawSweeper reviews update this same comment in place.

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.

PR Surface
Source +363, Tests +425, Docs +1, Other +18. Total +807 across 48 files.

View PR surface stats
Area Files Added Removed Net
Source 30 513 150 +363
Tests 16 434 9 +425
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 19 1 +18
Total 48 967 160 +807

Summary
The PR changes CLI parsing/completions/options, gateway history/client handling, ACP permissions, browser/secrets/node media/TLS paths, several plugin runtime clients, tests, changelog text, and the repo-local autoreview helper.

Reproducibility: yes. for the current review findings by source inspection: the pending Twitch branch omits handler cleanup, and the fish helper uses a global value-option list despite real boolean/value flag collisions. I did not run tests or live commands because this review kept the checkout read-only.

PR rating
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Summary: Useful broad bug-fix signal, but mock-only proof and two P2 source regressions keep it below merge-ready quality.

Rank-up moves:

  • Fix the pending Twitch disconnect handler cleanup regression.
  • Scope fish value-option detection to the active command context and cover a boolean/value flag collision.
  • Add redacted real behavior proof for representative CLI and plugin runtime flows.
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.

Real behavior proof
Needs real behavior proof before merge: The PR body reports focused tests, typecheck, lint, diff-check, and autoreview/helper smoke only; contributor should add redacted terminal/live output, logs, screenshots, recordings, or artifacts for representative fixed CLI/plugin flows and update the PR body to trigger re-review.

Risk before merge

  • The PR still needs contributor-supplied real behavior proof; the body only reports focused tests, typecheck, lint, diff-check, and autoreview/helper smoke.
  • The pending Twitch disconnect path can leave a stale message handler registered and route later messages to an outdated callback.
  • The generated fish helper can suppress nested completions when option names have different value/boolean semantics across commands.
  • The branch changes strict CLI parsing, command defaults, permission selection, runtime waits, and auth/setup behavior together, so maintainers need to own the compatibility and delivery blast radius before merge.

Maintainer options:

  1. Fix blockers and prove representative flows (recommended)
    Address the Twitch pending-handler cleanup and fish command-context bug, then add redacted terminal/log/media proof for representative CLI and plugin runtime paths before maintainer merge review.
  2. Accept the combined sweep as maintainer-owned
    Maintainers may choose to land the broad sweep after review while explicitly accepting simultaneous CLI compatibility and channel/runtime behavior changes.
  3. Split runtime-sensitive plugin work
    If the combined blast radius is too large to prove confidently, split Twitch/Signal/Synology/IRC runtime changes from lower-risk CLI parsing and output fixes.

Next step before merge
Protected-label PR with missing contributor real behavior proof and two P2 source findings; the next step is contributor fixes/proof followed by maintainer review, not an automated repair lane.

Security
Cleared: The diff touches security-sensitive URL redaction, media write bounds, secrets output, TLS, and permission paths, but this pass found no concrete new security or supply-chain concern.

Review findings

  • [P2] Clear pending Twitch handlers on disconnect — extensions/twitch/src/twitch-client.ts:324-328
  • [P2] Scope fish value-option skipping to the active command — src/cli/completion-cli.ts:74-79
Review details

Best possible solution:

Fix the Twitch pending cleanup and command-scoped fish completion bugs, add redacted real CLI/plugin runtime proof, then have maintainers explicitly accept or split the broad compatibility and delivery-sensitive sweep.

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

Yes for the current review findings by source inspection: the pending Twitch branch omits handler cleanup, and the fish helper uses a global value-option list despite real boolean/value flag collisions. I did not run tests or live commands because this review kept the checkout read-only.

Is this the best way to solve the issue?

No, not yet: the broad sweep contains useful repairs, but the current branch needs the two source blockers fixed and representative real behavior proof before it is the best merge path.

Label justifications:

  • P2: This is a normal-priority multi-surface bug-fix PR with concrete blockers but no emergency production outage signal.
  • merge-risk: 🚨 compatibility: The diff changes CLI parsing/default behavior, TLS inheritance, permission selection, secrets JSON output, and plugin setup semantics in ways existing users could notice during upgrade.
  • merge-risk: 🚨 message-delivery: The Twitch pending-client regression can retain stale handlers and misroute later chat messages to an outdated callback.
  • rating: 🦪 silver shellfish: Current PR rating is 🦪 silver shellfish because proof is 🦪 silver shellfish, patch quality is 🦐 gold shrimp, and Useful broad bug-fix signal, but mock-only proof and two P2 source regressions keep it below merge-ready quality.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports focused tests, typecheck, lint, diff-check, and autoreview/helper smoke only; contributor should add redacted terminal/live output, logs, screenshots, recordings, or artifacts for representative fixed CLI/plugin flows and update the PR body to trigger re-review.

Full review comments:

  • [P2] Clear pending Twitch handlers on disconnect — extensions/twitch/src/twitch-client.ts:324-328
    When disconnect() cancels a client that is still in pendingClients, it quits the client and clears pending connection state but leaves messageHandlers and messageHandlerTokens intact. That differs from the connected-client cleanup below and can let a later reconnect deliver messages to a stale callback.
    Confidence: 0.9
  • [P2] Scope fish value-option skipping to the active command — src/cli/completion-cli.ts:74-79
    value_options is collected from the whole command tree, so a flag that takes a value in one command makes the helper skip the next token for every command. Since --verbose is boolean under sessions but value-taking under agent, paths like sessions --verbose cleanup can lose the cleanup token and miss nested completions.
    Confidence: 0.86

Overall correctness: patch is incorrect
Overall confidence: 0.83

What I checked:

  • Protected live context: The provided GitHub context shows this PR is open, labeled maintainer, P2, merge-risk compatibility, merge-risk message-delivery, and status needs proof, with head 32ccbcf. (32ccbcf7d34e)
  • Twitch pending disconnect cleanup gap: The PR head adds pendingClients, but disconnect() only quits/deletes the pending client and connection promise; it does not clear messageHandlers or messageHandlerTokens in that pending branch. (extensions/twitch/src/twitch-client.ts:324, 32ccbcf7d34e)
  • Current connected disconnect contract: Current main disconnect() clears clients, messageHandlers, and messageHandlerTokens for a connected Twitch client, so the new pending-client path should preserve that cleanup behavior. (extensions/twitch/src/twitch-client.ts:231, d5814150267f)
  • Fish completion global value-option list: The PR head builds value_options from collectFishOptionFlags(program, true), so a value-taking option name anywhere in the command tree is treated as value-taking while matching every command path. (src/cli/completion-cli.ts:74, 32ccbcf7d34e)
  • Boolean verbose command context: The sessions command defines --verbose as a boolean option, making it a concrete collision with value-taking options of the same long flag elsewhere. (src/cli/program/register.status-health-sessions.ts:27, 32ccbcf7d34e)
  • Value-taking verbose command context: The agent command defines --verbose <on|off>, showing the same --verbose flag can have value semantics in a different command context. (src/cli/program/register.agent.ts:79, 32ccbcf7d34e)

Likely related people:

  • Jason O'Neal: Current-main blame attributes the central Twitch manager and completion generator code sampled for this review to this author; history is shallow/grafted, so this is a routing hint rather than a full ownership map. (role: current area code author; confidence: medium; commits: d8a2cd520405; files: extensions/twitch/src/twitch-client.ts, src/cli/completion-cli.ts)
  • steipete: Current-main blame shows Peter Steinberger as committer for the sampled central files, and the PR branch itself is authored by steipete; included here because of current-main provenance, not merely because of PR authorship. (role: current-main committer and adjacent owner; confidence: medium; commits: d8a2cd520405; files: extensions/twitch/src/twitch-client.ts, src/cli/completion-cli.ts)
  • alkor2000: A current-main Twitch auth-provider fix immediately adjacent to this PR's Twitch setup work was authored by alkor2000. (role: recent Twitch adjacent contributor; confidence: medium; commits: 72744fd5fdbc; files: extensions/twitch/src/twitch-client.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against d5814150267f.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9921afd8c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread extensions/twitch/src/twitch-client.ts Resolved
@clawsweeper clawsweeper Bot added the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label May 24, 2026
@clawsweeper clawsweeper Bot added the status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. label May 24, 2026
@clawsweeper

clawsweeper Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@steipete
steipete force-pushed the bugfix/clawpatch-sweep-cli-runtime branch from 9921afd to f60bac4 Compare May 24, 2026 01:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f60bac4405

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/completion-cli.ts Resolved
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels May 24, 2026
@steipete steipete self-assigned this May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: irc channel: signal Channel integration: signal channel: synology-chat channel: twitch Channel integration: twitch cli CLI command changes extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant