Skip to content

fix: bind runnable Codex workspaces to the installed kit#562

Merged
Stahl-G merged 3 commits into
mainfrom
codex/runnable-workspace-bootstrap
Jul 22, 2026
Merged

fix: bind runnable Codex workspaces to the installed kit#562
Stahl-G merged 3 commits into
mainfrom
codex/runnable-workspace-bootstrap

Conversation

@Stahl-G

@Stahl-G Stahl-G commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • materialize and verify the exact workspace Codex runtime kit before fresh SQLite initialization
  • route CLI init, init-web, and runtime install through one phase-aware WorkspaceBootstrap boundary
  • keep CLI init preparation-only while making init-web immediately runnable
  • make runtime install verify-only once a Store exists, with no overwrite, reinstall, or rebind
  • recover exact init-web replay from the Store-bound receipt after process restart; changed payloads conflict without writes
  • reject CLI init --force before any workspace write when SQLite authority already exists

Invariant

A committed runnable-workspace receipt is returned only after the workspace Codex kit has been materialized, exact-inventory verified, bound into SQLite from those workspace bytes, and reverified after commit.

Non-goals

  • no schema or migration changes
  • no legacy compatibility or fallback
  • no runtime ingress/preflight changes
  • no public capability expansion or documentation changes

Focused evidence

  • Python 3.12: 57 focused tests passed
  • Python 3.12 -O: 57 focused tests passed
  • non-editable wheel smoke covers init-web -> committed receipt -> runtime next
  • existing RuntimeHost initialization regression module: 23 passed
  • Ruff and git diff --check passed

@Stahl-G Stahl-G changed the title fix: make initialized Codex workspaces immediately runnable fix: bind runnable Codex workspaces to the installed kit Jul 22, 2026
@Stahl-G
Stahl-G marked this pull request as ready for review July 22, 2026 01:41

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

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

workspace_id, run_id, request_workspace_prefix = self._submission_identities(
request_id, fingerprint
)
authority = classify_workspace_authority(target)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject reused init-web request IDs before target writes

When the same request_id is submitted again with a changed workspace_target that points to a fresh directory, this target-only authority check skips the existing-store conflict path and proceeds to create_workspace, committing a second runnable workspace instead of returning submission_replay_conflict with zero writes. The old request-id guard rejected changed payloads before resolving the target, and the module contract still promises that same-request changed payloads conflict, so the replay/conflict record needs to be keyed by request namespace before any new target can be written.

Useful? React with 👍 / 👎.

@Stahl-G
Stahl-G marked this pull request as draft July 22, 2026 01:49
@Stahl-G
Stahl-G marked this pull request as ready for review July 22, 2026 02:08

@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: 9986ddcd5a

ℹ️ 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 +111 to +114
WorkspaceBootstrap(args.workspace).install_codex_kit(
dry_run=dry_run
),
*(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Defer writes until all runtime kits are validated

When runtime install --runtime all is run and a later phase cannot be planned or written (for example, a packaged install without source-clone OpenCode/Claude assets, or a user-owned Claude file conflict), this first list element eagerly installs the Codex kit before the subsequent installers run, so the command returns 1 after already modifying the workspace. The previous single installer path validated all planned writes before applying any, so all should preserve that zero-write-on-failure behavior by planning/validating every runtime before materializing earlier kits.

AGENTS.md reference: AGENTS.md:L142-L147

Useful? React with 👍 / 👎.

@Stahl-G
Stahl-G merged commit bd08ac9 into main Jul 22, 2026
19 checks passed
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