Skip to content

feat(run): support pre-allocated session IDs#235

Open
ramparte wants to merge 1 commit into
mainfrom
feat/cli-session-id
Open

feat(run): support pre-allocated session IDs#235
ramparte wants to merge 1 commit into
mainfrom
feat/cli-session-id

Conversation

@ramparte

Copy link
Copy Markdown
Contributor

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.
ID=$(amplifier session new)
amplifier run --session-id "$ID" "your prompt"

How

  • New --session-id Click option on run. The whole downstream chain already accepts a session_id (interactive_chat/execute_singleSessionConfigcreate_initialized_session, which already does config.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-id is rejected together with --resume (which already selects the session to continue) with a clear error.
  • New session new subcommand prints uuid.uuid4().

Tests

tests/test_run_session_id_flag.py (4 tests, all passing):

  • --session-id X launches the new session with exactly that id
  • omitting it mints a valid UUID4
  • --session-id + --resume is rejected before launch
  • session new prints a single parseable UUID

Scope is strictly additive; no behavior change when the flag is omitted.

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant