Skip to content

#418 step 4: Isolate provider and MCP managed policy and verify delegation integration #436

Closed

Description

@tannerpolley

Part of #418. Step 4 of 4. Depends on step 3. Full scope, tests and done criteria are in the canonical plan: #418 (comment) (item 4).

Scope: move managed instruction and tool policy assembly out of the Codex and Claude adapters, and finish thin MCP composition.

Preserve: the native execution fixes and Writer routing.

Tests: extend ManagedIssueDelegation, the relevant adapter fork suites, the MCP toolkit registration and outside-client tests, and the result-read acknowledgement cases. If model-facing text changes, follow evals/README.md (free checks only).

Done:

  • managed policy lives outside the adapters;
  • registration succeeds with EnabledWhen intact;
  • focused suites and check:changed pass.

The primary integrator then does one Replay-backed web/desktop pass covering:

  • start and queued work;
  • a question;
  • a cancel;
  • sibling completion;
  • result recovery after a restart.

Publish the before/after numstat and the residual-hunk ledger on #418.

Activity

  1. tannerpolley commented on Nov 18, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code status: Done

    Issue: #436 #418 step 4: Isolate provider and MCP managed policy and verify delegation integration

    Thread: thread:delegated-task:command%3Amcp%3A53eed4d4-49de-4205-ba6f-a35a0b15b7c9%3Adelegate-task%3Aissue-436-418-step4-2026-11-18

    Model: claude-opus-5-5

    Branch: issue-436-418-step-4-isolate-provider-and-mcp

    Updated: 2026-11-18T02:08:48.944Z

  2. tannerpolley commented on Nov 18, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #436 #418 step 4: Isolate provider and MCP managed policy and verify delegation integration
    Thread: thread:delegated-task:command%3Amcp%3A53eed4d4-49de-4205-ba6f-a35a0b15b7c9%3Adelegate-task%3Aissue-436-418-step4-2026-11-18
    Model: claude-opus-5-5
    Branch: issue-436-418-step-4-isolate-provider-and-mcp
    Completed: 2026-11-18T02:08:49.146Z

    I've opened draft PR #475, which closes #436 and references #418. Managed instruction and tool-policy assembly no longer lives in the Codex and Claude adapters, and focused tests show no new failures beyond the known ones. check:changed fails in two places I didn't cause (typecheck in apps/mobile, and the known #470 tests). The integration pass couldn't cover sibling completion, because the Replay provider can't start delegated children.

    What changed

    • One policy on the session: the session now carries one composed policy: instruction sections, model roles, and whether native subagents are allowed. It's built outside the adapters. The worker/root role comes from IssueEligibility.managedIssueRole, and the composer is t3OrchestrationPolicy in provider-core.
    • Adapters only translate it:
      • Codex: the sections become its context entries, and "no native subagents" becomes its multi-agent feature flags.
      • Claude: the policy becomes its system-prompt text and the blocked Agent/Task/TeamCreate tools.
      • Claude query reuse: a role change still restarts Claude's live query; a model-roles refresh still doesn't.
    • Thinner MCP service:
      • propose_issue_change moved into RepositoryOrchestrationMcp.
      • delegate_task reuses that module's existing check that the caller's repository root hasn't been retired.
      • The three copies of the thread loader collapsed into one.
      • The order of checks and the error messages are unchanged.
    • Wording: propose_issue_change now says approvals wait "in the issue panel". That's where the approval card actually is on the Roadmap, on upstream's Issues page, and in a thread's issue panel. "On the Roadmap page" would have added a byte to the agent-context budget, which CI rejects without a label; the new wording is the same length.
    • A fix this exposed: in managed Claude sessions, the issue instructions were glued onto the end of the runtime block with no gap (…</pull_request_linking>Keep issues current…). They're now a separate paragraph. Ordinary sessions get byte-identical text.
    • Native execution fixes and Writer routing are untouched. There are no schema or event changes, and nothing in issue links or backfill (#451 step 4: Move thread issue links onto upstream thread.issues #455).

    Checks (all through agent-heavy)

    Integration pass (Replay provider, isolated dev server, seeding off)

    • Start and queued work: a message sent during a running turn was queued and ran afterwards.
    • Question: answered in the UI, and the turn completed.
    • Cancel: "Stop generation" left the thread interrupted.
    • Restart: I stopped my dev server by its PIDs with a turn running and a follow-up queued. After restarting, the thread showed the turn cancelled by shutdown, then resumed, and the queued follow-up ran.
    • Sibling completion and delegated-result recovery: not reachable. The Replay provider only replays recorded output and never calls T3's tools, so it can't start delegated children; managed work also needs Codex or Claude. Step 3's committed-event fixture tests cover these instead. A real pass would need a paid Haiku run.
    • Browser view: the browser tab was hidden and produced no screenshots, so I read the page text and used the t3 thread show command instead.
    • Cleanup: the dev server is stopped by its PIDs and the browser tab is closed.

    The PR body has the before/after numstat against 7d32075e37 (and against the latest sync, b387e3a179) and the residual-hunk ledger. Against 7d32075e37, the MCP service went from +455 to +415 lines, the Codex adapter from +529 to +523, and the Claude adapter from +1032 to +1030. Orchestrator, EffectWorker and ProjectionStore are unchanged. Issue #436's text also asks for the numstat and ledger to be posted on #418; I haven't posted them there.

    PR #475, head 6c57ff4, checks and reviews none reported yet (draft, not merged).

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions