Skip to content

fix: keep Control UI setup responsive when discovery stalls - #112338

Merged
steipete merged 3 commits into
mainfrom
steipete/web-ui-session-testing-cec9fb
Jul 22, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/web-ui-session-testing-cec9fb

Conversation

@steipete

@steipete steipete commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #112336

What Problem This Solves

Fixes an issue where users completing first-run Control UI setup could lose the available ambient OpenAI API-key route when rich inference discovery exceeded its timeout. On macOS, an unrelated stalled default trust-store lookup could also keep Gateway startup waiting indefinitely, so setup and chat remained unavailable despite valid AI access.

Why This Change Was Made

The Gateway now treats macOS CA prewarming as a bounded, non-fatal optimization and terminates a stalled worker after 10 seconds. Setup detection keeps a tiny dependency-free ambient credential path so timeout fallback still exposes OpenAI and Anthropic API-key candidates. Live setup probes acquire an isolated read-only prepared runtime, preserving the exact staged candidate across concurrent Gateway runtime replacement instead of rebinding it to configured ownership.

Landing also corrects a pre-existing stale Zoom Meetings test expectation exposed by the required full-suite gate: production intentionally routes the realtime engine through the joined session owner (support), while the test still expected the configured fallback (consult). No production Zoom behavior changes.

This PR is AI-assisted. The final diff was reviewed with the repository autoreview workflow and no actionable findings remained.

User Impact

Control UI onboarding remains responsive on slow or wedged macOS trust-store hosts, and a valid ambient API key continues to appear after discovery timeout. Users can verify and activate that route instead of being left without a setup candidate or waiting indefinitely for startup.

Evidence

  • Focused local proof after the final rebase:
    • node scripts/run-vitest.mjs src/agents/prepared-model-runtime.test.ts src/gateway/system-ca-warmup.test.ts src/system-agent/setup-inference-detection.test.ts src/system-agent/setup-inference.test.ts
    • 150 tests passed across unit, Gateway, and agents shards, including the startup event-loop regression.
    • Changed-file formatting and targeted oxlint passed.
    • node scripts/run-vitest.mjs extensions/google-meet/index.test.ts extensions/zoom-meetings/src/runtime-node.test.ts — 161 tests passed after correcting the stale Zoom expectation.
  • Full changed gate on trusted source via AWS Crabbox:
  • Final branch autoreview against current origin/main: clean, no accepted/actionable findings; TruffleHog clean.
  • Live isolated Gateway proof with a real OpenAI key:
    • Timeout detection still returned the openai-api-key candidate.
    • Four session variants completed real OpenAI turns: named managed worktree, auto-named managed worktree, direct repository session, and openai/gpt-5.6-luna override.
    • Concurrent worktree/session creation succeeded for distinct names; same-name contention was rejected with the owning session identified.
    • Session worktree reuse succeeded; contradictory worktree name, relative cwd, and base-ref-without-worktree inputs were rejected.
    • Control UI PR projection reported local tracked/untracked diff statistics without inventing a PR/create URL.
    • Snapshot remove/restore preserved tracked and untracked working state exactly.
    • All test sessions, worktrees, branches, snapshot refs, isolated state, and the credential-bearing Gateway process were removed afterward.
  • Rendered browser interaction gap: the existing-profile Chrome DevTools bridge was unavailable after its single approved restart/retry, so this PR does not claim screenshot-level UI proof. No visual UI code changed; the exercised RPCs are the exact Control UI session/worktree/Git surfaces.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Jul 21, 2026
@steipete
steipete marked this pull request as ready for review July 21, 2026 15:52
@steipete

steipete commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready verification is complete for head a48b6e1ad2bf9172356a1b468beffa321cf56a5e.

Proof:

  • node scripts/run-vitest.mjs src/agents/prepared-model-runtime.test.ts src/gateway/system-ca-warmup.test.ts src/system-agent/setup-inference-detection.test.ts src/system-agent/setup-inference.test.ts src/gateway/server-startup-model-runtime.event-loop.test.ts — 150 tests passed across unit, Gateway, and agents shards.
  • Changed-file oxfmt and targeted oxlint passed.
  • AWS Crabbox run run_6685ba2d6d04 (cbx_cfe2e45b3f3e, stopped) ran pnpm check:changed and passed the core, coreTests, extensionTests lanes, including typecheck, lint, import-cycle, and architecture guards: https://crabbox.openclaw.ai/portal/runs/run_6685ba2d6d04
  • node scripts/run-vitest.mjs extensions/google-meet/index.test.ts extensions/zoom-meetings/src/runtime-node.test.ts — 161 extension tests passed after correcting the stale Zoom session-agent expectation exposed by the full-suite landing gate.
  • Final branch autoreview --mode branch --base origin/main was clean with no actionable findings; TruffleHog was clean.
  • Live isolated Gateway proof with a real OpenAI key passed setup timeout fallback, four session/model variants, concurrent managed-worktree creation, same-name contention, invalid-input rejection, worktree reuse, Git/PR projection, and dirty snapshot remove/restore. All sessions, worktrees, refs, state, and the credential-bearing process were removed afterward.

Known proof gap: the existing-profile Chrome DevTools bridge was unavailable after one restart/retry, so rendered screenshot proof was not captured. No visual UI code changed; the exact Control UI session/worktree/Git RPC surfaces were exercised live.

@steipete
steipete force-pushed the steipete/web-ui-session-testing-cec9fb branch 2 times, most recently from ca68294 to b6de422 Compare July 21, 2026 20:25
@openclaw-barnacle openclaw-barnacle Bot added the plugin: zoom Zoom plugin label Jul 21, 2026
@steipete
steipete force-pushed the steipete/web-ui-session-testing-cec9fb branch 2 times, most recently from 8a19544 to a72fcbd Compare July 22, 2026 00:18
@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix: keep Control UI setup responsive when discovery stalls This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete force-pushed the steipete/web-ui-session-testing-cec9fb branch from a72fcbd to fd58969 Compare July 22, 2026 00:40
@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix: keep Control UI setup responsive when discovery stalls This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit d3430ca into main Jul 22, 2026
119 checks passed
@steipete
steipete deleted the steipete/web-ui-session-testing-cec9fb branch July 22, 2026 03:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 22, 2026
…#112338)

* fix(gateway): keep setup responsive during inference discovery

* test(agents): align setup runtime coverage

* test(zoom-meetings): follow session agent routing
steipete added a commit that referenced this pull request Oct 13, 2026
Share existing config-path and retired-media traversal owners. Remove speculative
rollback, retry, reentry, and diagnostic freshness machinery while preserving
security effect checks, ordinary cleanup settlement, resource bounds, and public
config, CLI, protocol, and persisted-data shapes. Phase E is untouched.

Production delta: 335 net lines removed (+97/-432) across 16 old files.
Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests
in 4 files. Independent scoped review found no actionable P0-P2 findings.
Published as a branch only under the campaign's below-500 rule, not a PR.

Best-effort tradeoffs accepted

- Overlapping failed env publications may require reload/restart instead of ordered compensation; #105289/#103736 document synthetic harness proof, not a human actual-use report.
- Failed in-process restart preparation/emission requires explicit config reapply or manual restart; #105289/#160375 describe synthetic timing, not a transient transport failure.
- A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; #149792 uses forced mount fixtures, without a human incident.
- CLI provider cleanup is attempted once; #113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure.
- Requested-head CI details are a snapshot until refresh; #148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs.
- A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; #92175/#89456 are synthetic trust-harness work, and every trust check remains.
- Model normalizers must not reenter the same resolver; #156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain.
- Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; #109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding.
- A delayed update verification reply may repeat a terminal broadcast or briefly show old status; #160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain.
- A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; #112338/#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains.
- Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; #113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain.
steipete added a commit that referenced this pull request Oct 13, 2026
…#170826)

* refactor: simplify older agent and channel execution paths

Consolidate duplicate payload and metadata projections under their existing owners. Simplify internal bookkeeping and bounded cache invalidation while retaining public SDK contracts, security-effect authority, ordinary concurrency, and durable user state.

* refactor: retain branch cache pending complete old-code cutover

Withdraw the branch-cache cluster because completing its unused-export cleanup requires an infra owner touched this week. Preserve the original cache, regression assertions, and docs. The remaining old-code lane removes 424 net production lines and is branch-only under the campaign BELOW-500 rule.

* refactor: simplify old gateway, config, and CLI bookkeeping

Share existing config-path and retired-media traversal owners. Remove speculative
rollback, retry, reentry, and diagnostic freshness machinery while preserving
security effect checks, ordinary cleanup settlement, resource bounds, and public
config, CLI, protocol, and persisted-data shapes. Phase E is untouched.

Production delta: 335 net lines removed (+97/-432) across 16 old files.
Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests
in 4 files. Independent scoped review found no actionable P0-P2 findings.
Published as a branch only under the campaign's below-500 rule, not a PR.

Best-effort tradeoffs accepted

- Overlapping failed env publications may require reload/restart instead of ordered compensation; #105289/#103736 document synthetic harness proof, not a human actual-use report.
- Failed in-process restart preparation/emission requires explicit config reapply or manual restart; #105289/#160375 describe synthetic timing, not a transient transport failure.
- A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; #149792 uses forced mount fixtures, without a human incident.
- CLI provider cleanup is attempted once; #113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure.
- Requested-head CI details are a snapshot until refresh; #148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs.
- A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; #92175/#89456 are synthetic trust-harness work, and every trust check remains.
- Model normalizers must not reenter the same resolver; #156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain.
- Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; #109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding.
- A delayed update verification reply may repeat a terminal broadcast or briefly show old status; #160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain.
- A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; #112338/#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains.
- Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; #113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain.

* refactor: defer pricing cache cleanup touched on main

Withdraw the usage-format production and paired test changes after main landed afc559c, keeping the hard seven-day old-code exclusion. Both files match the pre-campaign base, so main retains its interrupted-stream usage repair. The remaining reviewed o05/o06 union removes 713 net production lines across 42 files.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…openclaw#170826)

* refactor: simplify older agent and channel execution paths

Consolidate duplicate payload and metadata projections under their existing owners. Simplify internal bookkeeping and bounded cache invalidation while retaining public SDK contracts, security-effect authority, ordinary concurrency, and durable user state.

* refactor: retain branch cache pending complete old-code cutover

Withdraw the branch-cache cluster because completing its unused-export cleanup requires an infra owner touched this week. Preserve the original cache, regression assertions, and docs. The remaining old-code lane removes 424 net production lines and is branch-only under the campaign BELOW-500 rule.

* refactor: simplify old gateway, config, and CLI bookkeeping

Share existing config-path and retired-media traversal owners. Remove speculative
rollback, retry, reentry, and diagnostic freshness machinery while preserving
security effect checks, ordinary cleanup settlement, resource bounds, and public
config, CLI, protocol, and persisted-data shapes. Phase E is untouched.

Production delta: 335 net lines removed (+97/-432) across 16 old files.
Focused proof: 311 tests in 25 files; final embedding/shutdown proof: 91 tests
in 4 files. Independent scoped review found no actionable P0-P2 findings.
Published as a branch only under the campaign's below-500 rule, not a PR.

Best-effort tradeoffs accepted

- Overlapping failed env publications may require reload/restart instead of ordered compensation; openclaw#105289/openclaw#103736 document synthetic harness proof, not a human actual-use report.
- Failed in-process restart preparation/emission requires explicit config reapply or manual restart; openclaw#105289/openclaw#160375 describe synthetic timing, not a transient transport failure.
- A mount changed during sampling may briefly be attributed to its parent filesystem until the next snapshot; openclaw#149792 uses forced mount fixtures, without a human incident.
- CLI provider cleanup is attempted once; openclaw#113471's blocked-close fixtures do not establish a transient failed-close incident, and the CLI exits on cleanup failure.
- Requested-head CI details are a snapshot until refresh; openclaw#148464's synthetic push/rerun interleavings do not justify rereading the head and check inventory after fetching jobs.
- A malformed catalog resolver may repeat rejection until the existing 16-fallback bound instead of an earlier identity bailout; openclaw#92175/openclaw#89456 are synthetic trust-harness work, and every trust check remains.
- Model normalizers must not reenter the same resolver; openclaw#156076's callback reentry is synthetic. Measured lookup caches and ordinary callback errors/order remain.
- Offline plugin-state imports assume no unsupported same-destination writer after capacity preflight; openclaw#109679's ordinary near-capacity import remains fixed, while concurrent eviction compensation came from synthetic sibling seeding.
- A delayed update verification reply may repeat a terminal broadcast or briefly show old status; openclaw#160592 supplies synthetic ordering proof, while durable effect idempotency, FIFO, repair authority, and shutdown joining remain.
- A malformed reply from the fixed inline CA worker may fail instead of using a dedicated invalid-result fallback; openclaw#112338/openclaw#112336 do not report a human malformed-message incident. Timeout/error/exit handling remains.
- Failed Gateway embedding cleanup blocks only its agent/provider scope until restart instead of retaining provider objects and retrying close; openclaw#113471 documents synthetic blocked-close proof, not a human failed-close incident. Local FIFO cleanup, remote concurrency, abort handling, authority, and normal shutdown settlement remain.

* refactor: defer pricing cache cleanup touched on main

Withdraw the usage-format production and paired test changes after main landed 7a00a9f, keeping the hard seven-day old-code exclusion. Both files match the pre-campaign base, so main retains its interrupted-stream usage repair. The remaining reviewed o05/o06 union removes 713 net production lines across 42 files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations gateway Gateway runtime maintainer Maintainer-authored PR plugin: zoom Zoom plugin size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Control UI setup loses ambient key when discovery times out

1 participant