Skip to content

refactor(config): remove dead agent params bags #2481

@alexey-pelykh

Description

@alexey-pelykh

Context

RemoteClaw is middleware that delegates LLM execution to CLI agents. LLM request parameters (temperature, top_p, max tokens, cache retention, etc.) are the CLI agent's concern, not middleware's. Two opaque parameter-bag types exist in the config schema as placeholders for "provider-specific params" but have zero production readers.

Problem

AgentConfig.params (src/config/types.agents.ts:86-87)

params?: Record<string, unknown>; // e.g. cacheRetention, temperature

Opaque per-agent parameter bag. In-line comment suggests intent for LLM request params. Zero production readers:

rg 'config\.params|agent\.params|agents\[.*\]\.params|AgentConfig.*params' src/ --type ts
# No matches in production source (only generic `params` variable references
# unrelated to AgentConfig.params specifically).

Per-model params in agent-defaults (src/config/zod-schema.agent-defaults.ts:29-30)

params: z.record(z.string(), z.unknown()).optional()
// Provider-specific API parameters (e.g., GLM-4.7 thinking mode)

Per-model parameter record inside agents.defaults.models[<id>].params. The only references are orphan tests: src/commands/agent.test.ts:840-846 ("prefers per-model thinking over global thinkingDefault") asserts against a mock of runEmbeddedPiAgent — a function imported NOWHERE in src/ production code (the embedded execution path was gutted).

Tasks

  • Remove params?: Record<string, unknown> field from AgentConfig type in src/config/types.agents.ts:86-87
  • Remove per-model params field from the models schema in src/config/zod-schema.agent-defaults.ts:29-30
  • Regenerate src/config/schema.base.generated.ts
  • Decide migration handling for existing user configs containing either field:
    • Option A: silent passthrough via z.object(...).passthrough() on the agent / per-model schemas
    • Option B: migration warning (same channel used for other legacy fields)
    • State choice in PR description
  • Delete orphan tests referencing per-model params if not already covered by a concurrent thinking-gut PR — coordinate with that PR's scope to avoid overlap
  • Run tsc --noEmit and full test suite

Acceptance Criteria

  • rg "AgentConfig.*params\?|config\.params|agent\.params" src/ returns no production hits outside migration shims
  • rg "models\.\w+\.params|model\.params|\.params\?\.thinking" src/ returns no production hits
  • User configs containing params: {...} under an agent or per-model section still parse (either passthrough or migration-warning path, per choice above)
  • tsc --noEmit clean
  • Test suite passes

Metadata

Metadata

Assignees

Labels

gutRemoving dead upstream subsystems

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions