Repository navigation
improve: stream native sessions as hosts finish - #110211
Conversation
0a69aea to
cc8d0a2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a69aea5ea
ℹ️ 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".
| const mergedHost = | ||
| (params.pageDepths.get(hostKey) ?? 0) > 0 | ||
| ? preserveExpandedCatalogHost(freshHost, currentHost) | ||
| : freshHost; |
There was a problem hiding this comment.
Preserve adopted catalog keys in streamed host merges
When a user continues a catalog session while an older progressive list request is still settling, the provider can later emit a host page built from the pre-adoption adopted snapshot. This branch replaces the existing host with that fresh payload for non-expanded hosts, bypassing the sessionCatalogRevision guard that protects aggregate refreshes after handleCatalogSessionContinued, so the row can lose its stamped openClawSessionKey and reappear as an unadopted duplicate until a later poll reconfirms it. Merge existing per-session openClawSessionKey values, or reject host events older than the adoption revision.
Useful? React with 👍 / 👎.
cc8d0a2 to
2a28b23
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86221aeb34
ℹ️ 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".
| node, | ||
| query, | ||
| adoptedSessions: adoptedNodeSessions, | ||
| ...(params.onHost ? { onHost: params.onHost } : {}), |
There was a problem hiding this comment.
Add terminal capability before streaming Codex node hosts
When a paired Codex node supports terminal resume, the progressive onHost callback passed here emits the raw listPairedNode host before codexNodeTerminalCapability(node) is applied on the aggregate return path. Since toGenericCatalogHost only sets canOpenTerminal from host.canOpenTerminalCodex === true, streamed node rows render with terminal clicks/menu disabled, and this persists after an 8s fail-soft timeout until a later full poll repairs the row. Apply the terminal capability before invoking onHost (or wrap the callback) so progressive and final hosts expose the same actions.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
* perf: stream native session catalogs by host * fix: satisfy session catalog CI contracts * fix: retain changed-session refresh timing * fix: keep catalog refresh helpers private
What Problem This Solves
Fixes an issue where opening Chat with native Claude Code or Codex session discovery enabled would wait for the slowest paired computer before showing useful sessions. Sessions created outside OpenClaw also remained stale until a page reload or another unrelated refresh.
Why This Change Was Made
Native catalog providers now publish each host page as it finishes while retaining the existing aggregate RPC response as the authoritative recovery path. The Control UI merges those scoped events, reconciles every 30 seconds while visible, follows observed changes after 5 seconds, and refreshes on focus or paired-node presence changes.
The protocol addition is optional. A new UI connected to a pre-progressive Gateway retries without
progressIdafter the older closed schema rejects it. No config, storage, watcher, or SQLite surface was added.User Impact
Claude Code and Codex sessions begin appearing host by host instead of after the slowest computer finishes. Sessions created directly in either CLI are picked up within 30 seconds while the page stays visible, or immediately after focus/connectivity invalidation.
Late slow-host results remain usable after the fail-soft aggregate timeout. Stale streams, reconnect races, expanded-page refreshes, duplicate activation events, and temporary host errors cannot overwrite newer healthy state.
Evidence
Release note: Native Claude Code and Codex sessions now stream into Chat host by host and refresh automatically when external CLI sessions appear.