gut(config): remove dead agent params bags (#2481)#2487
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
Per-agent `AgentConfig.params` (types only, never in zod schema) and per-model `agents.defaults.models[<id>].params` (zod-accepted, strict) were placeholders for LLM request params (temperature, cacheRetention, thinking mode, etc.) with zero production readers — the middleware delegates LLM execution to CLI agents, so those knobs belong to the runtime, not middleware config. - Remove `params?: Record<string, unknown>` from `AgentConfig` type - Remove per-model `params: z.record(...)` from agent-defaults zod - Regenerate `src/config/schema.base.generated.ts` - Add legacy rules + migration (`strip-agent-params-bags`) to warn and strip `agents.list[].params` and `agents.defaults.models[<id>].params` before strict zod validation — chose Option B (migration warning) over Option A (passthrough) for consistency with #2479/#2480 - Add regression tests for both the flagging path and the strip path Orphan `agent.test.ts` thinking test referenced in the issue was already removed by #2480 — no coordination needed with #2482. (#2481) 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
Per-agent
AgentConfig.paramsand per-modelagents.defaults.models[<id>].paramswere placeholders for LLM request parameters (temperature, cacheRetention, thinking mode, etc.) with zero production readers. RemoteClaw is middleware that delegates LLM execution to CLI runtimes (Claude, Gemini, Codex, OpenCode), so those knobs belong to the runtime, not middleware config.Closes #2481.
Changes
src/config/types.agents.ts: removeparams?: Record<string, unknown>field fromAgentConfig. This field was TypeScript-only — it was never in theAgentEntrySchemazod schema (which is.strict()), so real configs withagents.list[].paramswere already being rejected at validation.src/config/zod-schema.agent-defaults.ts: remove per-modelparams: z.record(z.string(), z.unknown()).optional()from the models schema entry.src/config/schema.base.generated.ts: regenerated viascripts/generate-base-config-schema.ts—paramskey no longer appears underagents.defaults.models.*.properties.src/config/legacy.rules.ts: add two rules warning users about obsoleteagents.list[].paramsandagents.defaults.models[<id>].paramsfields.src/config/legacy.migrations.ts: addstrip-agent-params-bagsmigration that walksagents.list[]andagents.defaults.models[<id>]to removeparamsbefore strict zod validation.src/config/config-misc.test.ts: add regression tests for both the legacy-issue flagging path and the auto-strip migration path.Migration choice
Option B (migration warning + strip) — consistent with #2479 (embeddedPi gut) and #2480 (thinkingDefault gut). Users with
paramsunder an agent list entry or per-model section will see alegacyIssuesdiagnostic and the field is silently stripped before the strict zod schema runs, so existing configs continue to parse.We rejected Option A (passthrough) because weakening
.strict()to.passthrough()would silently swallow typos and leftover fields with no user-visible signal.Coordination
Issue #2481 flagged orphan tests in
src/commands/agent.test.tsoverlapping with #2480 and #2482. Since #2480 landed first, the"prefers per-model thinking over global thinkingDefault"test it referenced is already gone — no coordination needed with #2482.The
runEmbeddedPiAgent = vi.fn()mock identifiers remaining in test files are historical names for mocked module exports, not live calls, and are out of scope.Test plan
pnpm tsgo— no TypeScript errorspnpm lint(oxlint --type-aware) — 0 warnings, 0 errorspnpm vitest run src/config/— 96 test files, 740 tests, all pass (including 2 new regression tests for this PR)rg "AgentConfig.*params\?|config\.params|agent\.params" src/— only pre-existing generic function-param refs (no production reads of the removed field)rg "models\.\w+\.params|model\.params|\.params\?\.thinking" src/— 0 matches🤖 Generated with Claude Code