BtwOperation(
self,
model: str | BaseChatModel,
system_prompt: str,
environ: | Name | Type | Description |
|---|---|---|
model* | str | BaseChatModel | Workspace bootstrap model. |
system_prompt* | str | Base instructions for a thread without a live snapshot. |
environ* | Mapping[str, str] | None | |
instruction_middleware | Sequence[MemoryMiddleware | SkillsMiddleware] | Default: () |
profile_overrides | dict[str, object] | None | Default: None |
| Name | Type |
|---|---|
| model | str | BaseChatModel |
| system_prompt | str |
| environ | Mapping[str, str] | None |
| instruction_middleware | Sequence[MemoryMiddleware | SkillsMiddleware] |
| profile_overrides | dict[str, object] | None |
Capture effective main-call context and answer tool-free side questions.
Register after middleware that modifies the model, prompt, or settings,
including extensions. ConfigurableModelMiddleware resolves the model
early, before memory, skills, and local context enrich the prompt. Those
downstream request overrides are not returned to it with the response.
Resume and cost hooks inspect state and responses rather than the complete
model request, so neither supplies this capture point.
This separate hook snapshots the resolved request before calling the model,
allowing /btw to use it while the main response is still streaming. Main
calls also checkpoint effective instructions and generation settings on
success for use after restart or eviction. answer invokes the model without
running the agent or writing conversation state; when saved instructions are absent,
it reuses the main agent's memory and skill loaders on a local state copy.
Workspace environment for lazy model resolution.
Main agent memory and skill loaders, in order.
Session profile fields to retain during reconstruction.