Skip to content

gut(config): remove embeddedPi Pi-era config stub (#2479)#2485

Merged
alexey-pelykh merged 1 commit intomainfrom
gut/embedded-pi-config-2479
Apr 22, 2026
Merged

gut(config): remove embeddedPi Pi-era config stub (#2479)#2485
alexey-pelykh merged 1 commit intomainfrom
gut/embedded-pi-config-2479

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Remove the embeddedPi: z.unknown().optional() passthrough stub from AgentDefaultsSchema. The Pi orchestrator was replaced by AgentRuntime early in the fork; this stub was kept so existing user configs could parse during the transition window. That window has closed.

Closes #2479.

Migration choice — Option B (rule + auto-migration)

#2478 chose Option A (silent passthrough) for memorySearch / pdfModel because users had no action to take. #2479 is different: the issue explicitly directs us to remove the stub, which means strict-schema configs carrying embeddedPi would reject without a migration. We add a rule + auto-migration so the warning surfaces once and the config keeps loading:

  • legacy.rules.ts — new rule at agents.defaults.embeddedPi with message "agents.defaults.embeddedPi is obsolete and ignored — the Pi orchestrator was replaced by AgentRuntime. Remove it from your config (auto-migrated on load)."
  • legacy.migrations.ts — new migration strip-agents-defaults-embedded-pi (sibling of strip-agent-default-field from gut: config migration for deprecated default: true field #1581). Strips the field and pushes a change line.
  • Gateway startup (server.impl.ts:206-226) already calls migrateLegacyConfig when legacyIssues.length > 0, writes the migrated config back, and re-reads — so users see the warning once, their config is cleaned up, and subsequent loads are silent.

Changes

Schema surface

  • src/config/zod-schema.agent-defaults.ts — remove the 3-line stub (comment + field).
  • src/config/types.agent-defaults.ts — remove the 2-line @deprecated type mirror.
  • src/config/schema.help.ts — remove the two agents.defaults.embeddedPi[.projectSettingsPolicy] help entries.
  • src/config/schema.labels.ts — remove the two matching label entries.

Legacy channel

  • src/config/legacy.rules.ts — add the detection rule.
  • src/config/legacy.migrations.ts — add the stripping migration.

Tests

  • src/config/config-misc.test.ts — new describe block with two AC-bound tests:
    1. flags agents.defaults.embeddedPi as a legacy issue — loading a config with embeddedPi: {...} populates snap.legacyIssues with the path.
    2. auto-migration strips agents.defaults.embeddedPi and the migrated config validatesmigrateLegacyConfig returns a non-null config (= passed strict validation) with the field stripped and the change line recorded.

Generated

  • src/config/schema.base.generated.ts — regenerated via node --import tsx scripts/generate-base-config-schema.ts --write.
  • docs/.generated/config-baseline.json + .jsonl — regenerated via node --import tsx scripts/generate-config-doc-baseline.ts --write.

Not touched (deliberately out of scope)

Acceptance criteria

  • rg "embeddedPi" src/ returns hits only from the migration-warning message text. Remaining hits: legacy.rules.ts (rule text), legacy.migrations.ts (migration code + change message), config-misc.test.ts (regression test fixtures). Per the gut(config): remove obsolete LLM model feature catalog types (#2478) #2484 interpretation, these are "inside the migration shim."
  • A test exercises: loading a config containing embeddedPi: {...} emits the migration warning AND the config loads successfully (no schema error). Two tests cover both sides.
  • tsc --noEmit clean — pnpm tsgo exit 0.
  • Test suite passes — pnpm vitest run src/config src/middleware = 129 files / 1396 tests pass.

Test plan

  • pnpm check (format:check + tsgo + lint + tmp-no-random-messaging + no-remoteclaw-ai) — all pass.
  • pnpm canvas:a2ui:bundle — ok.
  • pnpm vitest run src/config — 103 files / 788 tests pass.
  • pnpm vitest run src/config src/middleware — 129 files / 1396 tests pass.
  • Fork-integrity gates run locally — all pass:
    • zombie-import gate: clean
    • stub-debt gate: 132 == baseline 132
    • throwing-stub-callers gate: 0 violations, 0 allowlisted, 0 unexpected
    • obsolescence-audit gate: 49 == baseline 49

Notes

  • The stash-and-rerun check confirmed that the ~55 gateway test file failures observed in a broad local pnpm vitest run src/gateway are pre-existing on main (error: Cannot resolve main session key: no agents configured in test-helpers.server.ts:164). Unrelated to this diff. CI's environment runs these test files successfully.
  • Following the fork's "gut" convention: commit prefix gut(config):; branch gut/embedded-pi-config-2479; migration sibling to strip-agent-default-field (gut: config migration for deprecated default: true field #1581).

🤖 Generated with Claude Code

Remove the `embeddedPi: z.unknown().optional()` passthrough stub from
`AgentDefaultsSchema`. The Pi orchestrator was replaced by AgentRuntime
early in the fork; this stub was kept to let existing user configs still
parse during the transition window. That window has closed.

Unlike #2478 (which kept `memorySearch` / `pdfModel` as silent-passthrough
Option A stubs because nothing in the user's config needed to change),
#2479 fully removes `embeddedPi` and wires a migration:

- Legacy rule in `legacy.rules.ts` surfaces `agents.defaults.embeddedPi`
  in `snap.legacyIssues` with a user-facing warning.
- Legacy migration in `legacy.migrations.ts` strips the field before
  strict validation. Pattern matches the existing `strip-agent-default-field`
  sibling (#1581).
- Gateway startup (`server.impl.ts`) already calls `migrateLegacyConfig`
  when `legacyIssues.length > 0`, writes the migrated config back, and
  re-reads the snapshot — so configs carrying `embeddedPi` continue to
  load successfully, with the warning logged once.

Changes:
- Drop `embeddedPi` from `zod-schema.agent-defaults.ts` (strict schema)
  and `types.agent-defaults.ts` (mirror type).
- Drop `agents.defaults.embeddedPi[.projectSettingsPolicy]` help and
  label entries from `schema.help.ts` and `schema.labels.ts`.
- Add legacy rule + migration with issue-referenced describe/messages.
- Add two tests in `config-misc.test.ts`: (1) warning fires when
  `agents.defaults.embeddedPi` is present; (2) migration strips the
  field and the migrated config validates.
- Regenerate `schema.base.generated.ts` and `docs/.generated/config-baseline.json`.

AC verification: `rg "embeddedPi" src/` hits only within the migration
shim (rule text, migration code, regression-test fixture) — matches the
#2484 precedent interpretation. `pnpm tsgo` clean; `pnpm check` passes
(format + tsgo + lint + tmp-no-random-messaging + no-remoteclaw-ai).
Config+middleware tests: 129 files / 1396 tests pass. Fork-integrity
gates (zombie-import, stub-debt, throwing-stub-callers, obsolescence-audit)
all pass at baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh merged commit c336848 into main Apr 22, 2026
15 checks passed
@alexey-pelykh alexey-pelykh deleted the gut/embedded-pi-config-2479 branch April 22, 2026 20:03
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.

refactor(config): remove embeddedPi Pi-era config stub

1 participant