Skip to content

fix: keep Gateway responsive during channel owner selection - #158783

Merged
steipete merged 1 commit into
mainfrom
codex/config-policy-sqlite-20260926
Sep 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/config-policy-sqlite-20260926

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes a blocking SQLite read on the Gateway when channel setup rechecks policy after selecting an agent from a multi-agent roster.

User Impact

The Gateway can continue serving other work while channel setup reads retained plugin-migration policy. Setup still validates the current roster and rejects a config owner that closes during that read. No configuration migration or operator action is required.

Why This Change Was Made

The awaited policy path uses the existing shared-state worker and config reader, obtaining fresh migration rows on every call. It captures the selected config path and environment before awaiting, then the channel caller rechecks its original write owner before using the result. The existing synchronous updater and plugin cleanup effect guards remain unchanged; this focused change does not preload stale migration facts for those long-lived guards or claim their broader migration is complete.

Evidence

The real-SQLite regression failed on the old reader because it invoked the synchronously waited snapshot worker. The async path passes with zero main-thread SQL, zero synchronous snapshot-worker calls, unchanged config/database/WAL/SHM artifacts, and fresh visibility after migration completion. The focused policy case takes approximately 4.8 seconds including real worker reads.

All 85 channel and owner tests pass, including owner revocation during the new await and the existing hosted wizard roster-change cases. The new owner tests take approximately 0.2 seconds; the existing channel suite takes approximately 28 seconds of test execution.

The broader config suite encounters two pre-existing filesystem-watch assertions in reads current runtime migration obligations without full database snapshots (sync and async). Both failures were independently reproduced on clean main at a2792b9 with its frozen dependency graph; these assertions are unchanged. Independent review found no actionable issues through P2, all changed checks passed, and CI run 36232617155 passed on 15deecb. The native exact-head watcher is green. The baseline watcher repair is tracked separately in #158798.

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: S labels Sep 26, 2026
@steipete
steipete marked this pull request as ready for review September 26, 2026 09:23
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 26, 2026, 5:52 AM ET / 09:52 UTC (Revision 2).

ClawSweeper review

What this changes

Channel setup now awaits a worker-backed configuration policy read after agent selection, rechecks the config write path, and adds regression coverage and worker-access documentation.

Merge readiness

✅ Ready for maintainer review

Current main still performs the blocking read during channel owner selection. This focused PR remains useful; the reviewed patch has no identified blocking defect.

Priority: P1
Reviewed head: 15deecb9c267404eae9c7b4d20eb76415a5c778c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair has direct worker-path and owner-check coverage, with passing reported checks and no identified patch defect.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The supplied Repository State classifies the author as MEMBER, so the external-contributor proof gate does not apply. The changed wizard uses the worker-backed reader; the PR body reports a real-SQLite before/after regression and passing owner tests, but no separate live Gateway trace. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied Repository State classifies the author as MEMBER, so the external-contributor proof gate does not apply. The changed wizard uses the worker-backed reader; the PR body reports a real-SQLite before/after regression and passing owner tests, but no separate live Gateway trace. No stored-data contract changes.
Evidence reviewed 9 items Current main remains synchronous: The fetched main revision calls the synchronous policy reader after the agent-selection prompt.
Blocking baseline reader: The main-branch policy reader obtains deferred migration rows synchronously before loading configuration.
Introduced channel path: The introduced hunk awaits the policy read and checks the captured config path again before resolving the selected agent; the verified test merge retains these changes.
Findings None None.
Security None None.

How this fits together

The channel setup wizard serves both openclaw channels add and the Gateway’s hosted wizard. It reads the current agent roster and retained plugin-migration policy before discovering channels and committing configuration.

flowchart LR
A[Channel setup request] --> B[Agent selection]
B --> C[Config path check]
C --> D[Migration rows in worker]
D --> E[Current config read]
E --> F[Agent validation]
F --> G[Guarded config write]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +17, Tests +82, Docs +7. Total +106 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 2 19 2 +17
Tests 3 89 7 +82
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 115 9 +106

Review metrics

Metric Value Why it matters
Policy read paths 1 asynchronous setup path added; 2 synchronous effect-guard callers retained The Gateway selection path moves to a worker while the updater and plugin-cleanup guards retain their existing contracts.

Technical review

Best possible solution:

Keep fresh migration-policy reads in the existing SQLite worker and config-reader owners, with roster validation and config write checks through the final commit.

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

Yes, from source: current main reaches the synchronous migration-policy read after multi-agent channel selection. This read-only review did not run a Gateway reproduction.

Is this the best way to solve the issue?

Yes. The patch uses the existing asynchronous config and SQLite worker paths while preserving the selected-agent and config-write checks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P1: A synchronous SQLite policy read in hosted channel setup can delay unrelated Gateway work.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied Repository State classifies the author as MEMBER, so the external-contributor proof gate does not apply. The changed wizard uses the worker-backed reader; the PR body reports a real-SQLite before/after regression and passing owner tests, but no separate live Gateway trace. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jacqueline Henriksen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-09-26T09:31:42.427Z sha 15deecb :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 1dbbf6c into main Sep 26, 2026
278 of 279 checks passed
@steipete
steipete deleted the codex/config-policy-sqlite-20260926 branch September 26, 2026 10:01
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
steipete added a commit that referenced this pull request Oct 13, 2026
…0230)

Move deferred plugin migration reads out of ordinary CLI and Gateway config loading. Doctor owns legacy plugin repairs, while update admission and config writes carry explicit migration facts, preserve unavailable-plugin inputs, and retain generation checks at repair publication.

Normal config reads and writes now consume canonical config without a migration-ledger database query. `openclaw update status` exposes pending work; after a source or package-manager upgrade, run `openclaw doctor --fix` before restarting. Candidate validation keeps the previous Gateway running when canonical config remains invalid. Preserve the published 2026.10.1 Windows updater's state-worker contract.

Align ClawRouter's Solid dependencies to 2.0.0-rc.14 with Canvas, Workboard, and X, as explicitly approved, and regenerate its browser asset manifest and lockfile.

The reviewed product changes, focused tests, and package/update evidence are documented in the PR. Merge current main to incorporate its correction of the inherited idle-input durability test expectation; do not treat the historical failed run as current-head passing evidence.

Related: #147711, #158783, #160682.

Current-head CI run 38335235541: 91 passed, 23 skipped, 6 failed including aggregate. Native inherited-failure admin evidence binds five unchanged-owner shards, matching scheduled-main profile-authority failures, isolated archive-fixture noninteraction, exact tested merge, zero cancellations, and independent security clearance. Failed CI remains failed; details and limits are in the PR body.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…nclaw#170230)

Move deferred plugin migration reads out of ordinary CLI and Gateway config loading. Doctor owns legacy plugin repairs, while update admission and config writes carry explicit migration facts, preserve unavailable-plugin inputs, and retain generation checks at repair publication.

Normal config reads and writes now consume canonical config without a migration-ledger database query. `openclaw update status` exposes pending work; after a source or package-manager upgrade, run `openclaw doctor --fix` before restarting. Candidate validation keeps the previous Gateway running when canonical config remains invalid. Preserve the published 2026.10.1 Windows updater's state-worker contract.

Align ClawRouter's Solid dependencies to 2.0.0-rc.14 with Canvas, Workboard, and X, as explicitly approved, and regenerate its browser asset manifest and lockfile.

The reviewed product changes, focused tests, and package/update evidence are documented in the PR. Merge current main to incorporate its correction of the inherited idle-input durability test expectation; do not treat the historical failed run as current-head passing evidence.

Related: openclaw#147711, openclaw#158783, openclaw#160682.

Current-head CI run 38335235541: 91 passed, 23 skipped, 6 failed including aggregate. Native inherited-failure admin evidence binds five unchanged-owner shards, matching scheduled-main profile-authority failures, isolated archive-fixture noninteraction, exact tested merge, zero cancellations, and independent security clearance. Failed CI remains failed; details and limits are in the PR body.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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