Add threads send with configurable busy-thread injection - #2
Open
jarekbird wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
t3code threads send --thread-id <id>so scripts can continue an existing T3 conversation or inject context into active work. Previously the CLI always created a fresh thread. The command accepts exactly one of--prompt,--prompt-file, or--stdin, plus--open,--dry-run, and--if-busy reject|inject.--if-busy reject(default) returnsTHREAD_BUSYwithout dispatching when a turn is active or pending.--if-busy injectsends immediately even when busy, allowing T3 and its provider to incorporate the prompt into active work. It does not introduce a CLI queue or send an interrupt command.Only
thread.turn.startis dispatched. The existing thread's model/provider options, workspace, title, permissions, and interaction mode are preserved; creation defaults do not override the target. Missing, deleted, and archived targets still fail explicitly in either mode. Dispatch failure never deletes the existing thread. Temporary authentication uses the existing issue/revoke lifecycle.Validation:
pnpm check: typecheck, all 41 tests, and build pass. On the live host, ran withT3CODE_HOMEunset because the existing config-defaults test assumes no environment override.THREAD_BUSY; injection dry-run did not dispatch; explicit injection changed the requested final response. The agent returned the injected marker in the same active turn ID, with the message visible in the existing conversation. A transient auth CLI failure during status polling was followed by a successful read confirming completion.Reject-mode busy detection is a snapshot preflight, not an atomic lock; concurrent callers must serialize requests when that matters. Injection behavior can differ by provider and turn type. Success reports dispatch acceptance rather than agent completion; downstream failures remain possible. These limits and ambiguous-retry behavior are documented. A full T3 server restart was not part of the live test.