gut(config): remove embeddedPi Pi-era config stub (#2479)#2485
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 22, 2026
Merged
gut(config): remove embeddedPi Pi-era config stub (#2479)#2485alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
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>
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.
Summary
Remove the
embeddedPi: z.unknown().optional()passthrough stub fromAgentDefaultsSchema. 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/pdfModelbecause users had no action to take. #2479 is different: the issue explicitly directs us to remove the stub, which means strict-schema configs carryingembeddedPiwould 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 atagents.defaults.embeddedPiwith 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 migrationstrip-agents-defaults-embedded-pi(sibling ofstrip-agent-default-fieldfrom gut: config migration for deprecateddefault: truefield #1581). Strips the field and pushes a change line.server.impl.ts:206-226) already callsmigrateLegacyConfigwhenlegacyIssues.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@deprecatedtype mirror.src/config/schema.help.ts— remove the twoagents.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:flags agents.defaults.embeddedPi as a legacy issue— loading a config withembeddedPi: {...}populatessnap.legacyIssueswith the path.auto-migration strips agents.defaults.embeddedPi and the migrated config validates—migrateLegacyConfigreturns a non-null config (= passed strict validation) with the field stripped and the change line recorded.Generated
src/config/schema.base.generated.ts— regenerated vianode --import tsx scripts/generate-base-config-schema.ts --write.docs/.generated/config-baseline.json+.jsonl— regenerated vianode --import tsx scripts/generate-config-doc-baseline.ts --write.Not touched (deliberately out of scope)
runEmbeddedPiAgent,isEmbeddedPiRunActive,queueEmbeddedPiMessage, etc. insrc/auto-reply/,src/agents/,src/commands/agent.test.ts— these use CamelCaseEmbeddedPiand refer to the Pi agent runner subsystem, which is orthogonal to the config stub. Issue scopes refactor(config): remove embeddedPi Pi-era config stub #2479 explicitly to the config stub.memorySearchandpdfModelpassthrough stubs — refactor(config): remove obsolete LLM model feature catalog types #2478 chose Option A for these; they stay.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."embeddedPi: {...}emits the migration warning AND the config loads successfully (no schema error). Two tests cover both sides.tsc --noEmitclean —pnpm tsgoexit 0.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.Notes
pnpm vitest run src/gatewayare pre-existing onmain(error:Cannot resolve main session key: no agents configuredintest-helpers.server.ts:164). Unrelated to this diff. CI's environment runs these test files successfully.gut(config):; branchgut/embedded-pi-config-2479; migration sibling tostrip-agent-default-field(gut: config migration for deprecateddefault: truefield #1581).🤖 Generated with Claude Code