Widget Agent¶
caliper-agent in its widget role works on one panel, selection, dropped file or property, using the person's own provider key or a local model, and its changes wait in a preview for the person to accept.
| Field | Value |
|---|---|
| ID | AGT-05 |
| Status | Shipped |
| Scope | Supporting |
| Pillar | Agents and Automation |
| Sprint | None |
| Depends On | Caliper API v0 (AGT-01) |
| Unblocks | Local Models in the Side Chat (AGT-04)Ollama Preset on First Run ( AGT-07)Empty Arguments as Omitted ( AGT-08)Agent Packaging with a Bundled Python ( AGT-10)Widget Agent Conformance Suite ( AGT-14)Provider Presets ( AGT-15)Ask in Chat ( AGT-18)Source Edit Previews ( AGT-29)Builder Agents on Windows ( PLT-13) |
| Docs | Widget Agent |
| Branches | None |
| Design | Widget agent |
Coverage Ledger¶
- Branch
sprint3, 0 commits that main lacks (82 ahead of the merge base). Work on the sprint 3 integration of the builder, side chat and widget agent, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-agent, 0 commits that main lacks (66 ahead of the merge base). Work on the BYOK widget agent and its end-to-end test on the real command layer, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-int-inline, 0 commits that main lacks (238 ahead of the merge base). Work on the inline surface of the widget agent, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-int-models, 0 commits that main lacks (232 ahead of the merge base). Work on the setup guide to the built settings and models, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-int-pr2fix, 0 commits that main lacks (7 ahead of the merge base). Work on a fix of the widget agent settings, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-int-quitfix, 0 commits that main lacks (229 ahead of the merge base). Work on the inline surface forgetting its preview, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-int-widget, 0 commits that main lacks (109 ahead of the merge base). Work on widget field matching, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-integration-pre-rebase, 0 commits that main lacks (226 ahead of the merge base). Work on the sprint 3 integration before a rebase, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-pydantic-ai, 0 commits that main lacks (82 ahead of the merge base). Work on Pydantic AI as the widget agent framework, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-roles, 0 commits that main lacks (73 ahead of the merge base). Work on naming the side chat and the widget agent, which reached main through a pull request (patch ids and subjects match). - Branch
sprint3-int-docs, 1 commit, 91ce803a. A WIP commit that rewrites the walk-through README with steps 2 and 6 from their dry runs and fixes stale lines in the builder overview. It lists what was not done: docs pages, the overview rows for the cmdk, chat and live work, the roadmap and a PR3.md. - design/acp-integration.md, under One client for both roles. One AcpClient drives both the person's own agent in the side chat and the widget agent's sidecar, with the key only in the environment.
- design/acp-integration.md, under Approvals and diffs for every agent. One card for one change: caliper-agent reads review.status once per turn and asks through ACP only for what Caliper does not review itself.
- design/acp-integration.md, under Local models in the side chat. A measured run of caliper-agent in its general role on the Ollama preset in the hidden app, 7 model requests in about 80 seconds.
- design/applet-builder.md, under What would need to change. 6. The agent: command layer over MCP first, then ACP, then a built-in agent only if needed.
- design/applet-builder.md, under Agent integration. MCP, ACP and BYOK answer three questions; the builder needs MCP in every case.
- design/applet-builder.md, under The options. Comparison table: MCP only, ACP client in Caliper, built-in agent (BYOK).
- design/applet-builder.md, under Order. Order: MCP first, ACP second as the main in-app path, a built-in BYOK agent only if needed.
- design/builder-overview.md, under Builder overview. The map of the builder: drop data, make loaders, build visuals by hand, with the side chat, the widget agent or an outside agent; everything built is data.
- design/builder-overview.md, under The parts. Parts diagram and table: spec format, loaders, catalog, command layer, session, caliper-mcp, side chat, widget agent, caliper-agent.
- design/builder-overview.md, under The parts. The side chat and widget agent are two roles over one AcpClient, and Ask in chat hands a widget request to the side chat.
- design/builder-overview.md, under What is built. Stacked previews, applied to a copy of the spec and committed as one undo step.
- design/builder-overview.md, under What is built. AcpClient::new_session() takes an optional _meta for widget sessions.
- design/builder-overview.md, under What is built. caliper-agent runs on Pydantic AI with Claude native and other models over an OpenAI-compatible API, and widget sessions with a tool scope, budget and handoff.
- design/builder-overview.md, under What is built. The widget agent's inline surface: Cmd-K on the spec page, preview in place, accept as one undo step.
- design/builder-overview.md, under The integration order after sprint 2. Item 9: stacked previews in the session.
- design/builder-overview.md, under The integration order after sprint 2. Item 10: an optional _meta argument on AcpClient::new_session().
- design/builder-overview.md, under The integration order after sprint 2. Item 11: evaluation of the ACP Python SDK; the hand-written agent side stays.
- design/builder-overview.md, under The integration order after sprint 2. Item 12: widget sessions in the sidecar.
- design/builder-overview.md, under The integration order after sprint 2. Item 13: the context bundle for a target.
- design/builder-overview.md, under The integration order after sprint 2. Item 14: the widget agent's inline surface with selection, dropped-file and property entry points; packaging caliper-agent with a Python runtime is moved to sprint 5.
- design/builder-overview.md, under The integration order after sprint 2. Item 15: Pydantic AI adopted as the provider layer.
- design/builder-overview.md, under The integration order after sprint 2. Item 16: the capability probe and its cache.
- design/builder-overview.md, under The integration order after sprint 2. Item 17: presets, one key per provider and the widget agent's settings.
- design/builder-overview.md, under The integration order after sprint 2. Item 18: the provider conformance suite, caliper-agent-conformance.
- design/builder-overview.md, under Acceptance. Acceptance: drop Parquet and safetensors, build the dashboard four ways, save as a spec applet, open in the browser viewer, entropy from the side chat on a live stream, both roles on local models.
- design/builder-overview.md, under Decisions. Cross-cutting decisions: everything built is data; text is the source of truth; one command table; two roles; Claude native API and others through OpenAI-compatible API; local models; keys; nothing bundled; loopback only.
- design/builder-pane.md, under What is built and what is left. While the inline prompt is open or a preview is shown, no panel offers removal, so the person accepts or rejects first.
- design/builder-pane.md, under The pane on the spec page. An approved agent edit, a command-K Accept and a hand edit share one history, so Undo takes back whichever came last.
- design/builder-session.md, under Stacked previews. The session keeps each preview as a refreshed copy of the open spec, with limits, expiry and preview.commit returning follow-ups.
- design/builder-session.md, under Changes to the contracts and to the earlier pages. Fixes to contracts section 8, the command layer page and the widget agent page: agent origin for the sidecar, diff and applied, preview and review, and the replacement of planned Session calls by preview commands.
- design/byok-agent.md, under The shape. caliper-agent is a Python sidecar speaking ACP as an agent, running Caliper's loop on Pydantic AI, reaching the command layer only through Caliper API.
- design/byok-agent.md, under Starting the sidecar. The sidecar starts as python -I -m caliper_agent with options for preset, provider, base URL, model, effort, capability overrides, cache folder, scopes, tools, compaction, widget requests and a usage log.
- design/byok-agent.md, under ACP, agent side. The sidecar's ACP methods: initialize, session/new, set_config_option, prompt, cancel, close, with limits of 16 sessions and 8 MiB lines.
- design/byok-agent.md, under Config options. Config options model, effort and review, not modes.
- design/byok-agent.md, under What the client receives. Session updates and statuses sent as thoughts with _meta.caliper.status (retry, refusal, compaction, strict_off, limit, no_tools, no_vision).
- design/byok-agent.md, under Stop reasons. Mapping of model stop reasons to ACP stop reasons and error codes of failed turns.
- design/byok-agent.md, under Tools. Tools generated from the command descriptor table with reversible names, stripped schemas, up to 20 strict tools, and agent-disallowed commands left out.
- design/byok-agent.md, under Tools. Tool schemas that carry a type list are sent as anyOf; nullable values in the command table remain an open question for caliper-mcp.
- design/byok-agent.md, under Widget sessions. Widget sessions in the sidecar: _meta.caliper.widget, scoped tools, the preview header, widget prompt, budget, handoff tool and answer metadata.
- design/byok-agent.md, under Widget sessions. Tool calls go through Caliper API with origin agent and a per-turn group so a prompt's edits undo as one step.
- design/byok-agent.md, under The loop. The loop runs on Pydantic AI's agent graph step by step, with sequential tool calls, an append-only history, and cancellation with a result for every call.
- design/byok-agent.md, under Approval and spec diffs. The general role asks with session/request_permission for destructive commands and previewable edits, after a dry-run diff, unless Caliper reviews them itself.
- design/byok-agent.md, under The system prompt. One fixed system prompt for the general role and a shorter fixed prompt for widget sessions.
- design/byok-agent.md, under Claude API settings and why. Claude settings: native Anthropic provider, adaptive summarized thinking, effort set on every request, strict tools, caching and compaction, with no fallbacks or sampling parameters.
- design/byok-agent.md, under Claude API settings and why. One default effort, high, for every model in the general role.
- design/byok-agent.md, under Prompt caching and how it is verified. Prompt caching of the tools and system prompt, verified in tests and with a real key through the usage log.
- design/byok-agent.md, under Prompt caching and how it is verified. Per-message effort, a beta, is left for later.
- design/byok-agent.md, under Refusals. A refusal ends the turn, removes the prompt and later messages from the history, and shows a neutral message with three ways forward.
- design/byok-agent.md, under Refusals. Server-side refusal fallbacks are off behind one switch until Pydantic AI keeps the reply's fallback block.
- design/byok-agent.md, under Errors and retries. Errors are sorted into auth, quota, bad request and retryable classes; retries run through the on_model_request_error hook with up to five attempts.
- design/byok-agent.md, under Compaction and long sessions. Server-side compaction at 150,000 tokens is on by default and --no-compaction turns it off.
- design/byok-agent.md, under Checked against the protocol's schema. Every message the sidecar sends was validated against ACP's v1 schema, and the check is now a test.
- design/byok-agent.md, under The six checks. The spike's six checks, cancellation, retry state, Claude features, stop reasons, other models and footprint, each pinned by a test.
- design/byok-agent.md, under Ollama's own chat API and the context length. The Ollama preset uses Ollama's native chat API with a context length of 16,384 tokens for the widget role and 32,768 for the general role, no silent truncation and a context cache note.
- design/byok-agent.md, under One run on a local model. One manual run of the dashboard prompt on a local model through the OpenAI-compatible route, 135 seconds.
- design/byok-agent.md, under The ACP Python SDK. The official ACP Python SDK is used in tests only, and the hand-written agent side stays.
- design/byok-agent.md, under Security notes for the later security pass. Security notes: fixed hosts, the test and offline switches, the import path, prompt injection, what leaves the machine, key in memory, logging, supply chain and limits.
- design/byok-agent.md, under Tests. Tests of the sidecar run offline with a scripted model, a stubbed Claude transport and fake servers, under ctest as builder_agent_py and related entries.
- design/byok-agent.md, under The manual check. The manual check with a real key through caliper-acp-harness; it was not run on this branch.
- design/byok-agent.md, under The manual check in the app. The manual check in the app with a real Claude key and with a local Ollama model, covering settings, probe, address warnings, Shared GPU and command-K.
- design/byok-agent.md, under What is built and what waits. What is built: the sidecar modules, the package, the key store, presets, widget sessions, conformance suite and tests.
- design/byok-agent.md, under What is built and what waits. Waits: status lines from _meta.caliper.status shown in the app.
- design/byok-agent.md, under What is built and what waits. Waits: server-side refusal fallbacks.
- design/byok-agent.md, under What is built and what waits. Waits: per-message effort and context editing for old captures, both betas.
- design/byok-agent.md, under What is built and what waits. Waits: session/load in the sidecar.
- design/byok-agent.md, under Decisions. Decisions of the sidecar: a Python process speaking ACP, the loop on Pydantic AI, tools from the table, config options, statuses as thoughts, approval rules, refusal handling, the key read once, scrubbing at every exit, widget sessions in one process, and the handoff tool.
- design/byok-agent.md, under Notes on the contracts. Notes on the contracts: the agent origin over Caliper API, two approvals merged, fallbacks off, and other providers through Pydantic AI instead of each vendor's SDK.
- design/command-layer.md, under What is built and what is planned. The builder session builds the review of spec edits for the origins agent and mcp and stacked previews on these.
- design/command-layer.md, under preview. Stacked previews: preview.begin, preview.diff, preview.commit and preview.discard, with bounds of 16 previews, 64 edits and a 30 minute idle drop; only ui and builder may commit.
- design/command-layer.md, under Who they govern. Modes govern the side chat's agent (origin agent with client chat) and caliper-mcp's clients; the widget agent keeps its preview with Accept.
- design/command-layer.md, under caliper-mcp and the Python sidecar. The descriptor table is the one source of tool definitions for caliper-mcp and for the widget agent's sidecar, with tool names that replace the dot by an underscore.
- design/roadmap.md, under Phase 3: agent-built panels. Drop data in, make loaders, build visuals by hand in a builder pane, with the side chat, the widget agent, or an outside agent over MCP; everything built is data.
- design/roadmap.md, under Phase 3: agent-built panels. The parts: command layer, loaders, catalog, spec format with seven primitives, spec applet kind, caliper-mcp, side chat, widget agent.
- design/spec-format.md, under The spec runtime. Seams for the pages (draw into any area, set_preview, set_overlay) that the builder pane and the widget agent use.
- design/widget-agent.md, under The role. The widget agent answers one request about one target in seconds, with only the commands that apply, every change drawn as a preview, and an accepted change as one undo step.
- design/widget-agent.md, under The role. Work that does not fit one target belongs to the side chat, handed over with Ask in chat.
- design/widget-agent.md, under Entry points. Command-K on a panel, from the focused panel or its menu (Ctrl+K on Windows).
- design/widget-agent.md, under Entry points. Command-K on a selection of points or a range in a panel, made by a shift-drag.
- design/widget-agent.md, under Entry points. A prompt line under a dropped file's row, working on the loader the drop created and its outputs, with no change for a question.
- design/widget-agent.md, under Entry points. A Command-K button beside a property in the builder pane's property inspector, for a panel's or a source's property.
- design/widget-agent.md, under The inline prompt and the preview. The inline prompt opens inside the target panel under its title strip and shows the request, the agent's step and Cancel.
- design/widget-agent.md, under The inline prompt and the preview. The preview is drawn in place with a PREVIEW tag, a compact diff of changed keys and Accept, Reject, Refine and Diff actions.
- design/widget-agent.md, under The inline prompt and the preview. Other card states: DECLINED, a handoff reason tag, CONFLICT, STOPPED or FAILED, LIMIT and NO CHANGE.
- design/widget-agent.md, under The inline prompt and the preview. A change that adds, removes or moves panels is drawn as the preview of the whole spec with dashed bronze frames for new panels.
- design/widget-agent.md, under The inline prompt and the preview. The surface, the scripted agent, the agent over AcpClient, caliper-widget-shot, and the page's InlineWidget as built.
- design/widget-agent.md, under The context bundle. The app builds a context bundle of the target's spec fragment, schema and sample, render and selection, sized to a quarter of the model's context, with cuts marked.
- design/widget-agent.md, under The context bundle. build_context_bundle() returns ACP content blocks, the scope and meta, with forge-proof data markers.
- design/widget-agent.md, under The tool scope. The tool scope is the subset of the command table, reads and previewable edits only, that the widget agent may use for one target, enforced by the sidecar and kept as data in widget_scopes.json.
- design/widget-agent.md, under The tool scope. When no spec is open, a drop runs spec.new first and a reject undoes it while it is still the top step.
- design/widget-agent.md, under The turn budget, the model and the effort. A prompt makes at most 6 model requests and 8 tool calls and 8,000 output tokens; reaching a limit shows LIMIT.
- design/widget-agent.md, under The turn budget, the model and the effort. Claude Haiku 5.5 at effort low is the Claude default, and any of the four models and any effort can be chosen in the settings.
- design/widget-agent.md, under Preview and apply on the command layer. Stacked previews in the session: preview.begin, diff, commit and discard, edits that name a preview, and Accept, Reject and Refine mapped onto them.
- design/widget-agent.md, under Preview and apply on the command layer. Accept is preview.commit from the ui or builder origin only, so an agent cannot accept its own proposal; a preview expires after 30 minutes.
- design/widget-agent.md, under With no provider set up. With no provider, command-K still opens the prompt with only Ask in chat, tagged NO PROVIDER with a Setup action.
- design/widget-agent.md, under One journal, one history, one queue. Both roles reach the command layer through one queue, one journal under the agent origin with widget- groups, and one undo history.
- design/widget-agent.md, under How it stays an ACP agent. The widget agent is the same caliper-agent over the same AcpClient, with _meta.caliper.widget on session/new carrying the target, scope and preview, and session/close.
- design/widget-agent.md, under Providers. At most 20 strict tools in one Claude request.
- design/widget-agent.md, under Providers. One manual run of the dashboard prompt against Qwen 3.8 27B on Ollama built the dashboard in 135 seconds.
- design/widget-agent.md, under Refusals. A refusal ends the prompt with a card that offers Rephrase, Retry and Model, with server-side fallbacks off.
- design/widget-agent.md, under Refusals. Server-side refusal fallbacks can be switched on once Pydantic AI keeps the fallback block.
- design/widget-agent.md, under Presets. The settings in the app: a popup from the landing or any page with presets, base URL, model, effort and one key row per provider, stored in widget-agent.json.
- design/widget-agent.md, under Capabilities and degradations. Degradations when a model lacks tool calling, vision, context length, strict schemas, parallel calls, streamed arguments or reasoning output.
- design/widget-agent.md, under GPU contention. The Shared GPU note appears in the widget agent's settings and prompt row while a live session is attached and the base URL is loopback, and in the side chat for a marked local agent.
- design/widget-agent.md, under Security. Widget agent security: commands only, workspace data as data, keys in the credential store, no self-approval, one host, and loopback default with warnings for remote addresses.
- design/widget-agent.md, under Limits. Limits: one target per prompt, 6 requests and 8 tool calls, 64 recorded edits per preview, 16 sessions, 30 minutes per preview, and no loaders, saves, undo or whole-spec replacement.
- design/widget-agent.md, under Decisions. Decisions: two roles, the app builds the bundle, scope derived from the command table, stacked previews, Accept as preview.commit, a handoff tool, Claude Haiku 5.5 at low effort, one sidecar for every command-K, and Pydantic AI as the provider layer.
- design/widget-agent.md, under Work items. Items 9 to 13 done: stacked previews, the _meta argument, the ACP SDK evaluation, widget sessions and the context bundle.
- design/widget-agent.md, under Work items. Item 14 built: the inline surface on a panel, a selection, a dropped file and a property; the packaging of caliper-agent with a Python runtime moved to sprint 5.
- design/widget-agent.md, under Work items. Items 15 to 19 done: Pydantic AI providers, the capability probe, presets and key store with settings, the conformance suite and the GPU note.
- design/windows-parity.md, under 9. The builder's agents. The key store in the Windows Credential Manager, one entry per provider.
- design/windows-parity.md, under 9. The builder's agents. The shortcut: Ctrl+K in place of Cmd-K.
- Side Chat, Ask in Chat Action. Ask in chat hands a request from the inline prompt to the side chat.
- Widget Agent Startup, Agent Startup. caliper-agent starts as an ACP child process with provider presets.
- Widget Agent Startup, Presets. The provider presets of caliper-agent.
- Widget Agent Startup, Model Assumptions. What the agent assumes of a model.
- Widget Agent Startup, Ollama Chat API. Ollama is driven through its own chat API.
- Widget Session Protocol, Widget Session Startup. How a widget session is opened.
- Widget Agent, Tool Scope. The commands a widget session may use.
- Widget Session Protocol, Context Bundle. The context bundle a prompt carries.
- Widget Session Protocol, Prompts. What a prompt may hold.
- Widget Session Protocol, Answers. What each answer carries, held in a preview for accept.
- Widget Agent, Side Chat Use. A widget session continues in the side chat.
- Widget Session Protocol, Session Closing. Closing a widget session.
- Inline Prompt, Inline Surface. The inline surface opens a one-line prompt with Command K on the focused panel.
- Inline Prompt, App Settings. The widget agent settings popup holds provider, key and model.
- Widget Agent Setup. Set up the widget agent with a provider, a key, a model and a local model.
- Agent Roles. Explains when to use the side chat and when the widget agent.
- Pull request #17. Pull request 17 (merged) delivers sprint 3: the builder libraries, spec format, loaders, catalog, command layer and session, caliper-mcp, the side chat, the widget agent, command endpoints of Caliper API, the spec runtime and applets, the builder pane, drag and drop, approval cards and the first slice of the browser spec page.
- Pull request #18. Pull request 18 (merged) delivers the widget agent settings in the app, three more entry points for the widget agent prompt (a selection on a panel, a dropped file, a property), and the Shared GPU note.
- Pull request #18. Deferred in pull request 18: Escape and the prompt key pass through the settings popup, a property prompt can draw under another panel row, a selection outlives its spec, and packaging of caliper-agent with a Python runtime and the Shared GPU note in the side chat are not done.
- Pull request #19. Pull request 19 (merged) delivers the build-a-dashboard walk-through on a real training run, local models for the widget agent and the side chat (Ollama preset, context lengths), launches that carry the caller's origin, unsaved-changes prompts, a live session that stays attached, and Open in browser.
- Orchestrators' notes,
_notes/HANDOFF-sprint3.md. Pull request 1 of sprint 3 (the builder libraries, caliper-mcp, the side chat, the widget agent, the builder pane) was pushed as PR 17 and merged into main. - Orchestrators' notes,
_notes/HANDOFF-sprint3.md. The widget agent settings in the app and the three other entry points of the inline prompt (selection, dropped file, property) were built on sprint3-int-models and sprint3-int-inline, carried onto sprint3-pr2 and merged as PR 18. - Orchestrators' notes,
_notes/HANDOFF-sprint3.md. The note on GPU contention while a live run is attached was deferred from pull request 1, then built as the Shared GPU note in the settings and on the prompt row, and later in the side chat. - Orchestrators' notes,
_notes/HANDOFF-sprint3.md. The chat in the builder pane's right column, the local-model setting and the packaging of caliper-mcp were listed as unfinished after pull request 2. - Orchestrators' notes,
_notes/HANDOFF-sprint3.md. The walk-through examples/build_a_dashboard with six steps, a dry run per step and run_all.py, built by four builders on separate branches. - Orchestrators' notes,
_notes/HANDOFF-sprint3.md. The Ollama context fix: a translating transport to Ollama's native chat API with num_ctx and keep_alive, a warning in the settings for a large cache, and the user's allowed fallback alias for the demo only. - Orchestrators' notes,
sprint3-integration/PR.md. The widget agent, caliper-agent, a sidecar on Pydantic AI opened inline with cmd-K, with the key only in the OS credential store. - Orchestrators' notes,
sprint3-integration/PR2.md. The widget agent's settings in the app: provider preset, base URL, model, effort, key and capabilities, kept in widget-agent.json without the key. - Orchestrators' notes,
sprint3-integration/PR2.md. Three more entry points for cmd-K: a selection, a dropped file and a property. - Orchestrators' notes,
sprint3-integration/PR2.md. The Shared GPU note in the settings and on the prompt row. - Orchestrators' notes,
sprint3-integration/PR3.md. The walk-through examples/build_a_dashboard with six steps and dry runs. - Orchestrators' notes,
sprint3-integration/PR3.md. The Ollama preset talks to Ollama's own chat API with context per role (16,384 for cmd-K, 32,768 for the side chat), keep_alive on every request, and caliper-agent can be the side chat's agent. - Orchestrators' notes,
sprint3-integration/PR3.md. No silent truncation of the model context, a budget of six model requests for cmd-K, and a changed context length applies like other settings. - Orchestrators' notes,
sprint3-integration/PR3.md. Known gap: local models send empty strings for optional arguments and the first call fails before it is retried without them. - Orchestrators' notes,
sprint3-integration/DEMO-BRIEF.md. The walk-through's six steps: stream a training run, drop files and build by hand, cmd-K on a local model, the side chat, an outside agent over caliper-mcp, and save, reopen and the browser.