Skip to content

fix(ui): keep panels and terminals through reconnects - #174046

Merged
steipete merged 16 commits into
mainfrom
steipete/offline-panels
Oct 18, 2026
Merged

steipete merged 16 commits into
mainfrom
steipete/offline-panels

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: terminals, embedded apps and canvas previews are torn down and rebuilt on every brief Gateway disconnect.

On a blip the Terminal panel disposed every emulator (scrollback, tabs, selection) and aborted upload batches; a failed restore could prune saved session ids, and input/resize failures were swallowed as success. MCP app iframes and raw canvas previews were keyed on the handshake or connection generation, so they remounted and lost in-app state. The link reader reset fetched documents and cached transport failures as missing previews, read-aloud stopped already-downloaded audio, and an aborted Talk chat.abort produced an unhandled rejection.

User Impact

User impact: terminals, embedded apps and previews stay as they were through a short disconnect. Terminal input is disabled while offline and the session reattaches with its output when the Gateway returns; nothing typed is replayed later.

Why This Change Was Made

  • Terminal: the connection suspends instead of disposing (old-transport requests are retired by generation), tabs go read-only, and resume reattaches each session with a replay. Unknown restore/attach results keep saved session ids; input/resize rejections surface a delivery error and are never queued.
  • MCP apps and canvas frames keep their iframe while content identity is unchanged, suspend bridge calls offline, and re-initialize only on real identity or resource change; MCP init timeouts get a Retry.
  • Link reader keeps fetched documents and previews and no longer caches transport failures; downloaded read-aloud audio keeps playing; Talk abort rejection is handled.
  • Identity changes (different client, recovery scope, or retired offline access) still reset everything.

Part of the offline-first series.

Evidence

  • Focused suites (terminal reconnect/restore/connection, MCP view/bridge/catalog, canvas frame retention, link reader and preview, read-aloud reconnect, Talk) passed on a remote Testbox (265 tests); typecheck/lint findings from that run are fixed in this branch.

Landing repair at 7830e8fcb30 merges main 33b5bee3901, retaining the newer chat projections and MCP transport fixtures alongside the offline availability and subscription-reconnect contracts. The branch-caused dictation E2E failure selected the hidden desktop button at a mobile viewport; its selector now targets the visible mobile control, with every geometry and visibility assertion unchanged.

Focused validation: three unit files (MCP bridge, chat pane, warm boot), 52 tests passed in 192.48s; the dictation E2E file passed all 13 tests in one rerun (159.47s total, 60.94s test time). The browser suite proves actual dictation controls and layout through the production UI. Scoped formatting, lint, and diff checks passed. Independent selector review and merge-resolution review found no actionable issues. These are focused local results; current-head GitHub CI remains the broad landing gate.

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review blocked

Automated review did not run, so no review verdict was produced.

Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here.

Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update.

Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T01:55:46.571959Z 7830e8f New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL labels Oct 16, 2026

@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: 4896590fbd

ℹ️ 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 on lines +449 to +453
await Promise.all(
[...this.streams].map(([sessionId, stream]) => {
stream.abort.abort();
stream.abort = new AbortController();
return this.reattachStream(sessionId, stream);

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.

P2 Badge Isolate failed terminal reattachments

When multiple terminal tabs survive a disconnect and one PTY exits or is reaped before reconnect, that tab's failed terminal.attach rejects this Promise.all. resumeTransport() therefore never reaches the loop that makes any tab writable, while the failed stream remains registered, so every retry repeats the failure and all otherwise healthy tabs stay read-only until the missing tab is manually closed. Settle and reconcile reattachments per session so one missing PTY can be marked exited without blocking the others.

AGENTS.md reference: ui/AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already addressed: Fixed in 39cbaa7 by resuming each retained session independently and reconciling confirmed missing sessions without blocking surviving terminals.

Comment on lines 50 to 54
return JSON.stringify([
gatewayPresentationScope(context.gateway).key,
context.gateway.snapshot.phase === "connected",
available(),
value.agentId,
value.sessionKey,
]);

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.

P2 Badge Revalidate prepared app sessions after reconnect

For catalog callers with prepareSession() enabled, removing connection state from discoveryIdentity also leaves preparedSessionIdentity valid across reconnects. If the selected session is deleted by another client or lost during a Gateway restart while this UI is offline, reconnect skips sessions.describe/createResult, mcp.app.discover fails for the missing session, and Retry keeps skipping preparation because the identity never changes. Keep the displayed catalog identity stable, but retire or generation-scope the preparation stamp when reconnecting so the session is reconciled with Gateway authority.

AGENTS.md reference: ui/AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in eb62a6f: Reconnect now expires the catalog session preparation receipt so discovery can recreate a session deleted offline while retaining the displayed catalog.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 16, 2026
Keep terminal sessions, upload batches, embedded app and Canvas frames, link-reader content, and downloaded speech through same-client transport loss. Preserve request fencing and retire presentation on identity or confirmed access changes.

Expose terminal delivery uncertainty and reconnect Retry, retain saved session IDs after failed restores, and handle Talk abort rejections. Local proof is limited to formatting, i18n baseline generation, and whitespace checks under the coordinator work order; focused tests, typecheck, lint, and review are delegated to the coordinator.
@steipete
steipete force-pushed the steipete/offline-panels branch from 4896590 to f1f2709 Compare October 16, 2026 09:57

@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: f1f2709143

ℹ️ 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 on lines +284 to +286
(this.activeTab.view.status === "idle" || this.reloadPending)
) {
this.reloadPending = false;

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.

P2 Badge Refresh every retained link-reader tab after reconnect

When a multi-tab reader reconnects, the panel-wide reloadPending flag is consumed while refreshing only the active tab. Other ready tabs keep their pre-disconnect documents, and selecting one later does not call loadDetail() because its status remains "ready" and this flag is already false; those tabs can therefore display stale content indefinitely, while their image loaders remain fenced to the old connection generation. Track refresh-needed state per tab or mark retained tabs for reload when selected.

AGENTS.md reference: ui/AGENTS.md:L17-L20

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in eb62a6f: Each retained reader tab now refreshes its document and image loader when selected after reconnect, including interrupted refreshes.

Comment on lines +395 to +399
!gapFrame &&
replayStart <= previouslyObservedThrough &&
offset >= previouslyObservedThrough
? "resume"
: "recovery",

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.

P2 Badge Preserve recovery mode until terminal replay succeeds

If a reconnect requires a full recovery replay and the hidden replacement terminal fails to initialize, expectedSeq has already advanced before onReplay rejects. On the next Retry, this predicate classifies the same authoritative snapshot as "resume", so only the suffix—often empty—is appended to the old emulator, leaving its screen permanently missing the recovered output. Commit the offset only after replay succeeds, or retain a forced-recovery marker after failure.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in eb62a6f: The terminal replay offset now advances only after the emulator successfully applies the replay, preserving missing output for a later retry.

createdResources.reconnect = async () => {
await notifications.reconnect();
if (payload.updateModelContextSupported) {
await refreshModelContext();

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.

P2 Badge Preserve MCP model context when reconnect refresh fails

For an app advertising updateModelContextSupported, reconnect now invokes refreshModelContext(), whose request failure is converted to null and published to the retained iframe. A transient mcp.app.modelContext failure immediately after reconnect therefore silently clears previously valid model context and is treated as a successful reconnect, with no retry; retain the existing context on failure and publish only an authoritative response.

AGENTS.md reference: ui/AGENTS.md:L17-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in eb62a6f: Failed model context reads now preserve retained context while an authoritative null response still clears it.

@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: 882f226a4b

ℹ️ 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 on lines +27 to +31
if (snapshot.phase !== "connected") {
const previous = terminalAccess.get(snapshot.client);
return Boolean(
previous && previous.recoveryScope === snapshot.client.recoveryScope && previous.allowed,
);

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.

P2 Badge Preserve focused terminal tabs during reconnects

When a focused terminal document encounters a connection blip, this cached availability remains true, but FocusPanels in ui/src/app/app-root.tsx still passes client={null} while disconnected and never supplies gatewayConnected. The terminal controller consequently treats the outage as a client identity change and calls disposeAllTabs(), losing the focused view's scrollback, selection, and retained upload state rather than suspending it. Update this remaining caller to retain the client and pass the real connection state, as the shell, chat, and terminal-page callers now do.

AGENTS.md reference: AGENTS.md:L50-L53

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in eb62a6f: The focused Terminal now retains its client through transport loss and receives connection availability separately, with regression coverage for reconnect and identity replacement.

@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 16, 2026

@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: c0a1f16cd2

ℹ️ 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".

onNew={props.view().onNew}
newLabel={t("terminal.newSession")}
newDisabled={props.view().booting}
newDisabled={!props.view().connected || props.view().booting}

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.

P2 Badge Disable terminal tab closure while offline

When the global terminal dock is visible during a Gateway disconnect, the new connected state disables New, uploads, and retries but leaves the tab strip's close action enabled. Closing a connection-owned tab in that state immediately removes it and forgets its persisted session ID, while TerminalConnection.close() suppresses the failed offline RPC; the PTY therefore continues running invisibly on the Gateway until its detach timeout and this browser cannot reattach it. Disable closing while disconnected or retain and reconcile the close intent after reconnect.

AGENTS.md reference: ui/AGENTS.md:L17-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in eb62a6f: Live terminal tabs cannot be closed offline, and both close controls are disabled while exited diagnostic tabs remain dismissible.

@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: c0a1f16cd2

ℹ️ 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".

onNew={props.view().onNew}
newLabel={t("terminal.newSession")}
newDisabled={props.view().booting}
newDisabled={!props.view().connected || props.view().booting}

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.

P2 Badge Disable terminal tab closure while offline

When the global terminal dock is visible during a Gateway disconnect, the new connected state disables New, uploads, and retries but leaves the tab strip's close action enabled. Closing a connection-owned tab in that state immediately removes it and forgets its persisted session ID, while TerminalConnection.close() suppresses the failed offline RPC; the PTY therefore continues running invisibly on the Gateway until its detach timeout and this browser cannot reattach it. Disable closing while disconnected or retain and reconcile the close intent after reconnect.

AGENTS.md reference: ui/AGENTS.md:L17-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in eb62a6f: The terminal owner now preserves live sessions when offline close is attempted, with disabled close controls and regression coverage for saved session retention.

@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: 4fd99a1dc2

ℹ️ 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 on lines +347 to +350
if (
request &&
this.host.client?.connected &&
request.generation !== this.host.client.connectionGeneration

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.

P2 Badge Trigger hovercard recovery on reconnect

For plugin previews inside the activity-feed provider, which does not supply pagePreviewContext, a same-client reconnect with unchanged reader descriptors only invokes propertyChanged("readers"); its reference-equality fast path returns without calling update(). Consequently this generation-mismatch recovery branch never runs, so a preview request interrupted by the disconnect remains in its old error or pending state until another property changes or the user closes and reopens the hovercard. Subscribe this owner to the connection lifecycle or include the connection generation in its update decision.

AGENTS.md reference: ui/AGENTS.md:L17-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not changing: The activity feed unmounts this hover provider when its pull request snapshots retire and recreates it after reconnect, so this path recovers without a manual page reload.

Keep retained terminal sessions recoverable during offline close and failed replay, refresh reader tabs and MCP session preparation after reconnect, and retain confirmed App context on transient reads. Repair terminal action receipts and Gateway subscription fixtures after the main merge, preserving strict delivery error handling.

@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: eb62a6f9de

ℹ️ 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 on lines +433 to +437
await Promise.all(
[...this.streams].map(([sessionId, stream]) => {
stream.abort.abort();
stream.abort = new AbortController();
return this.reattachStream(sessionId, stream).catch((error: unknown) => {

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.

P2 Badge Make healthy tabs read-only while Retry reattaches them

When one of several sessions fails the initial reconnect, the successful tabs are made writable before the Retry action is exposed. Clicking Retry invokes resume() again, and this loop re-enters recovery for every stream without first making those healthy tabs read-only. Keystrokes entered in a healthy tab during the attach then pass the UI's canSend() check, but requestAction() rejects them because stream.recovering is true, discarding the input and replacing it with a generic delivery error. Retry only the failed streams or publish read-only state before reattaching all streams.

AGENTS.md reference: ui/AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

Comment on lines +324 to +325
try {
const listed = await this.connectionFor(operation).list();
if (!this.isTerminalOperationCurrent(operation, restore)) {
return false;
}
const known = new Map(listed.map((session) => [session.sessionId, session]));
for (const sessionId of restore.pending.keys()) {
const session = known.get(sessionId);
if (!session) {
await this.restoreExitedSession(sessionId, restore);
} else {
await this.attachSession(
sessionId,
operation,
session.owner?.startsWith("agent:") === true,
restore,
);
}
if (!this.isTerminalOperationCurrent(operation, restore)) {
return false;
await this.recovery.resume(operation, (tab) => {

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.

P2 Badge Clear obsolete resume errors after automatic recovery

If a reconnect fails and sets the resume retry error, a later transport disconnect can automatically run this method again and successfully recover every tab, but the old error is never cleared; only the manual retryOpen() path clears it. The panel therefore continues showing “attach failed” with a Retry button even though its tabs are live and writable, and that unnecessary Retry also reattaches every healthy stream. Clear the unchanged resume error once recovery succeeds.

AGENTS.md reference: ui/AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

@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: 65f1e8a0eb

ℹ️ 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 on lines 621 to 624
if (isCurrent() && tab.view.status !== "ready") {
tab.view = { status: "error", message: linkReaderErrorMessage(error) };
this.requestUpdate();
}

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.

P2 Badge Keep failed reconnect refreshes retryable

When a retained ready tab's reconnect refresh reaches the current connection but its detailMethod fails transiently, loadDetail() has already cleared reloadPending, and this branch preserves the old ready view without restoring that marker or exposing an error. Selecting the tab again therefore never retries, while its retained LinkReaderImages is fenced to the pre-disconnect generation, so uncached images remain unusable until a manual refresh or another reconnect. This is distinct from the earlier per-tab scheduling issue: the refresh is now dispatched, but its failure outcome is dropped.

AGENTS.md reference: ui/AGENTS.md:L17-L19

Useful? React with 👍 / 👎.

Comment on lines +401 to +402
onLoad={() => {
initialized = true;

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.

P2 Badge Retry failed raw Canvas frames after reconnect

When a raw Canvas iframe loads an HTTP error document for an expired capability URL, this handler still marks it initialized because iframe errors also dispatch load. createCanvasFramePresentation() then preserves that failed frame when reconnect publishes a fresh capability URL, leaving the sidebar stuck until the panel is recreated; the sibling widget test already documents that an HTTP error produces load. Only retain the frame after verifiable initialization, or refresh unverifiable frames when the capability changes.

AGENTS.md reference: ui/AGENTS.md:L17-L19

Useful? React with 👍 / 👎.

@steipete steipete changed the title fix(ui): keep terminals, embedded apps and previews through brief Gateway disconnects fix(ui): keep panels and terminals through reconnects Oct 17, 2026

@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: b27544dbfe

ℹ️ 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 on lines +60 to +63
priorMetadata.previewMethod === metadata.previewMethod &&
priorMetadata.imageMethod === metadata.imageMethod &&
priorMetadata.hosts.length === metadata.hosts.length &&
priorMetadata.hosts.every((host, index) => host === metadata.hosts[index])

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.

P2 Badge Compare all reader behavior flags before retaining descriptors

When a live capability refresh changes sessionScoped or progressive for the same plugin/reader while the compared fields remain unchanged, this branch retains the old descriptor. Downstream detail and preview requests then continue omitting a newly required session key or sending the wrong progressive-section shape, and the panel sees the same reader object so it does not invalidate the stale document until the client or recovery scope changes. Include both behavior flags, or the complete metadata shape, in the retention comparison.

AGENTS.md reference: AGENTS.md:L75-L75

Useful? React with 👍 / 👎.

@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: e4828da13c

ℹ️ 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".

} catch (error: unknown) {
if (this.host.isCurrent(operation, restore)) {
this.host.setError(`${t("terminal.attachFailed")}: ${formatUiError(error)}`);
return true;

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.

P2 Badge Keep failed saved-session restores retryable

When a persisted-session attach fails transiently during startup restoration, this return true is interpreted by terminal-pending-actions.ts as userClosedTab, so the restore action is retired as "cancelled-restore"; the remaining saved sessions are never attempted, and setError supplies no retry action. This is separate from retained-stream resume recovery: users must close/reopen the panel or wait for another reconnect to retry otherwise-live saved sessions. Return a failure/retryable outcome here rather than the user-closed sentinel.

AGENTS.md reference: AGENTS.md:L82-L82

Useful? React with 👍 / 👎.

Keep terminal delivery-error callbacks bound to their controller. Load the
Gateway confirmation and standalone dashboard loader/renderer on demand,
with feature chunks that stay outside ordinary startup and chat boot.
Preserve loading, cancellation, and same-identity offline presentation.

Measure dictation controls in one browser task so reactive status replacement
cannot detach a control between lookup and geometry inspection. Keep the
existing visibility and containment assertions, and await lazy confirmation
registration in the Gateway-lineage fixture.

Focused unit coverage passes across four files. Production gzip measures
339154 bytes at startup and 1489193 bytes at chat boot, below unchanged limits.
Preserve terminal availability through reconnects while retaining main projection cleanup. Keep MCP transport fixtures and reconnect subscription coverage. Repair the mobile dictation geometry selector without changing its assertions.
@steipete
steipete merged commit 2d7d89f into main Oct 18, 2026
98 checks passed
@steipete
steipete deleted the steipete/offline-panels branch October 18, 2026 02:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
* fix(ui): retain panels across gateway reconnects

Keep terminal sessions, upload batches, embedded app and Canvas frames, link-reader content, and downloaded speech through same-client transport loss. Preserve request fencing and retire presentation on identity or confirmed access changes.

Expose terminal delivery uncertainty and reconnect Retry, retain saved session IDs after failed restores, and handle Talk abort rejections. Local proof is limited to formatting, i18n baseline generation, and whitespace checks under the coordinator work order; focused tests, typecheck, lint, and review are delegated to the coordinator.

* fix(ui): resolve offline panel validation failures

* fix(ui): retire revoked reader data and retain delivery errors

* fix(ui): preserve terminal refresh fencing and repair panel fixtures

* fix(ui): recover surviving terminals after detached sessions expire

* fix(ui): handle missing link reader presentation snapshots

* fix(ui): preserve panel recovery across reconnects

Keep retained terminal sessions recoverable during offline close and failed replay, refresh reader tabs and MCP session preparation after reconnect, and retain confirmed App context on transient reads. Repair terminal action receipts and Gateway subscription fixtures after the main merge, preserving strict delivery error handling.

* test(ui): tighten panel fixture types

* fix(ui): settle offline terminal availability changes

* fix(ui): repair offline panel integration after main merge

* refactor(ui): keep terminal session controller within line limit

* fix(ui): repair offline panel CI and defer optional boot views

Keep terminal delivery-error callbacks bound to their controller. Load the
Gateway confirmation and standalone dashboard loader/renderer on demand,
with feature chunks that stay outside ordinary startup and chat boot.
Preserve loading, cancellation, and same-identity offline presentation.

Measure dictation controls in one browser task so reactive status replacement
cannot detach a control between lookup and geometry inspection. Keep the
existing visibility and containment assertions, and await lazy confirmation
registration in the Gateway-lineage fixture.

Focused unit coverage passes across four files. Production gzip measures
339154 bytes at startup and 1489193 bytes at chat boot, below unchanged limits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant