| name | imposter-newsession |
| description | Mint a synthetic session id on the SmoothLlmImposter router and map it to the current caller session, so subsequent forwarded requests are stamped with the proxy-owned id instead of the caller's. Use when the user says "mint a new imposter session", "rotate my upstream session", "start a new opencode-go session through the imposter", or `/imposter-newsession`. Requires a resolvable caller session id (passed via `--session`). Works around the streaming-harness limitation that silently bypasses the in-band `--newsession` switch (LADR-05). |
| allowed-tools | ["Bash(.agents/skills/imposter-newsession/scripts/imposter-newsession.sh:*)","Bash(${CLAUDE_PLUGIN_ROOT}/.agents/skills/imposter-newsession/scripts/imposter-newsession.sh:*)","Bash(curl:*)"] |
| models | {"claude":"haiku","copilot":"gpt-5.4-mini","codex":"gpt-5.4-mini"} |
Imposter New Session
Mint a synthetic session id on the SmoothLlmImposter router and store a caller to synthetic mapping in its in-memory translation dictionary. After minting, subsequent forwarded requests carrying the same caller session id are translated to the synthetic id before reaching the upstream. This lets upstreams that group traffic by session see a proxy-owned id without the caller coordinating a long-lived secret.
Why a skill instead of just typing --newsession?
Same reason as imposter-who: agent harnesses stream by default, the router refuses to synthesize --newsession replies on streaming requests (LADR-05), and the switch silently forwards to the upstream instead of minting. This skill issues a non-streaming curl so the short-circuit fires.
Prerequisite
--newsession needs a resolvable caller session id. The router's SessionIdentityResolver reads it from:
- OpenAI dialect: the body
session_id field.
- Anthropic dialect: the
session_id header.
Pass that id via --session id. Without it, --newsession is a no-match and the router forwards normally (this is by design — --newsession is never an error, just a no-op when identity cannot be resolved).
Workflow
- Identify the caller session id the harness is currently sending. If unknown, run
imposter-who first with --session candidate and check the session: field of the reply.
- Run the mint script:
.agents/skills/imposter-newsession/scripts/imposter-newsession.sh \
--session caller-id --model gpt-5.5
For an Anthropic dialect:
.agents/skills/imposter-newsession/scripts/imposter-newsession.sh \
--session caller-id --dialect anthropic --model claude-sonnet-4-6
- Interpret the reply:
Session: caller-id → 32-char-hex-guid
The caller id is now mapped to the synthetic id. Forwards carrying the caller id will stamp the synthetic id upstream when the route has SessionForwarding opted in (HLD 009).
- Verify the mapping took by re-running
imposter-who with the same --session:
.agents/skills/imposter-who/scripts/imposter-who.sh --session caller-id --model gpt-5.5
The session: field should now show the synthetic id, not null.
Script
scripts/imposter-newsession.sh — takes --dialect, --model, --session, --base-url. --session is required. Derives the dialect from OPENAI_BASE_URL / ANTHROPIC_BASE_URL when not forced. No API key is required: the router resolves upstream credentials from its own config.
Exit codes: 0 mint succeeded, Session: ... -> ... printed; 1 router did not short-circuit (feature disabled, caller session not resolved, or unexpected response); 2 env/curl failure.
--port N overrides the port in the resolved base URL (it replaces the :<port> authority in OPENAI_BASE_URL / ANTHROPIC_BASE_URL).
Notes
- The mapping lives in-router process memory only (HLD 010, LADR-06). It does not survive a router restart.
- The mint is idempotent: re-running with the same caller id reuses the existing synthetic id (logged as "reused existing", not "newly inserted").
- The synthetic id is a 32-char hex Guid (no prefix) generated by the router; it is returned in the
Session: reply and surfaced in subsequent --who? probes.