Skip to content

Fix Live Workspace bootstrap in ChatGPT MCP Apps - #160

Merged
fwerkor merged 19 commits into
mainfrom
fix/live-workspace-chatgpt-result-fallback
Aug 8, 2026
Merged

Fix Live Workspace bootstrap in ChatGPT MCP Apps#160
fwerkor merged 19 commits into
mainfrom
fix/live-workspace-chatgpt-result-fallback

Conversation

@fwerkor

@fwerkor fwerkor commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • bump the unreleased package/runtime version to 4.0.0
  • make the Live Workspace MCP App bootstrap reliably in ChatGPT even when the initial standard tool-result does not carry the hidden credential envelope
  • prefer the standard MCP Apps tool-result, briefly wait for late delivery, and only then use ChatGPT compatibility metadata / app-initiated credential recovery
  • keep the internal transport explicitly modeled as an in-memory LiveChannel keyed by live_id; it is only a short-lived MCP/UI event channel, not an agent, conversation, or task session abstraction
  • keep normal ChatGPT conversations isolated: model and iframe MCP sessions attach by exact live_id; backend-restart recovery uses a short-lived, one-shot recovery claim instead of principal-wide auto-attachment
  • map repeated cached iframe recovery attempts for the same stale live_id onto the same recovered channel
  • make the workspace always collaborative: human and ChatGPT can operate the same terminal/files/remotes concurrently; remove Observe / Collaborate / Take over protocol and UI state
  • use only floating PiP and fullscreen workspace modes; request PiP on startup when supported and toggle reversibly between PiP and fullscreen
  • retry initial connection, event polling, and credential recovery indefinitely with bounded exponential backoff
  • content-version the MCP App ui:// resource URI so ChatGPT cannot keep executing stale cached UI code after an update
  • make Activity operational: hide bootstrap and per-keystroke terminal-input noise, show semantic current work, surface active jobs/terminals, route events to their actual machine/cwd, and expand final command stdout/stderr
  • keep expanded Activity output selectable/copyable and refresh cached running details after the call completes
  • rebuild the embedded MCP App asset and update English / Simplified Chinese / Traditional Chinese docs

Protocol

User-facing feature/tool names remain Live Workspace and open_live_workspace. Internal transport/state uses:

  • LiveChannel
  • LiveChannelManager
  • live_id / liveId
  • channel.opened
  • snapshot channel
  • auth claim live_id with auth=live-channel

There is no Agent/session/workspace abstraction hidden behind this channel and no legacy workspace_id compatibility layer.

Credential semantics

  • explicit open_live_workspace calls rotate the short-lived Live Workspace bearer token
  • iframe reattachment to the same valid live_id reuses the current token, so reconnecting/cached views do not invalidate one another
  • after a backend restart, the first iframe request using the stale live_id creates a replacement channel and a 60-second one-shot model-session recovery claim
  • unrelated conversations for the same OAuth principal are not continuously attached to another chat's channel

Validation

  • UI tests: 131 passed
  • TypeScript: bun run typecheck
  • Web build: bun run build:web
  • Python full suite: 667 passed, 1 skipped
  • focused Live Workspace / Human UI suites: 82 passed
  • Ruff: all checks passed
  • live_channel_routes.py focused branch coverage: 96.3%
  • git diff --check

This PR intentionally does not create a release or merge itself; 4.0.0 remains unreleased until a later explicit release step.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 8dabbc3727

ℹ️ 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 thread ui/src/live-workspace.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: a20453d08b

ℹ️ 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 thread src/local_shell_mcp/tools.py Outdated
Comment thread ui/src/live-workspace.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 17433ac649

ℹ️ 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 thread ui/src/live-workspace.ts Outdated
Comment thread ui/src/live-workspace.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 352763de6a

ℹ️ 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 thread ui/src/live-workspace.ts Outdated
Comment thread ui/src/live-workspace.ts
Comment thread ui/src/live-workspace.ts Outdated
Comment thread ui/src/live-workspace.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: cd2513803c

ℹ️ 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 thread ui/src/live-workspace.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: cc83aacfa3

ℹ️ 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 thread ui/src/live-workspace.ts Outdated
Comment thread src/local_shell_mcp/live_channel.py Outdated
Comment thread ui/src/live-workspace.ts Outdated
@fwerkor fwerkor self-assigned this Aug 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: ec8edcabc6

ℹ️ 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 thread ui/src/live-workspace.ts
@fwerkor

fwerkor commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@fwerkor

fwerkor commented Aug 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: fedcb0688d

ℹ️ 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 thread src/local_shell_mcp/live_channel.py Outdated
Comment thread ui/src/live-workspace.ts
Comment thread ui/src/live-workspace.ts
Comment thread ui/src/live-workspace.ts
Comment thread src/local_shell_mcp/live_channel.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: dfd6170cef

ℹ️ 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 thread ui/src/live-workspace.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 454a8b093f

ℹ️ 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 thread src/local_shell_mcp/tools.py
Comment thread ui/src/live-workspace.ts
Comment thread src/local_shell_mcp/tools.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 0d3e07e871

ℹ️ 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 thread ui/src/live-workspace.ts
Comment thread ui/src/live-workspace.ts Outdated
Comment thread src/local_shell_mcp/live_channel.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 87a99190df

ℹ️ 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 thread ui/src/live-workspace.ts Outdated
Comment thread ui/src/live-workspace.ts
@fwerkor
fwerkor merged commit e3c058f into main Aug 8, 2026
41 checks passed
@fwerkor
fwerkor deleted the fix/live-workspace-chatgpt-result-fallback branch August 8, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant