Skip to content

fix: keep manually stopped idle channel accounts stopped - #128237

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-channel-idle-manual-stop-20260823
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-channel-idle-manual-stop-20260823

Conversation

@steipete

@steipete steipete commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where explicitly stopping an already-idle channel account could appear successful without recording the operator's stop intent. The channel health monitor could then restart that account on its next recovery pass.

Why This Change Was Made

The channel manager now preserves its channel-wide no-enumeration fast path but lets exact-account stops reach the existing manual-intent owner even when no provider task or stop hook is active. Explicit account targeting no longer enumerates unrelated configured accounts, and nonmanual reload/health stops retain their existing behavior.

User Impact

Operators can reliably keep a previously failed or idle channel account stopped. A later health check will honor the explicit stop instead of unexpectedly restarting the account.

Evidence

  • The focused regression failed before the production change in both Gateway test projects because the explicit idle account remained isManuallyStopped(...) === false.
  • node scripts/run-vitest.mjs src/gateway/server-channels.test.ts src/gateway/channel-health-monitor.test.ts — 312/312 tests passed on the rebased head.
  • node scripts/check-changed.mjs -- src/gateway/server-channels.ts src/gateway/server-channels.test.ts — full changed-file gate passed, including formatting, lint, core/test typechecks, import cycles, and repository guards.
  • Fresh final branch autoreview: no actionable findings; patch correct with 0.99 confidence.
  • Exact-head CI run 32645440460 completed successfully with no pending or failed checks.
  • Production LOC: +7/-12 (net -5). Tests: +13/-0.

This is a deterministic Gateway-manager lifecycle fix; no external provider or live channel operation is required for the owner-boundary proof.

ClawSweeper Review

ClawSweeper's latest review of exact head d50ca81b3db8b0eb9832ae0b932ba97304dd4669 found no code or security issue and agreed this is the best owner-boundary repair. Its live-proof wrapper marked the combined focused command partial because an expected terminal headline was not observed within 30 seconds; the captured output showed the executed suites passing, while the same exact combined command independently completed 312/312 and exact-head CI run 32645440460 is green. The requested P1/P2 mitigation is exact merge-head validation plus ordinary maintainer review: repository-native review artifacts validate READY FOR /prepare-pr with zero findings, and prepare-run will validate the current-main merge candidate before landing. No external-provider proof is required because no provider contract changed.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Aug 23, 2026
@steipete
steipete marked this pull request as ready for review August 23, 2026 14:26
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 10:48 AM ET / 14:48 UTC.

ClawSweeper review

What this changes

The PR makes an explicitly stopped idle channel account retain its manual-stop state so automatic health recovery leaves it stopped.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This maintainer PR fixes a current Gateway lifecycle defect: an exact idle-account stop returned before recording manual intent. No blocking code or security finding was identified; validate the exact merge head before landing.

Priority: P2
Reviewed head: d50ca81b3db8b0eb9832ae0b932ba97304dd4669

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused owner-boundary repair with credible regression coverage and no identified correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer PR is exempt from the external-contributor real-behavior-proof gate; its body provides focused regression-test evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer PR is exempt from the external-contributor real-behavior-proof gate; its body provides focused regression-test evidence.
Evidence reviewed 4 items Current-main defect: Current main returns for an idle account with no stop hook before reaching the later manual-intent write, so an exact manual stop is not recorded.
Owner-boundary repair: The PR retains the channel-wide idle fast path, but exact account stops now use that account as the sole target and reach the existing manual-intent owner.
Recovery consumer and regression coverage: The health monitor already skips accounts marked manually stopped; the added producer regression covers an idle account without a stop hook, while the existing monitor test covers the consumer guard.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/gateway/server-channels.test.ts src/gateway/channel-health-monitor.test.ts

Result: FAIL (partial) — step 2 expect_output server-channels auto restart: expected terminal output was not visible within 30 seconds: "server-channels auto restart"

node scripts/run-vitest.mjs src/gateway/server-channels.test.ts src/gateway/channel-health-monitor.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128237-LXUWeP/target$ node scripts/run-vitest.mjs src/gateway/server-channels.test.ts src/gateway/channel-healt
h-monitor.test.ts
node scripts/run-vitest.mjs src/gateway/server-channels.test.ts src/gateway/channel-health-monitor.test.ts
[test] starting test/vitest/vitest.gateway.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-128237-LXUWeP/target

 ✓  gateway-server-isolated  ../../src/gateway/channel-health-monitor.test.ts (53 tests) 70ms
 ✓  gateway-server-isolated  ../../src/gateway/server-channels.test.ts (103 tests) 417ms
 ✓  gateway-core  ../../src/gateway/channel-health-monitor.test.ts (53 tests) 136ms








































Assertions:

  • FAIL expect_output: server-channels auto restart

How this fits together

Gateway channel management receives operator and lifecycle stop requests, records account runtime state, and feeds that state to automatic recovery. The health monitor uses the recorded manual-stop state to decide whether a stopped account may restart.

flowchart LR
  A[Operator stop request] --> B[Gateway channel manager]
  B --> C[Manual stop intent]
  C --> D[Channel runtime snapshot]
  D --> E[Health monitor]
  E --> F[Remain stopped or restart]
Loading

Before merge

  • Resolve merge risk (P1) - GitHub reports this PR as cleanly mergeable but behind current main; validate the exact merge head and required checks before landing.
  • Complete next step (P2) - The protected maintainer PR has no concrete repair blocker; it needs normal exact-head validation and merge review.
Agent review details

Security

None.

PR surface

Source -5, Tests +13. Total +8 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 7 12 -5
Tests 1 13 0 +13
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 20 12 +8

Review metrics

Metric Value Why it matters
Production versus regression-test LOC production -5; tests +13 The bug fix reduces production code while adding focused owner-boundary regression coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep manual-stop intent owned by the channel manager for explicitly targeted accounts, preserve the no-enumeration channel-wide path, and land after exact-head validation.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep manual-stop intent owned by the channel manager for explicitly targeted accounts, preserve the no-enumeration channel-wide path, and land after exact-head validation.

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

Yes. Current main’s idle exact-account fast path returns before the manual-stop write, and the added focused test directly exercises that path.

Is this the best way to solve the issue?

Yes. Recording intent in the channel manager is the narrow owner-boundary repair and lets the existing health-monitor suppression apply without new policy or enumeration.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: The PR repairs a bounded Gateway lifecycle bug that can override an operator's explicit channel stop.
  • 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 maintainer PR is exempt from the external-contributor real-behavior-proof gate; its body provides focused regression-test evidence.

Evidence

What I checked:

  • Current-main defect: Current main returns for an idle account with no stop hook before reaching the later manual-intent write, so an exact manual stop is not recorded. (src/gateway/server-channels.ts:1114, 000db97c8252)
  • Owner-boundary repair: The PR retains the channel-wide idle fast path, but exact account stops now use that account as the sole target and reach the existing manual-intent owner. (src/gateway/server-channels.ts:1111, d50ca81b3db8)
  • Recovery consumer and regression coverage: The health monitor already skips accounts marked manually stopped; the added producer regression covers an idle account without a stop hook, while the existing monitor test covers the consumer guard. (src/gateway/channel-health-monitor.ts:128, d50ca81b3db8)
  • Current-source provenance: Available current-main blame attributes the pre-fix fast path to a recent source snapshot; the local grafted history cannot establish an original feature introducer beyond that. (src/gateway/server-channels.ts:1114, b9b6ca46c36d)

Likely related people:

  • Sebastian B Otaegui: Available current-main blame covers the pre-fix channel-stop fast path; the shallow history prevents stronger feature attribution. (role: recent current-source contributor; confidence: low; commits: b9b6ca46c36d; files: src/gateway/server-channels.ts, src/gateway/channel-health-monitor.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Validate the exact merge head with the focused Gateway test and required checks.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-23T14:33:10.646Z sha d50ca81 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head d50ca81b3db8b0eb9832ae0b932ba97304dd4669:

  • Pre-fix regression failed because the explicit idle account remained isManuallyStopped(...) === false.
  • node scripts/run-vitest.mjs src/gateway/server-channels.test.ts src/gateway/channel-health-monitor.test.ts — 312/312 passed.
  • PATH=/home/user/.cache/openclaw-autoqa/node-v26.7.0-linux-x64/bin:/home/user/workspace/repo/.amp/worktrees/autoqa-channel-idle-manual-stop/node_modules/.bin:$PATH node scripts/check-changed.mjs -- src/gateway/server-channels.ts src/gateway/server-channels.test.ts — passed.
  • Final branch autoreview — no findings, confidence 0.99.
  • Repository-native review artifacts — READY FOR /prepare-pr, zero findings; review-guard and review-validate-artifacts passed.
  • Exact-head CI run 32645440460 — success, no pending or failed checks.
  • Latest ClawSweeper review — no code/security findings and agrees with the owner-boundary repair. Its combined-test live wrapper timed out waiting for a terminal headline after showing passing suites; the same exact command completed independently at 312/312.

Live-proof gap: no external provider/channel flow was run. No provider contract changed; deterministic channel-manager producer coverage plus existing health-monitor consumer coverage proves the affected lifecycle boundary. Repository-native prepare-run will validate the current-main merge candidate before landing.

@steipete
steipete merged commit 8578b8f into main Aug 23, 2026
320 checks passed
@steipete
steipete deleted the codex/autoqa-channel-idle-manual-stop-20260823 branch August 23, 2026 15:04

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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: XS 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.

2 participants