Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add a host-managed wait tool for Codex sessions #4262

ClosedJules-Astier(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/4262/headopened View on GitHub

What Changed

  • Register a namespaced t3.wait dynamic tool on new Codex threads.
  • Run waits in the T3 server for 1 second through 1 hour, without periodic model inference.
  • Cancel outstanding waits before turn interruption and when the provider session closes, including calls that race with cancellation.
  • Decode the experimental raw thread/start response at the same boundary used by typed requests.
  • Document the live-session contract and a separate follow-up architecture for durable timer/webhook resumes in docs/project/deferred-thread-resume.md.

The existing Codex adapter and web timeline already normalize and render dynamic-tool lifecycle items, so this does not add a parallel UI state.

Why

Agents currently monitor long-running commands, CI, deployments, and review work by repeatedly polling. Most checks contain no new information but still wake the model and consume inference. This gives T3 a focused host-owned primitive that keeps the current tool call open until a bounded timer expires.

This PR intentionally does not claim durable wake-up semantics. Restart-safe timers, external triggers, and PR webhooks need persisted waitpoints, idempotent delivery, and an explicit waiting lifecycle; those are designed in the included project doc as follow-up work.

Testing

  • vp test run apps/server/src/provider/Layers/CodexDynamicTools.test.ts apps/server/src/provider/Layers/CodexSessionRuntime.test.ts — 28 passed
  • vp run --filter t3 typecheck — passed (three existing Effect suggestions in orchestration/decider.ts)
  • Targeted vp lint, vp fmt --check, and git diff --check — passed
  • Live ephemeral smoke turn with codex-cli 0.144.6 — one t3.wait call, 1,006 ms elapsed, completed turn, expected assistant sentinel
  • Macroscope correctness and Effect service convention checks — passed after addressing the cancellation-registration race

Checklist

  • This PR is small and focused
  • I explained what changed and why
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 3a84ea43-e5bf-4263-9727-3fe0cdd5f85a

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Closing in favor of #2829 (orchestration V2).

      #2829 ships an equivalent capability natively — its MCP orchestrator toolkit (apps/server/src/mcp/toolkits/orchestrator/) already exposes delegate_task, create_threads, t3_thread_start/list/read/send/wait/interrupt and schedule_task, so this PR's parallel implementation would land as a competing surface on a base that no longer exists in the same shape.

      If there's a capability here that the V2 toolkit doesn't cover, please rebase onto main after #2829 merges and reopen — I'd rather extend the shipped toolkit than run two.

    4. juliusmarminge closed this

Sign in to join this conversation.