Skip to content

fix(codex): trust the worktree Codex starts in, not a guessed repo root - #23937

Merged
Jinwoo-H merged 3 commits into
mainfrom
jinwoo/sta-8900-codex-worktree-trust-root
Sep 30, 2026
Merged

Jinwoo-H merged 3 commits into
mainfrom
jinwoo/sta-8900-codex-worktree-trust-root

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​163 $\color{#cf222e}{\Huge{\mathbf{−}}}$​95 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​68
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​21 $\color{#cf222e}{\Huge{\mathbf{−}}}$​50 $\color{#cf222e}{\Huge{\mathbf{−}}}$​29

ELI5

Before Codex works in a folder it asks "Trust this folder?". Orca answers that question ahead of time by writing a "trusted" entry into Codex's config. For worktrees of a bare repository, Orca wrote the entry under a folder name Codex never looks up, so Codex still asked, and an Orca-started Codex worker sat at the question until it failed.

What Changed

Before: orca orchestration worker-start --agent codex into a worktree of a bare repo (proj.git + worktrees) or a repo made with git init --separate-git-dir failed with agent_readiness / "Agent startup blocked: agent-trust-workspace". The same happened when opening Codex in such a worktree from the UI: the trust prompt appeared even though Orca had "pre-trusted" it.

After: Codex starts with no trust prompt in every worktree layout. Orca now writes the trust entry for the exact folder it starts Codex in.

Mechanism: markCodexProjectTrusted (src/main/agent-trust-presets.ts) used to guess the folder Codex's resolve_root_git_project_for_trust would pick (for a linked worktree, the folder above the shared git dir, "the main checkout") and write [projects."<that folder>"] trust_level = "trusted". For a bare repo that guess was wrong: the folder above proj.git is not a checkout, so Codex looked up the worktree path and found nothing. But Codex checks the folder it runs in before any repo root (get_active_project in codex-rs/config/src/config_toml.rs and decision_for_dir in codex-rs/config/src/loader/mod.rs, same order back to 0.80). So Orca now writes the entry for the workspace's realpath, with no git-layout logic at all, and the execution-host home guard (from #23744) checks that same path for every agent.

Why

  • Trust the workspace itself rather than mirroring Codex's repo-root rule. A mirror of trust.rs fixes the bug too, but it is more code, has to be kept in step with Codex, and still marks a parent folder trusted. Writing the workspace path is simpler, cannot drift from Codex, and never widens trust beyond the folder Orca launched in. The cost is one config entry per worktree instead of one per repo. Entries older Orca wrote for main checkouts stay valid and are left in place.
  • A real-binary contract, not just fixtures. The bug was a mismatch between Orca's key and Codex's lookup, which fixture tests cannot catch. When ORCA_CODEX_TRUST_CONTRACT_BINARY is set, each layout test also starts a real Codex app-server with the config Orca wrote and asserts Codex treats the worktree as trusted (thread/start returns a workspaceWrite sandbox; the same config without the entry returns readOnly). Both come from the same project lookup the trust prompt uses. It runs in the existing Codex contract CI job against the already-pinned 0.158.0, and that job now also triggers on changes to agent-trust-presets and codex/config-toml-trust.

Out of scope (follow-up): when a trust prompt does appear anyway, worker-start still fails at agent_readiness instead of offering a recovery path.

Linked Issue

Fixes #23847

Visual Proof

N/A — no UI change. The effect is that a trust prompt no longer appears; evidence is the worker-start receipts below.

Testing

  • Unit tests in src/main/agent-trust-presets.test.ts build real layouts with the git CLI (standard repo + worktree, .bare + .git pointer, bare proj.git + worktree, --separate-git-dir, a parent .git pointing at a different repo, plain folder) and assert the key written is the workspace realpath.

  • Real-binary contract run locally with isolated CODEX_HOME/HOME: Codex 0.158.0 and 0.150.1 report every layout trusted (workspaceWrite), including a standard linked worktree; a reviewer run with 0.159.1 agreed. With ORCA_CODEX_TRUST_CONTRACT_REQUIRED=1 and no binary the suite fails at load.

  • Live (earlier revision of this PR), macOS, isolated headless dev runtime with Codex 0.159.0: worker-start --agent codex into a bare-repo worktree → ready (on main: failed / agent_readiness / agent-trust-workspace).

  • Windows/Linux: the path is realpathSync.native of the workspace, as before; the unit tests run on all CI platforms. SSH: unchanged — this runs wherever Codex's trust preset is written today.

  • pnpm tc:node, oxlint and check:code-quality:changed pass.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: trust can only narrow compared with before (the workspace path instead of a parent folder). Cross-platform, SSH, mobile, and backwards compatibility: no wire or UI changes; existing trusted entries are left in place. Performance: no extra file reads; the git-metadata reads are gone.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Codex keys a linked worktree's trust on the main checkout only when that
checkout's .git leads back to the common git dir; otherwise (bare repo,
--separate-git-dir) it keys on the worktree itself. Orca always wrote the
main-checkout key, so Codex showed its trust prompt and worker-start
failed at agent_readiness.

Mirror trust.rs exactly, and pin it with a real-binary contract that
runs in the existing Codex contract CI job.

Fixes #23847
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes how Codex project trust paths are resolved.

The PR appears safe to merge, with a non-blocking CI coverage gap remaining from the previous review.

Findings

  1. P2 Trust contract has missing triggers ▶

Summary

The PR changes Codex pre-trust to write the launching worktree’s own path and adds a pinned-binary contract test for that lookup.

  • It also extends the contract job’s path triggers to the trust preset and TOML writer.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Codex launch cwd] --> B[Canonicalize workspace path]
  B --> C[Write trusted project entry]
  C --> D[Codex checks its cwd key]
Loading

Reviews (3) · Last reviewed commit: "fix(codex): trust the worktree path itse..."

// job pins --no-daemon for Orca's codex shell wrapper.
// job pins --no-daemon for Orca's codex shell wrapper and the project-trust key.
const CODEX_INDEX_HEAL_CONTRACT_PREFIXES = [
'src/main/agent-trust-presets',

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 Trust contract has missing triggers

The new trigger covers agent-trust-presets.ts and its test, but not helpers that locate or write Codex trust entries, such as codex-home-paths.ts and config-toml-trust.ts. A change to either helper can skip the pinned-binary trust test, so that test may miss a regression in the path or entry Codex reads. This is a non-blocking CI coverage gap; include those dependencies in the job’s path triggers.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@Jinwoo-H Jinwoo-H Sep 29, 2026 •

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.

Added src/main/codex/config-toml-trust to the contract triggers in 3315c33 (with a classification test). Leaving out codex-home-paths: it decides which config files Orca writes, and the ordinary (no-binary) run of the same test already asserts the key lands in both the system and runtime config, so a regression there fails in every unit run without the pinned binary.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

That distinction is reasonable. With config-toml-trust now covered, the remaining pinned-binary-specific dependency is exercised; agent-trust-presets.test.ts already verifies that getLocalCodexTrustConfigFiles() causes the workspace key to be written to both the system and runtime config paths, so a codex-home-paths regression should fail the ordinary test run. No further trigger change is needed.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Codex trust root now mirrors Codex's own rule — resolveCodexProjectTrustRoot requires both the worktree's commondir and the main checkout's .git to resolve to the canonical common git dir before returning the main checkout; otherwise it returns the worktree path. New readGitDirPointer helper (symlinked pointers rejected), used for the workspace .git and the main checkout .git.
  • Real layout tests — linked worktree trust key builds six real git layouts (standard, .bare sibling pointer, bare proj.git, --separate-git-dir, mismatched main .git, plain folder) and asserts the exact single key written to both config files, so the alternative "write both keys" fix would also fail.
  • Real-binary trust contract — with ORCA_CODEX_TRUST_CONTRACT_BINARY set, each layout drives Codex app-server thread/start and asserts workspaceWrite under Orca's config vs. readOnly under a clean CODEX_HOME; REQUIRED=1 turns a missing binary into a failure instead of a skip.
  • CI wiring — new Verify Codex project-trust contract step pinned to the no-daemon Codex pin, and codex_index_heal_contract now triggers on src/main/agent-trust-presets.

I traced the resolver against resolve_root_git_project_for_trust at rust-v0.159.0 branch by branch — the .git-marker discovery, worktrees/commondir checks, non-canonical main_root derivation, and the canonical comparison against the common dir all match, and every new branch can only narrow the written key. The contract assertion is real: ThreadStartResponse.sandbox: SandboxPolicy is the field the test reads, and the empty-CODEX_HOME control means a thread/start that ignored trust would fail the negative case.

ℹ️ Stray trust keys from the old resolver are not cleaned up

The fix stops writing the main-checkout key for bare/--separate-git-dir worktrees, but markCodexProjectTrusted still only upserts and never removes, so entries a previous Orca version wrote for dirname(commonDir) (e.g. the parent directory of proj.git, which can hold unrelated projects) remain in ~/.codex/config.toml and the Orca runtime home. The PR body explicitly accepts leaving them in place, and they are dormant for the worktree that produced them since Codex now looks up the worktree path — this is a carry-forward note, not a request for a migration.

Technical details
# Legacy trust entries persist

## Affected sites
- `src/main/agent-trust-presets.ts:165-180` — `markCodexProjectTrusted` upserts the resolved key into the system and runtime configs; no removal path for the old key.
- `src/main/codex/config-toml-trust.ts:120-139` — `upsertProjectTrustLevel` only adds/updates one project block.

## Why it is dormant
A bare-repo worktree now resolves to the worktree path, so Codex's lookup no longer consults the stray parent key for that workspace. The residual risk is narrow: the parent directory would have to later become a `.bare`-style main checkout (a `.git` pointer to a sibling bare dir) for the stray grant to be read.

## Open question for the human
Is a one-time cleanup worth it? It cannot reliably distinguish an Orca-written key from one the user accepted via the trust prompt, so silence is a defensible default — surfacing only so the decision is deliberate.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 5a603903-1ff2-4222-93a2-e7eb1cf479cb

📥 Commits

Reviewing files that changed from the base of the PR and between ea6505d and 3315c33.

📒 Files selected for processing (9)
  • .github/workflows/pr.yml
  • config/scripts/pr-code-change-scope.mjs
  • config/scripts/pr-code-change-scope.test.mjs
  • src/main/agent-trust-presets.test.ts
  • src/main/agent-trust-presets.ts
  • src/main/agent-workspace-trust.test.ts
  • src/main/execution-host-workspace-trust.test.ts
  • src/main/execution-host-workspace-trust.ts
  • src/relay/agent-workspace-trust-spawn.test.ts
💤 Files with no reviewable changes (1)
  • src/main/agent-workspace-trust.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/pr.yml

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Codex trust configuration now uses the canonical workspace path, including for linked worktrees. Tests cover multiple Git layouts and, when configured, verify Codex app-server sandbox behavior. The PR workflow runs a required project-trust contract check and classifies trust-related changes to run the contract and packaging jobs.

Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 3315c

Codex trust for linked worktrees now uses the worktree's own path. No merge-blocking issue was found in the supplied changes, and CI runs a contract check against the real Codex binary.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 3315c

The change makes new trust entries workspace-specific rather than checkout-wide and preserves the existing trust-writing controls. Previously unsupported repository layouts now receive effective automatic trust. Older trust entries may remain, and validation is limited to the pinned Codex contract.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed authority concerns selected workspaces and the Codex configuration files supplied by their execution host. Bare and separate-git-dir worktrees gain effective automatic trust where startup previously remained blocked. New writes no longer grant through a main-checkout key, but this does not establish isolation from legacy trust entries or other Codex lookup fallbacks.

Trust Boundaries and Controls

  • observed — Home-containment protection remains conditional on whether a preset inherits home trust; Codex is explicitly marked non-inheriting. Removing the Codex-only path conversion does not change the path checked for inheriting presets. The new writer also removes Git metadata as a source of trust-destination redirection.

Resilience and Maintainability Implications

  • observed — The retained mutation design serializes writes within each normalized configuration lane, recovers after predecessor rejection, skips unchanged content and atomically replaces individual files with temporary-file cleanup on failure. Sequential updates across multiple configuration files are not a single transaction, so a later failure can leave an earlier trust update committed.
  • observed — The retained deadline stops waiting but does not cancel or revoke the underlying write. Late completion can still persist trust, while write failures are caught and permit prompting. These transition limitations are not established as introduced or worsened by this PR.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 9 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed [Issue #23847] markCodexProjectTrusted now writes the canonical workspace path directly. applyWorkspaceTrustOnThisHost passes that path to Codex. Tests cover standard linked worktrees, sibling-bar…
Out of Scope Changes check ✅ Passed The implementation changes Codex trust-key selection. The updated trust tests, real-Codex contract test, workflow wiring, scope rules, and related workspace-trust expectations verify or enable that be…
Title check ✅ Passed The title clearly identifies the primary change: Codex now trusts the worktree path where it starts instead of an inferred repository root.
Description check ✅ Passed The description is complete and focused. It includes the ELI5, change details, rationale, linked issue, visual-proof rationale, testing, scope notes, and checklist. The testing checklist confirms manu…
Full details: Docstring Coverage

Explanation

Docstring coverage is 45.45% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 9 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Keeps #23744's exported resolveCodexProjectTrustRoot and its
configFiles-based markCodexProjectTrusted, with this branch's
Codex-mirroring root rule.

Drops main's "trusts the main repository root for a linked worktree
without reading commondir" test: its fixture has no commondir, a layout
Codex's resolve_root_git_project_for_trust rejects (it keys trust on the
worktree), so it encoded behaviour Codex does not have. The branch's
real-git layout tests cover the case instead.

linkGitWorktree now writes commondir as git does, so the
execution-host trust tests describe a worktree Codex would recognise.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Merged origin/main into the branch — the only commit since the prior review is the merge ea6505d. Conflict resolution preserved this PR's resolveCodexProjectTrustRoot logic while adopting main's refactored markCodexProjectTrusted(workspacePath, configFiles) signature and its AgentTrustPreset type change.
  • Test call sites rewired — the test now passes getLocalCodexTrustConfigFiles(); the six-layout linked worktree trust key suite, the adversarial-metadata test, and the real-binary contract are intact.
  • Shared fixture updated — linkGitWorktree now writes commondir (../..), which the new resolver requires, so the execution-host and relay trust tests using it still exercise the codex path.

The resolver itself is unchanged from the reviewed 860bcc1 and remains a faithful mirror of Codex's trust.rs. I confirmed the merge resolution imports getLocalCodexTrustConfigFiles correctly, that resolveCodexProjectTrustRoot is now also consumed by execution-host-workspace-trust.ts:74, and ran the affected suites locally: agent-trust-presets, execution-host-workspace-trust, relay/agent-workspace-trust-spawn, and codex-trust-config-concurrent-launch all pass (105 passed, 1 skipped real-binary contract).

The carry-forward note from the prior review (previously written stray trust keys under dirname(commonDir) are left in place) is unchanged by this merge and remains deliberately accepted in the PR body, so it is not re-raised here.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Codex looks up the cwd's own [projects] entry before any repo root
(config_toml.rs get_active_project, loader decision_for_dir), so trusting
the workspace realpath satisfies every git layout. Drops the
resolve_root_git_project_for_trust mirror: simpler, cannot drift from
Codex, and never widens trust past the folder Orca launched in. Cost is
one config entry per worktree; entries older Orca wrote on main
checkouts stay valid.

The six real-git layout tests now assert the workspace key and, under
the contract, that real Codex starts workspaceWrite for each. The
contract probes the binary version once and fails at load when required
but missing; its CI path filter now includes config-toml-trust.
@Jinwoo-H Jinwoo-H changed the title fix(codex): trust the path Codex checks for bare-repo worktrees fix(codex): trust the worktree Codex starts in, not a guessed repo root Sep 29, 2026
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

@pullfrog re "every branch matches trust.rs": the mirror is gone as of 3315c33. Codex checks the cwd's own [projects] entry before any repo root (get_active_project in config_toml.rs, decision_for_dir in loader/mod.rs), so Orca now trusts the workspace realpath with no git-layout logic. The six layout tests now assert that key, and the real-binary contract (0.158.0, 0.150.1 locally) reports each layout trusted.

@pullfrog

pullfrog Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

You're right — my previous review described the superseded revision. At 3315c333e61 the resolver is gone: markCodexProjectTrusted now canonicalizes the workspace path and carries no git-layout logic, and a tree-wide search finds no remaining resolveCodexProjectTrustRoot / storedTrustPath references.

I checked the lookup-order claim against Codex 0.159.0 source rather than taking it on faith:

  • ConfigToml::get_active_project iterates resolved_cwd first and only falls through to repo_root (codex-rs/config/src/config_toml.rs).
  • ProjectTrustContext::decision_for_dir tries the directory's own normalized keys first, then project-root keys, then repo-root keys (codex-rs/config/src/loader/mod.rs).

So a key on the workspace realpath satisfies the cwd lookup for every layout, and the six-layout suite plus the real-binary contract assert exactly that. Ran the three affected suites locally: 95 passed, with the ORCA_CODEX_TRUST_CONTRACT_BINARY contract skipped (no binary in this environment), as designed.

The prior carry-forward note — older dirname(commonDir) keys are left on disk — is unchanged and accepted in the PR body, so nothing further from me. Treat the earlier "faithful mirror of trust.rs" line as withdrawn.

Pullfrog  | View workflow run | via Pullfrog | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Resolver deleted; Codex now trusts the workspace path itself — resolveCodexProjectTrustRoot and its gitdir:/commondir traversal are removed. markCodexProjectTrusted writes [projects."<canonicalize(workspacePath)>"] with no git-layout logic, since Codex checks the cwd's own entry before the repo root. The change strictly narrows trust versus the old main-checkout key.
  • Execution-host path simplified — storedTrustPath is removed and applyWorkspaceTrustOnThisHost passes workspacePath straight through to the writer and the home guard (Codex is not an inheriting preset, so the guard never applied to it).
  • Tests drive real git layouts — the linked worktree trust key suite builds six real layouts with the git CLI (standard worktree, sibling .bare pointer, bare proj.git, --separate-git-dir, a parent .git pointing elsewhere, plain folder) and asserts the exact single key written to both config files.
  • Real-binary contract — with ORCA_CODEX_TRUST_CONTRACT_BINARY, each layout runs Codex app-server thread/start (cwd = workspace) and asserts workspaceWrite under Orca's config against readOnly under an empty CODEX_HOME; ORCA_CODEX_TRUST_CONTRACT_REQUIRED=1 fails at load when the binary is missing. The Codex index-heal contract CI job (which now runs this with the pinned 0.158.0) is green on this head.
  • CI wiring and call-site updates — new Verify Codex project-trust contract step, agent-trust-presets/config-toml-trust added to the job's path triggers (with a classification test), and the execution-host/relay trust tests plus the now-dead resolver mock updated.

I traced the new production path: markCodexProjectTrusted canonicalizes once and the execution-host writer receives the same path, so the key Orca writes and the folder Codex looks up for a worktree launch are identical. The real-binary differential (trusted config vs empty home) is genuine coverage — the only variable between the two runs is the entry Orca wrote — and thread/start's cwd is the same project lookup Orca's own production openCodexThread drives. The prior carry-forward note (legacy keys are never removed) is unchanged by this commit and remains deliberately accepted in the PR body, so it is not re-raised.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 9f43115 into main Sep 30, 2026
42 checks passed
brennanb2025 added a commit that referenced this pull request Sep 30, 2026
Main (#23744, #23937) moved every agent trust write into one dispatcher,
applyWorkspaceTrustOnThisHost, run on the host that starts the agent: main
for local and WSL launches, the SSH relay for remote ones. The desktop SFTP
trust writer, the trust IPC and the per-call-site launch-prep writes are gone.

Re-applied on top:
- markCodexProjectTrusted attempts every config.toml it is given, so a file
  Orca refuses to edit never leaves another Codex home untrusted.
- The dispatcher reports refused Codex config edits once per file and message.
- smol-toml is loaded with a literal require so the relay's esbuild bundle
  inlines it; relay hosts have no node_modules, and createRequire made the
  relay fail to load.
- Remote trust tests ported to the relay writer; hook-status log-once test
  moved out of the test file main deleted.
brennanb2025 added a commit that referenced this pull request Sep 30, 2026
agent-trust-presets.ts: #23937 trusts the folder Codex starts in (canonicalize,
no guessed repo root); kept, with this branch's lane comment, since no hook
install has a capture->restore window any more.
brennanb2025 added a commit that referenced this pull request Sep 30, 2026
…ership

#23930 merged current main, whose #23744/#23937 moved trust writing into
applyWorkspaceTrustOnThisHost (local) and the SSH relay. Resolved by taking
that design and dropping what it already covers: the per-home trust writes,
the launch-prep trust writes and their shared budget, and the worker-start
trust diagnosis (moved to a follow-up; #23847 is now referenced, not fixed).

Kept on top of it:
- Local Codex trust also reaches the per-account home the launch reads: the
  launch env's CODEX_HOME joins getLocalCodexTrustConfigFiles, as the relay
  already does.
- An OS error that stops a trust write names config.toml, not the atomic
  writer's temp file; config refusals pass through unchanged.
- The WSL hook-trust relocation now logs through warnCodexConfigOnce and
  writes through withConfigPath, the base's single refusal and write rules.
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.

[Bug]: Codex worker-start fails with agent-trust-workspace and offers no harness-preserving recovery

1 participant