feat(mcp): defer thread organization safely - #8683
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Warning Your free Security trial is over. An organization admin can activate Security or dismiss this notice. Comment |
There was a problem hiding this comment.
One finding on startup reconciliation isolation in apps/server/src/orchestration-v2/Orchestrator.ts.
Posted via Macroscope — Effect Service Conventions
Thread transfer impact
This comment will update automatically after the next completed run. |
271e82b to
858c15a
Compare
There was a problem hiding this comment.
Effect service conventions review: one finding in apps/server/src/orchestration-v2/Orchestrator.ts (startup reconciliation isolation/retry). Everything else in the changed scope follows the surrounding service, layer, and import conventions.
Posted via Macroscope — Effect Service Conventions
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This change adds a durable MCP-driven workflow that can automatically settle or archive threads after run completion, with startup recovery and provider-session/cleanup side effects. The orchestration and lifecycle changes span multiple production layers and are broader than a small self-contained addition. You can add or adjust custom eligibility rules. Learn more. |
acb2b17 to
4bf9020
Compare
There was a problem hiding this comment.
One finding on the new deferred-organization startup recovery loop in apps/server/src/orchestration-v2/Orchestrator.ts. Per-thread isolation is now in place; the remaining gap is interruption handling and transient retry before readiness.
Posted via Macroscope — Effect Service Conventions
afd33ef to
a887160
Compare
284b9dc to
cf20d21
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Bugbot Autofix is ON, but a cloud agent failed to start.
Reviewed by Cursor Bugbot for commit cf20d21. Configure here.
cf20d21 to
71650ee
Compare
71650ee to
6ff0395
Compare
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
|
Superseded as the active MCP proposal by #10554 for immediate organization only in the rebuilt MCP stack, following the maintainer request to review thin service wrappers separately from service hardening. This is not a full feature-parity replacement. Durable deferred organization is parked as separate service/feature work. It is not included in the thin MCP wrapper. Closing this mixed proposal without merging. The remote branch |

An active agent cannot safely settle or archive its own thread because ordinary organization commands correctly reject active work.
This dependent layer adds durable run-bound organization intents and
t3_thread_defer_organizationoperations to schedule settlement or archival, inspect the current intent, and cancel it. The terminal path applies an intent only after its bound run finishes successfully and no newer, queued, active, pending-request, or title-regeneration work exists. Unsafe or stale intents clear without consuming an internal apply command receipt.Stable receipts make retries deterministic. Projection rebuilds preserve intent state, terminal apply delegates to ordinary serialized settle/archive behavior, queued-run promotion survives typed apply failures, and startup recovery retries one transient typed plan failure while preserving interruption and isolating persistent failures.
Focused validation:
vp run --filter t3 typecheckvp run --filter @t3tools/contracts typecheckvp run --filter @t3tools/shared typecheckvp lint,vp fmt --check, andgit diff --checkDepends on #8676 for thread organization discovery and lifecycle mutations. Native stack: #8676 → #8683, rooted on
t3code/codex-turn-mappingat415ed0f73b97f1655b6282492f81d0b2bba3a9cc.Implemented by GPT-5.6-Sol via Codex in T3 Code.
Note
Add
t3_thread_defer_organizationMCP tool and server-side apply recoverydispatchDeferredOrganizationin Orchestrator.ts handling defer, cancel, and apply commands. Terminal run events now trigger locked deferred-organization application; startup recovery scans persisted thread shells and applies eligible intents whose bound run is missing, superseded, or terminal.OrchestrationV2ClientCommand.recoverDeferredOrganizationinto the live orchestrator service and the server startup recovery phase in serverRuntimeStartup.ts, running it after provider runtime recovery succeeds.clearDeferredOrganizationflag that nullsdeferredOrganizationon the committed thread payload; the emitted event uses the post-clear thread value, so any consumer reading the event payload for deferred state will see null after cleanup.Macroscope summarized 6ff0395.