Skip to content

Adopt pi 1.0, improve the loop and compaction, and go English-only - #16

Merged
Justar96 merged 3 commits into
developfrom
feat/pi-1.0-migration
Oct 2, 2026
Merged

Justar96 merged 3 commits into
developfrom
feat/pi-1.0-migration

Conversation

@Justar96

@Justar96 Justar96 commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • pi 1.0 adoption. DeepSeek runs through llm-pi-ai on @earendil-works/pi-ai 1.0.0, using the shipped deepseek-official route. This removes llm-deepseek and the three packages only it used: /usage, Files-API upload, request extensions, and DeepSeek image pricing are gone. MCP uses @earendil-works/pi-mcp. run_code runs in a pi-codemode QuickJS sandbox, while workflow scripts keep the Node runtime.
  • Agent loop. When a reply is cut off at the output limit, the model is told which tool calls were dropped and the turn continues once. Hooks and tool policies can halt a turn through ToolHalt, including from inside run_code. The TUI shows the reason for a halt. A goal keeps going after a recovered turn.
  • Live tool progress. bash and pwsh stream their newest output to the TUI through the process-local events agent/tool-progress and agent/tool-executed. Nothing new is persisted or shown to the model.
  • Compaction. There is a live compaction-basic section in settings.yaml, with provider-wide modelPolicies and thresholdTokens, so a cliproxyapi route can set its own compaction point. Checkpoints keep <read-files>, <modified-files>, and <todo-list>. When the summary request itself overflows, it falls back to a bounded transcript. Transient summary errors are retried.
  • English-only. Removed all .zh.md and .i18n.yaml files, the zh UI locale and locale setting, and the translation-pairing tooling. Frozen history in snapshots/, archived notes, and historical formats is untouched.

Session format

There is no version bump and no persistence digest moved. session-log-deepseek/delivery-accepted was added to the retired vocabulary. bun scripts/persistence-changes.ts --check lists request/tool-update and subagent/routing-decision as unacknowledged same-version root additions. These need acknowledging before release.

Eval

evals/agent-loop/versions/unreleased/2026-10-02-pi-migration-compaction has a paired record against 7428f19adb: 7 models, the standard suite, 3 trials each.

  • Total tokens and request counts are within noise for every model. No tool errors were added.
  • Flagged regression: gpt-6.1-sol, failures 1 → 3. I accepted it. All three candidate failures hit the 180-second wall-clock limit while waiting on a model response with no tool running. They happened in the same trial at the same time, and the base arm and gpt-6-astra show the same gateway stall.
  • DeepSeek uncached input rose 9.2% (flash) and 13.6% (v4-pro) in that run. Most of it was a one-time cold cache for the new prefix. The rest was pi-ai's wire: the deferred-tool placeholder, cache_control markers, and the prompt and runtime context sent as two separate user messages. The new llm-pi-ai messagesWire option on deepseek-official restores the old adapter's shape. A follow-up paired record, 2026-10-02-deepseek-messages-wire, shows uncached input at −2.6% (flash) and −8.3% (v4-pro), within noise, with 108/108 successes and no regressions.

Checks

  • bun run preflight passes: 26 passed and 1 skipped, because actionlint isn't installed. This includes runtime and e2e PTY, with the new live-output scenario.
  • Not run: Windows/macOS, a packed install, and key-gated e2e outside the eval.

Known follow-ups

  • llm-pi-ai/src/context.ts joins multi-block text without a separator. Fixing it changes what the model sees, so it needs an eval.
  • agent-presets/src/display.ts and its ./display subpath are dead code.
  • pi-codemode is pinned exactly, because the meter uses its worker internals.

- DeepSeek runs through llm-pi-ai on @earendil-works/pi-ai 1.0.0; the shipped
  deepseek-official route keeps DEEPSEEK_API_KEY and saved selections.
  llm-deepseek, deepseek-llm-api-extensions, plugin-package-inventory-deepseek,
  and session-log-deepseek are removed; the delivery event stays readable as
  retired vocabulary.
- MCP uses @earendil-works/pi-mcp instead of the MCP SDK client.
- run_code runs in a pi-codemode QuickJS sandbox; workflow scripts keep the
  Node runtime in their own group.
- The agent loop tells the model about tool calls cut off at the output limit
  and continues once, and hooks or tool policies can halt a turn (ToolHalt).
- Running shell commands stream their newest output to the TUI, and parallel
  calls are marked done as each finishes.
- compaction-basic reads a live settings.yaml section with provider-wide
  policies and thresholdTokens; checkpoints keep read/modified files and the
  todo list; summary requests retry transient errors and fall back to a
  bounded transcript on overflow.
- Chinese docs, the zh UI locale, and the translation-pairing tooling are
  removed.
- Eval record: evals/agent-loop/versions/unreleased/2026-10-02-pi-migration-compaction
…gesWire

The shipped deepseek-official route drops pi-ai's deferred-tool placeholder,
strips cache_control, and merges adjacent same-role messages, matching the
removed llm-deepseek adapter. Paired eval: uncached input -2.6% (flash) and
-8.3% (v4-pro) against v0.3.2, down from +9.2% and +13.6%.

Eval record: evals/agent-loop/versions/unreleased/2026-10-02-deepseek-messages-wire
@Justar96
Justar96 merged commit 496d1b6 into develop Oct 2, 2026
@Justar96 Justar96 mentioned this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant