Repository navigation
Replies: 1 comment
|
Would maintainers approve a smaller first step here: a read-only After losing a dispatch response, an external client needs to know whether T3 committed the original command. The proposed lookup accepts a thread ID and command ID, uses the existing command receipt store and This differs from the broader conditional-delivery proposal above. It adds no idle precondition, provider admission guarantee, delivery queue, database migration, HTTP endpoint or MCP wrapper. It also does not fix the credential-dependent retry namespace reported in #16184. A reference candidate is available in this fork PR, against current V2 source. It passes 31 focused tests, contracts and server typechecks, and scoped lint with six unchanged baseline warnings. An isolated loopback server also passed nine checks through the production WebSocket route, real authentication/session storage, full RPC handler registration, JSON encoding and receipt repository. Unrelated services were model-free mocks and the database was in memory. The complete application startup, packaged build, Windows runtime and full test suite have not been qualified. The candidate has not been deployed. Would you approve this direction and scope for a focused upstream PR, or is there already a supported receipt lookup that external clients should use? Upstream PR submission remains held pending explicit maintainer approval. |
Uh oh!
There was an error while loading. Please reload this page.
External orchestration clients can already observe T3 threads with
orchestration.subscribeShelland submit provider-neutralthread.turn.startcommands. There are two gaps when a client needs to deliver work after a thread becomes quiet without risking a duplicate provider prompt:thread.turn.startis decided. Another client can start a turn in that window.A concrete example is an external job watcher that wants to wake a thread once, after CI finishes. It can keep its own queue, but it still needs an atomic “start only if idle” operation and enough durable outcome information to decide whether retrying is safe.
Relationship to existing work
T3's current architecture is already the right provider-neutral foundation: orchestration records intent and state, while provider-specific behavior stays in adapters.
#7240 directly addresses the product-level queue: persist
after-currentmessages in T3, show and cancel them in clients, then dispatch them across providers. Itsqueued->handoffboundary and conservative restart handling solve much of the same user problem.This proposal asks whether a smaller lower-level contract is also useful, either underneath #7240 or for authenticated external clients that own their own queue. It does not propose another T3 queue or UI.
subscribeShellremains the state stream, and the broader SDK question belongs in #6977.Smallest useful semantics
Conditional start
Add an optional
onlyIfIdle: truetothread.turn.start, advertised by an environment capability because an older server may ignore an unknown optional field.The serialized orchestration decision rejects a busy thread atomically, before appending the user message or a command receipt. The same command/message IDs can then be retried after a later shell event. Ordinary starts keep their current behavior.
“Idle” should include the durable turn/session state and blockers such as pending approval or user input. The provider boundary needs a final per-thread admission check so ordinary input cannot slip between the decision and provider send.
Delivery outcome
For accepted conditional starts, persist a record keyed by command ID:
accepted: orchestration events are durable; provider not calledattempted: marker committed immediately before the provider callstarted: adapter returned a correlated provider turn ID and that transition persistedfailed: proven pre-attempt failureunresolved: provider was attempted but the outcome is unknownabandoned: an operator explicitly closed an unresolved record without claiming it was not deliveredOn restart, re-drive
acceptedrecords with the same IDs. Convert pre-bootattemptedrecords tounresolvedand never resend them automatically. This is deliberately at-most-once at the provider boundary; it does not claim exactly-once model execution.Targeted interrupt
Preserve and enforce the existing optional
thread.turn.interrupttarget turn ID end to end. Check it when deciding the command, immediately before provider contact, and at provider-specific fallback boundaries. If the turn ended or a successor started, reject or no-op rather than interrupting the successor. The reference strengthens the current partial stale-turn checks; it does not introduce the field itself.Reference implementation and limits
I built this against T3 Code 0.0.40 as a design probe:
09e8de9c655aThe shared command, persistence, recovery, HTTP, and capability shapes are provider-neutral. The reference only enables conditional delivery for Codex and Claude, where the provider admission boundary was verified; other adapters would need explicit support before advertising the guarantee. It includes focused tests for back-to-back admission, restart recovery, lost provider responses, failed persistence, exact-target interruption, and HTTP wire behavior. A local isolated server smoke test exercised conditional Claude delivery and command-to-turn correlation.
The branch is about 2,800 added lines including tests, so I am not opening it as an unsolicited PR. FAR-specific program routing, mailboxes, research ledgers, and notification policy remain outside T3.
Questions
onlyIfIdleadmission, with delivery records and targeted interrupt split into later work?startedadmission receipt?All reactions