Skip to content

chore: update all dependencies, thin Squid into Pi's native machinery - #47

Merged
YoungSx merged 5 commits into
mainfrom
chore/update-deps-pi-compat
Oct 12, 2026
Merged

YoungSx merged 5 commits into
mainfrom
chore/update-deps-pi-compat

Conversation

@YoungSx

@YoungSx YoungSx commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

What

Dependency update across the board, and — wherever pi 1.1.0 changed shape — Squid's code got thinner instead of shimming:

  • 282846b chore: update all dependencies — bun deps + panel crates; @earendil-works/pi-ai@1.1.0 added as a direct dep.
  • eb54b5a route the decision curator through pi's native classifier — the vendored jev-curator/jev.ts HTTP client is deleted; the curator calls ctx.modelRegistry.classify, so Pi owns the wire, the bearer, and the timeout.
  • 9caf65b reuse pi's estimateTokens for the curator's token floor — the hand-rolled chars/4 estimate is gone; Pi's own estimate knows every message shape.
  • a761f76 store the decision key as pi's own typesafe credential — no Squid-side parallel credential store.
  • 4892ef4 the decision curator rides the chat model's own provider — the follow-through on "chat and decisions are one provider, all in Pi's native way": the classifier model declares the chat provider (so Pi's request-time auth resolves the credential the run already has), and the extension registers Pi's own typesafe-system-one classifier transport onto the chat provider at session start via the public registerProvider API. The typesafe provider entry and the panel's decisionKey row are deleted; there is no second login anywhere.

Why

The decision model was never a separate identity — it is one more request the run makes. Keeping a second provider entry, key row, and wire client for it duplicated what Pi already resolves for chat. SQUID_DECISION_BASE_URL stays as an endpoint-only override (a gateway can route /v1/systemone elsewhere; a local OpenJev/Kev replica is the free option) and defaults to the chat provider's own base URL.

Verification

  • bun run typecheck (both tsconfigs) + bun test: 811 pass / 7 skip / 0 fail.

🤖 Generated with Claude Code

YoungSx and others added 5 commits October 11, 2026 18:02
- @earendil-works/pi-coding-agent 0.84.2 -> 1.1.0 (no API break: our import
  surface typechecks and all 816 tests pass unchanged)
- @modelcontextprotocol/sdk 1.30.0 -> 1.32.1, shell-quote 1.10 -> 1.12,
  typebox 1.3.15 -> 1.3.36, zod 4.4.3 -> 4.6.6, @types/node -> 26.6.5
- bun-types stays pinned at 1.4.2 to match the pinned runtime
- ui: cargo update (slint 1.17.1 -> 1.18.1, which fixes the tray error-enum
  display bug the AGENTS.md notes; clippy/test clean, msvc cross-check clean)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Replace the vendored /v1/systemone HTTP client (jev-curator/jev.ts, 147
lines) with ctx.modelRegistry.classify() on the typesafe-system-one API —
pi-ai 1.x speaks the same endpoint natively. The classifier model is
built structurally from CuratorConfig (no pi-ai import needed; its types
are not re-exported through pi-coding-agent).

Behavior deltas, each deliberate:
- state is now the JSON object {"transcript": "..."} (ClassifierContext
  requires JsonObject) where the old client sent a bare string — noted in
  the jev-curator README for self-hosted replicas.
- the decision key still lives in Squid's keystore and is passed
  per-request via options.apiKey; a keyless endpoint gets a placeholder
  bearer ("keyless"), which such replicas ignore.
- maxRetries: 0 preserves the old no-retry fail-open on 429/529 — the
  call sits ahead of the LLM request and must not stall it.
- a malformed answer for any unit now errors the whole result (pi's
  parseAnswers throws), which fails open — same safety posture, stricter
  than the old per-unit tolerance.

Tests: the fake /v1/systemone round-trip is retired (the wire is pi's
own tested transport); classify-stub tests now cover model construction,
options passthrough, threshold mapping, keyless placeholder, and
fail-open. Gate: typecheck + 825 tests green.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Drop the vendored chars/4 helper from jev-curator/units.ts; pi exports
estimateTokens(message) with the same heuristic but per-message accuracy
(images, tool calls, prompt sections). One less duplicated util; no
behavior change at the floor.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The decision-curation key no longer has a Squid-side store. The curator's
classify call omits `apiKey`, so pi resolves the credential itself — a
`typesafe` entry in ~/.pi/agent/auth.json wins, TYPESAFE_API_KEY is consulted
only when nothing is stored. `src/decision-keystore.ts` (SQUID_DECISION_KEY +
0600 ~/.pi/squid-decision.json) is deleted; the panel's decisionKey row now
writes the pi-native credential, refuses a save while the env fallback governs
(empty value still clears), and its `overridden` flag means "the env fallback
is what this run uses". A keyless local replica now needs any placeholder
stored (GUI row or env) because pi's transport refuses to post without a key;
otherwise the curator fails open as before.

Co-Authored-By: Claude Code <noreply@anthropic.com>
One provider for chat and decisions, entirely through Pi's native
machinery: the classifier model declares the chat provider, so Pi's
request-time auth resolves the credential the run already has. The
extension registers Pi's own typesafe-system-one classifier transport
onto the chat provider at session start via the public registerProvider
API — the same pattern Pi's llama extension uses — so no Squid-side wire
code, typesafe provider entry, or decisionKey row remains.

The endpoint stays its own setting (a gateway can route /v1/systemone
elsewhere; a local replica is the free option) but defaults to the chat
provider's own base URL, read from Pi's models.json.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@YoungSx
YoungSx merged commit 91046fd into main Oct 12, 2026
3 checks passed
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