When auto-retry fires after a retryable error (e.g. overloaded_error) and the
retry response includes tool_use, session.prompt() returned prematurely because
_resolveRetry() was called on the first successful message_end — while the
agent loop was still executing tools via the fire-and-forget agent.continue().
This caused callers to observe isStreaming=true after prompt() returned, and
follow-up session.prompt() calls threw 'Agent is already processing'. The
tool execution results were silently lost.
Fix: move _resolveRetry() from the message_end handler to the agent_end
handler. The _retryAttempt counter reset stays on message_end (preventing
accumulation across LLM calls within a turn), but the promise that unblocks
waitForRetry() now only resolves when the full agent loop completes.
After updating models.json, the scoped model selector still shows the
old values when opened. Switching to the "all" scope, however, shows
updated model definitions.
`registerApiProvider()` gets wiped by `resetApiProviders()` during
session reload, replacing the Bun-bundled Bedrock provider with the
opaque lazy loader that cannot resolve inside the binary.
`setBedrockProviderModule()` sets an override that survives resets.
When running inside a sandbox (e.g., bubblewrap) that blocks access
to the tmux socket, the tmux query hangs and times out, returning
undefined. Previously this was treated as "extended-keys is off",
showing a false warning. Now we skip the warning when the tmux server
can't be reached.
Use pipeline() instead of finished(readable.pipe(writable)) so stream
errors from abort signals are caught as promise rejections. Increase
download timeout from 10s to 120s for multi-MB archives.
closes#2066
* feat(session-manager): allow supplying custom session ID in newSession()
Add optional `id` field to `NewSessionOptions`. When provided, this ID
is used as the session ID instead of generating a random UUID. Existing
callers are unaffected since the field is optional and falls back to
`randomUUID()`.
Closes#2097
* test(session-manager): add tests for custom session ID in newSession()
Verify that newSession() uses the provided id when supplied, falls back
to randomUUID() when omitted, and includes the custom id in the session
header.
The _isRetryableError() regex used literal spaces ("server error",
"internal error") but Codex SSE error events use underscores
("server_error"). Change to .? so both space and underscore (and
direct concatenation) are matched, enabling automatic retry on
transient Codex SSE errors.
fixes#2091