Repository navigation
feat(tools): freeze and slim the OpenPI tool surface for cache stability (#879) - #880
Merged
Merged
Conversation
Mid-session tool toggles rewrite the cached prompt prefix: every setActiveTools call also rebuilds the Pi system prompt. Replace keyword capability loading and state-driven lifecycle gates with one resident tool set fixed at session start; only /plan, the /openpi-setup episode and setup-applied browser permission may change tools. - Remove capability discovery (openpi_load_tools, keyword routing, capabilities.discovery) and the fd/rg, runtime_snapshot, tasks and context_pivot tools; drop retired names from child allowlists. - Keep git_* as a plan boundary and read-only child surface. - Enforce resident tools at runtime and add frozen-surface and resident-budget tests; record Decision 0005 and amend AGENTS.md. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Fold the list operations into the status/check tools, the same optional-id pattern workflow_status already uses: subagent_check lists all subagents when called without id (evidence reads still require one), and bg_status lists all background terminals without id. get_goal is removed because the goal continuation prompt already carries the objective, usage, and budget. subagent_wait stays a separate tool because synchronous waiting must remain an explicit model choice (AGENTS.md). Resident surface goes from 17 to 14 tools; measured budget 17,758 chars, ceiling 19,600 (~10% headroom). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
) - CI: drop the deleted session-tasks-panel widget assertion and point the packed-extension smoke at extensions/git-read (file-search is gone). - Children: role-listed read-only inspection tools (CHILD_READ_DERIVED_TOOL_NAMES: grep, find, ls, git_show/diff/log) may activate for a child even when the parent never did, provided the parent holds read — restoring planning and read-only children's search without widening the parent surface. - Setup config: treat the retired capabilities key as known so old configs load without warnings and drop it on the next write. - git-read: neutral capture-limit wording plus a ported capture-cap test. - subagent_check: clearer evidence-read error text. - Web: historical rg/fd calls render as search activity; dead task/goal i18n keys, the /goal composer entry, and the stale capabilities fixture removed. - Goal: delete the feature entirely (extensions/goal, /goal, create_goal, update_goal; retired for stale allowlists). Resident set 14 -> 12 tools, measured budget 14,963 chars, ceiling 16,500. Old sessions containing goal entries and goal-continuation messages still load. - Docs: README/SETUP/site counts and prose, RUNTIME_SNAPSHOT status, Decision 0005 amendment. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…t resident tool contracts (#879) Remove the background-terminals extension (bg_start/bg_status/bg_kill/ bg_watch, /ps, footer widget, Web capability) — 0 calls in 236 maintainer sessions and its session_shutdown kill broke the one benchmark use; Pi Bash (nohup … &) covers long-running processes. Resident set is now 8 tools (5 subagent, 3 workflow); measured surface 6,592 chars (wire-only 6,124) asserted ≤ 7,300. Code Mode defaults to disabled (codemode added ~1.9k chars per request with 0 calls); explicit saved settings are kept. Resident descriptions rewritten as compact contracts per review with detail moved to Skills. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Branch protection on main requires the "Background terminals (Windows)" status check. The job only aggregates windows-node and test-ui results and does not depend on the removed background-terminals extension, so keep it until maintainers rename the required check. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Delete extensions/workspace-cleanup-guard and its tests. Native Pi has no deletion guard, and in the 2026-10-18 Terminal-Bench runs the guard blocked legitimate commands in nginx-request-logging and regex-log in both rounds — compound commands like `cd /app && rm -f test_regex.py && ls ...` and even standalone `rm -f /etc/nginx/sites-enabled/default`. In no-UI sessions Pi's confirm always returns false, so pre-existing deletions could never be approved. Codex exec approvals are Never and OpenCode run auto-rejects with feedback, so peers do not block-and-retry in non-interactive runs. Bash now runs entirely under Pi's own behavior. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…879) The context hook appended the openpi-plan-context reminder at the tail of every provider request once any plan-mode state entry existed in the branch. Each new turn displaced it, so request k was never a prefix of request k+1; Pi's anthropic provider puts its only history cache breakpoint on the last user message, so the breakpoint moved every request and the history cache was always rewritten, never read. Reminders are now derived per persisted state entry (malformed decodes fail closed to the blocked text) and anchored at the entry's position in the branch, skipping consecutive duplicate states and never splitting an assistant tool call from its toolResult run. Verified against a real session fixture: consecutive requests are exact prefixes once more. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
In print/json mode the process disposes the runtime when the parent turn ends, which stops any running subagent and discards its result. The spawn result now carries exitsAfterTurn and, for those modes, requires subagent_wait before the final answer instead of promising automatic delivery. Interactive and rpc runs keep the old text byte-identical. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ontract (#879) In the a055ca7 delegation benchmark one workflow-explicit trial passed started agent() promises to parallel() and failed with "parallel() items must be zero-argument functions" before retrying. The resident description listed parallel() without its argument shape and the Skill body did not show it either, so state the thunk form in both places. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…#879) The inspection e2e was ported from background terminals to the subagent panel, but Escape does not close that panel, so at 390px it still covered the page and the sidebar button never appeared. Close it explicitly, and locate it as the full-page main view on mobile. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Oct 18, 2026
Merged
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #879: OpenPI changed the model-facing tool set mid-session (keyword discovery, lifecycle gates, task/goal/context state) through
setActiveTools, which rebuilds the system prompt and wiretoolsarray and invalidates the provider prompt/KV cache prefix. The resident surface had also grown large (12 OpenPI tools, ~14.3k wire characters) with several unused or redundant tools. Benchmarks additionally exposed three runtime defects: background terminals died with the session, the workspace cleanup guard blocked ordinaryrmin non-interactive runs, and print/JSON runs lost subagent results when the turn ended beforesubagent_wait.Value
/plan,/openpi-setup, browser authorization).Approach
get_goaland the goal extension, background terminals (use Pi Bashnohup … &), the workspace cleanup guard (native Pi has none); consolidate list/status tools; Code Mode becomes opt-in./planhas been used.subagent_waitfor needed results; interactive/RPC wording is unchanged.parallel([() => agent(...)])thunk form.Validation
bun run check: pass.bun run testat 88502e1: Node 2,339 pass / 0 fail; Vitest 97/97 files pass.Blocked cleanup= 0.parallel()argument error fixed in 88502e1 (not re-benchmarked).tt-a1i/openpi-bench-archive@ a654ea4,runs/2026-10-18_a055ca7_tb-k3-and-delegation/.Impact
/goal,/ps, background terminal footer/Web capability, and the workspace cleanup guard are removed; Code Mode is off unless explicitly enabled (saved settings preserved).codeMode.enabledparses as opt-in.