Skip to content

fix(cloud): a new cloud chat opens even when its project's setup fails, and says so - #201

Open
andrewcai8 wants to merge 4 commits into
mainfrom
fix/new-chat-setup-failure-nonfatal
Open

andrewcai8 wants to merge 4 commits into
mainfrom
fix/new-chat-setup-failure-nonfatal

Conversation

@andrewcai8

Copy link
Copy Markdown
Owner

A new cloud chat failed to open when one of its repository's prepare commands failed ("Environment setup failed: Remote preparation failed: Preparation command failed ..."). Since #198 a chat that had prepared once tolerated a failing setup, but a chat's first preparation stayed fatal. So when megpt-mono's setup broke upstream (a query generated against a production Gel migration that has not shipped yet), no new chat could open at all.

Every preparation the manager makes for a chat now sends forChat to the guest. A chat's failing prepare commands are then handled the way a prepared root's already were. The remaining commands still run, and the masked failures join refreshError (logged on the host as a warning) and setup-failure.log in the box's T3 home. The T3 server starts, and the agent's cloud machine note quotes the log. forChat is left out of the guest's intent hash, like setup.

Warm base and spare builds stay fatal, so a broken setup is never sealed into something later chats share:

  • preparing in EnvironmentControl leaves forChat off when the request is the build in progress that its repository's warm base (E2B) or spare (Namespace) record names (isBaseBuild in warmBases.ts). That record is saved before the build is driven, and only that build is ever sealed.
  • The E2B seal rehearsal prepares from the raw stored manifest, so it never carries forChat.
  • Namespace Mac template builders pass builder, which already drops the chat's setup. They now drop forChat too.

The guest's default is still fatal, so any preparation path that misses the flag fails the safe way.

Tests:

  • remotePreparation.test.ts: a new chat whose first setup command fails opens with refreshError, writes setup-failure.log, runs the next command, and starts its server. Committed first and failing (Remote preparation failed: Preparation command failed: deps broke). The existing fatal test, renamed to cover warm base and spare builds, still refuses on every retry. The prepared-root tests from fix(cloud): a chat whose project setup fails still gets T3 updates #198 are unchanged.
  • warmBases.test.ts: isBaseBuild against real stores tells the spare build from a chat, from the same request on the other provider, and from a request with no repository.

Claude Opus 5.5 via Claude Code.

🤖 Generated with Claude Code

andrewcai8 and others added 4 commits October 9, 2026 11:35
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, and says so

A new chat's first preparation failed outright when one of its
repository's prepare commands failed, so a repository whose setup broke
upstream could not open any new cloud chat. Only a chat that had already
prepared once tolerated it.

Every preparation the manager makes for a chat now sends forChat to the
guest. A chat's failing prepare commands are reported the way a prepared
root's already were: the rest still run, the masked failures join
refreshError and setup-failure.log, the T3 server starts, and the agent's
cloud machine note points at the log.

A warm base or spare build stays fatal. The manager recognises one as the
request its repository's warm base or spare record names as the build in
progress, and the E2B seal rehearsal and Namespace Mac template builders
never send forChat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stead of failing its open

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 20.9 KiB 20.9 KiB 0 B (0.0%) 29.3 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 57fde0d · PR result: e347d4e · Source CI: cancelled

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant