feat(run): support pre-allocated session IDs#235
Open
ramparte wants to merge 1 commit into
Open
Conversation
Add a --session-id option to the run command so a caller-supplied id is used for a new session instead of a freshly minted UUID, and add an 'amplifier session new' subcommand that prints a fresh UUID for pre-allocation. --session-id is rejected together with --resume (which already selects the session to continue). ID=$(amplifier session new) amplifier run --session-id "$ID" "your prompt"
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.
What
Adds the ability to pre-allocate a session ID and pass it in when launching amplifier.
amplifier session new— prints a fresh UUID for pre-allocation.amplifier run --session-id <id>— uses the caller-supplied id for a new session instead of minting one.How
--session-idClick option onrun. The whole downstream chain already accepts asession_id(interactive_chat/execute_single→SessionConfig→create_initialized_session, which already doesconfig.session_id or uuid4()), so this only wires the flag to the two new-session UUID mint sites:session_id = session_id or str(uuid.uuid4()).--session-idis rejected together with--resume(which already selects the session to continue) with a clear error.session newsubcommand printsuuid.uuid4().Tests
tests/test_run_session_id_flag.py(4 tests, all passing):--session-id Xlaunches the new session with exactly that id--session-id+--resumeis rejected before launchsession newprints a single parseable UUIDScope is strictly additive; no behavior change when the flag is omitted.