feat(coding-agent): run the built-in tools on a runtime without a session (RT10-pre)
Summary
A runtime built by bootstrapRuntime() without a sessionManager now runs the built-in tools. Before this change it could not: the runtime got an implicit in-memory session manager with no loop bound, so every wrapped tool failed in runner.getActiveTools() ("Extension runtime not initialized"). With that fixed, read and bash still read loop-side context members (ctx.model, the session environment).
src/core/runtime/bootstrap.ts: with nosessionManager, the runner is session-less (the #5223 shape: runtime context only, loop-side members refused by name, no active tools reported). The built-inreadis built withcontextModel: falseandbashwithexposeSessionEnvironment: false(an existing option): a runtime without a session has no model and no session state to read.src/core/tools/read.ts: newReadToolOptions.contextModel(defaulttrue). Whenfalse,readdoes not readctx.model: no model-specific image note, and the resize profile falls back toresizeOptions, exactly as it already does when no context is passed.
Part of #5413.
Inertness
No product path changes. AgentSession._buildRuntime is the one production caller of bootstrapRuntime() and always passes its own sessionManager, so every session (TUI, print, RPC, desktop) builds exactly the same read and bash definitions as before (contextModel unset → true; exposeSessionEnvironment unset → true). The session-less path is used by nothing yet; its first caller is the loopless runtime in the stacked follow-up.
Tests (run on a Linux host at the exact head 9fd81b75d1)
test/runtime/sessionless-builtin-tools.test.ts(new):- without a session:
readreads a text file;readreturns an image with no model-specific note;bashruns with noPI_SESSION_ID/PI_PROVIDER/PI_MODEL. - in a session (Z1 pin, passes before and after):
readstill adds the non-vision note for a text-only model;bashstill exposes the session id, provider and model.
- without a session:
- RED at the base (
bootstrap.ts,read.tsreset toorigin/main): the three session-less cases fail. - GREEN: the new file passes. Owner suites unchanged and green:
test/runtime/{bootstrap-registry,context-split}.test.ts,test/sdk-session-manager.test.ts,test/agent-session-dynamic-tools.test.ts,test/block-images.test.ts,test/image-resize-callers.test.ts,test/suite/bash-browser-engine-env.test.ts,test/suite/bash-output-redaction.test.ts,test/anthropic-subscription-tools.test.ts,test/read-summary-parity.test.ts,test/bash-prompt-snippet.test.ts,test/filesystem-policy.test.ts. bun run check: green.
KILL
None: no durable write and no ToolHost state transition.
Dead code
None made dead (SessionManager in bootstrap.ts becomes a type-only import).
Summary by cubic
Lets a runtime built by bootstrapRuntime() without a sessionManager run the built-in read and bash tools. Previously the runtime got an implicit in-memory session manager with no loop bound, so every tool failed on getActiveTools().
The session-less runner now reports no active tools. read gains a contextModel option (default true), which session-less builds set to false so the tool stops reading ctx.model; bash is built with exposeSessionEnvironment: false. No product path changes: AgentSession._buildRuntime is the only production caller and always passes a session manager, so session behavior is identical.
Part of #5413.