Commit graph

8 commits

Author SHA1 Message Date
Armin Ronacher
76c79d8bbe fix(p2): fit images to the model's limits before they enter the transcript
p2 sent uploaded images at full size, so a phone photo failed the request
with a provider 400 and every later one in the conversation.

pi-durable gains @earendil-works/pi-durable/images/fit, a kit that works
with any ImageProcessor and does not load Photon: fitImage/fitImages for a
host's input, and the fit-images extension, an afterTool hook that fits the
images of every tool result before it is committed. Images are fitted once,
before they are stored, so the transcript and prompt caches stay stable.
Every image is decoded, as in the coding agent; one that cannot be prepared
is left out with a note. imageLimits(model) is shared with read.

p2 creates one Photon processor per worker (WorkerParts.images) and uses it
for read, for attachments (resizes noted next to the file) and in the new
fit-images plugin.
2026-11-14 19:28:29 +01:00
Ramiz Wachtler
335814952c
feat(p2): show subagents' current step in the sidebar
A subagent's sidebar row no longer shows its model and path. While it
works its row ends with its step in one or two words (Thinking, Reading,
Reading +2); idle it ends with Failed, Stopped or the time since its
newest message, in its session's time column. The row's tooltip names
its model, where it works, the tools it runs and why its last run failed.

- status: workers report what each busy conversation does (`work`: step,
  since, tool rounds); SessionStatus 2, still serving 1
- subagents: children carry their newest message's time and their last
  run's failure; Subagents 3, still serving 2; ChildRows' children column
  at version 2. The run failure is read only when it can have changed
- ToolActivity.brief: a running call's one or two words, from the
  plugins that own the tools
2026-11-11 16:38:24 +01:00
Mario Zechner
49b88055b1 p2: code mode's calls and the tools' TUI cards come from their plugins
Web: the core keeps nested calls only as Durable shows them (`ToolView.calls`: live
`pi.live.nestedTools` slots, then the last list seen). A tool's contribution reads the rest:
`ToolActivity.nestedCalls(tool)` (code mode: its result's `details.calls`, live internal tools by
their script name, in plugins/codemode/nested.ts), `repeated(count, failed)` for an entry of
identical repeated calls ("N runs"; without it, the repeated tool's own summary), and a nested call's
`CallInput` (bash, PowerShell, terminal: a command line; without it, JSON) instead of core's
`args.command` guess. `isInterruptedError` moves to `@p2/app/v1`.

TUI: the built-in renderers move to the plugins' TUI facets (coding-tools: read, bash, edit, write,
grep, find, ls; powershell; codemode); the shell card stays a shared building block
(`createShellRenderers`). `ToolRenderers.nestedCalls` reads a call's calls for the card and for
resolvers such as quiet-tools (`resolveToolRenderers` keeps the registry's). `transcriptComponent`
takes the renderers to draw with; tests use `test/fixtures/tui-tools.ts`.

Behaviour and look unchanged.

(cherry picked from commit 00afdddbb6eb3dcb5207cac6ca8e496607ab1b61)
2026-11-07 00:28:50 +01:00
Mario Zechner
abc14343fd feat(p2): tools' chat look comes from the plugins that own them
The web UI keeps no tool-specific code: each tool's plugin contributes how its calls show (words on the wheel and in
the sheet, the row's argument, a failure word, its words in a run's summary, its detail, a nested call's detail, a
result after the answer) to the ToolActivities registry, keyed by tool name, from its web facet. coding-tools,
terminals, codemode, subagents, agent, artifacts, send-file, ports, conversations and history register theirs. A tool
without a contribution reads as its name and first short string argument, with the generic icon and its input as
JSON and output as its detail. Tool declarations are unchanged.
2026-11-06 17:39:08 +01:00
Mario Zechner
2a32a605a9 feat(p2): Gondolin sandbox environments
Some checks are pending
CI / build-check (push) Waiting to run
CI / test (coding-agent) (push) Waiting to run
CI / test (durable) (push) Waiting to run
CI / test (other) (push) Waiting to run
CI / mcp-conformance (push) Waiting to run
A sandbox is a new env type (`type: "gondolin"`): a long-lived Gondolin micro-VM on an SSH environment, with
listed host folders and an HTTP(S) host allowlist. The worker reaches it over SSH to the host, where p2's launcher
(plugins/envs/sandbox: native, or Docker when the host's Node/QEMU are too old) runs pi-env's daemon inside the VM,
so tools, workspace, terminals, uploads and MCP work unchanged. Names outside the allowlist are refused before
the host resolves them.

Conversations working in a sandbox cannot leave it: location tools, subagent spawn/configure, AgentLocations.move,
the terminal tool, and one-shot agents (which now inherit their caller's own location) all keep them there; only the
owner's Relocate moves a session out, after a confirmation. conversationConfinement() exposes it to plugins.

Owner-only management in the Envs sheet: sandboxes listed under their host, host test reports sandbox support,
create/edit/start/stop/restart/test, lock icons in the top bar and sidebar. Tests in test/p2/sandboxes.test.ts
(real VM cases with P2_TEST_GONDOLIN=1) and ui-sandboxes.test.ts; docs in docs/remote-envs.md.
2026-11-05 23:35:09 +00:00
Mario Zechner
fe68bf23e8 feat(p2): subagent messages start with a <sender kind="subagent"> block instead of a [subagent …] line 2026-11-05 07:23:22 +00:00
Mario Zechner
43fb4e3106 feat(p2): <sender> block for the model, peer messages as p2.peer-message entries, legacy speaker reader removed 2026-11-04 22:07:38 +00:00
Mario Zechner
05dc8d239d feat: add apps/p2 (imported from pi-private at 7dadff697)
p2 (Pi Mobile on Chord v2) moves from pi-private into pi as one commit. Root scripts that loop all workspaces
use --if-present; npm test, ./test.sh and the release script cover packages/* only (p2: cd apps/p2 && npm test);
sync-versions also updates apps' workspace pins.
2026-11-03 13:39:06 +00:00