Skip to content

[Bug]: T3's checkout rule can stop delegated Codex agents from creating worktrees for native workers #40098

Open

Description

@AdAssassin

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

These steps reduce the workflow from the reported run. The shorter recipe has not been run independently.

  1. Open a T3 Code thread in a disposable Git project with at least one commit. Enable native Codex subagents.
  2. Use delegate_task to start a local Codex child with gpt-6.2-sol and isolation: "shared". Give it this task: “Create a temporary detached Git worktree from HEAD with git worktree add --detach. Start one native Codex worker with spawn_agent to run git rev-parse HEAD in that worktree. Wait for the worker, report its result, and remove the worktree.”
  3. Check whether the child starts the workflow or ends the turn citing the injected checkout rule. Use fresh delegates to test for intermittent refusals.

Expected behavior

A delegated Codex agent can create temporary worktrees for native workers when its task authorizes them. The checkout rule should explicitly apply to workspace selection for T3 delegates and new T3 threads. T3 binds those workspaces through delegate_task with isolation: "worktree" or through workspaceStrategy when launching a thread. The existing worktree-add-for-parallel-pr-delegates eval covers a parent launching T3 delegates into separate worktrees. packages/provider-core/src/server/orchestrationInstructions.ts#L9-L14, evals/mcp-tool-use/cases/orchestration.ndjson#L15

Actual behavior

In the reported run, twelve T3-delegated Codex agents were asked to run a workflow that creates its own detached Git worktrees and starts native Codex workers. Five stopped before starting the workflow and cited the injected rule: “Never make a child's checkout in the shell or in task.” The other seven proceeded.

PR #24850 compressed guidance about preparing T3 delegates and binding new T3 threads into the current wording. Codex receives that wording next to guidance that permits a delegated agent to start subagents when its task calls for them. The checkout sentence leaves “child” unqualified, so the delegated agent can apply the rule to its own native workers. packages/provider-core/src/server/orchestrationInstructions.ts#L9-L25 before the rewrite, packages/provider-core/src/server/orchestrationInstructions.ts#L9-L14 at the rewrite, apps/server/src/provider/CodexDeveloperInstructions.ts#L41-L52

Impact

Major degradation or frequent failure

Version or commit

Observed on T3 Code Nightly v0.1.12-nightly.20261121.5024 (6357d17a4963e546aa71a6094ae2b3d3bb04edb1). The same wording is present on main at 26d81d88c1a28711fa3e040342b68d34693a478f. The runtime observation is from the Nightly build. Nightly orchestrationInstructions.ts#L9-L14, main orchestrationInstructions.ts#L9-L14

Environment

macOS 27.2.1, T3 Code Nightly desktop app, Codex CLI 0.171.0 with gpt-6.2-sol.

Logs or stack traces

No response

Screenshots, recordings, or supporting files

No response

Workaround

In the parent’s task brief, explicitly authorize the workflow’s detached worktrees and native Codex workers. Say that the checkout rule applies to workspaces for delegate_task children and new T3 threads. A delegated agent may still refuse under the injected wording.

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions