Context
RemoteClaw is middleware that delegates LLM execution to CLI agents (Claude Code, Gemini, Codex, OpenCode). The CLI agents handle provider/model selection and auto-detect model capabilities (tool support, reasoning-effort support, thinking-format dialect, etc.) at runtime.
Caching model-feature flags in middleware config violates the middleware boundary: middleware becomes authoritative on model capabilities it doesn't control, and cached flags drift out of sync with real model behavior. Three related dead types in src/config/ remain from the pre-fork embedded execution path.
Problem
MODEL_APIS constant (src/config/types.models.ts:3-12)
Enum listing LLM API protocols (openai-completions, anthropic-messages, google-generative-ai, etc). Stored on model definitions as an optional api field. No production code reads this field for routing — it's metadata that's never inspected.
ModelCompatConfig type (src/config/types.models.ts:16-30)
Feature-flag record: supportsReasoningEffort, supportsTools, supportsStrictMode, thinkingFormat. Referenced only by:
src/config/zod-schema.core.ts:181-194 — the Zod validator that enforces its shape in loaded config
src/config/schema.base.generated.ts:1203+ — generated JSON schema (regenerates from Zod)
src/config/config-misc.test.ts:319-320 — test fixture
Verification:
rg "ModelCompatConfig|supportsReasoningEffort|supportsStrictMode|thinkingFormat" src/ --type ts
# All hits are in: types.models.ts (declaration), zod-schema.core.ts (validator),
# schema.base.generated.ts (generated), config-misc.test.ts (fixture).
# No production reader of any compat field.
ModelApiSchema Zod validator (src/config/zod-schema.core.ts:181)
Zod validator for MODEL_APIS. Becomes orphan once MODEL_APIS is removed.
Tasks
Acceptance Criteria
rg "MODEL_APIS|ModelCompatConfig|ModelApiSchema|supportsReasoningEffort|supportsStrictMode|thinkingFormat" src/ returns no hits outside the migration shim (if Option B)
- Existing user configs containing these fields still parse successfully
tsc --noEmit clean
- Test suite passes
Context
RemoteClaw is middleware that delegates LLM execution to CLI agents (Claude Code, Gemini, Codex, OpenCode). The CLI agents handle provider/model selection and auto-detect model capabilities (tool support, reasoning-effort support, thinking-format dialect, etc.) at runtime.
Caching model-feature flags in middleware config violates the middleware boundary: middleware becomes authoritative on model capabilities it doesn't control, and cached flags drift out of sync with real model behavior. Three related dead types in
src/config/remain from the pre-fork embedded execution path.Problem
MODEL_APISconstant (src/config/types.models.ts:3-12)Enum listing LLM API protocols (
openai-completions,anthropic-messages,google-generative-ai, etc). Stored on model definitions as an optionalapifield. No production code reads this field for routing — it's metadata that's never inspected.ModelCompatConfigtype (src/config/types.models.ts:16-30)Feature-flag record:
supportsReasoningEffort,supportsTools,supportsStrictMode,thinkingFormat. Referenced only by:src/config/zod-schema.core.ts:181-194— the Zod validator that enforces its shape in loaded configsrc/config/schema.base.generated.ts:1203+— generated JSON schema (regenerates from Zod)src/config/config-misc.test.ts:319-320— test fixtureVerification:
ModelApiSchemaZod validator (src/config/zod-schema.core.ts:181)Zod validator for
MODEL_APIS. Becomes orphan onceMODEL_APISis removed.Tasks
MODEL_APISconstant andModelApitype fromsrc/config/types.models.tsModelCompatConfigtype and thecompat?: ModelCompatConfigfield reference inModelDefinitionConfigapifield fromModelDefinitionConfigif presentModelApiSchemaandModelCompatConfigSchemafromsrc/config/zod-schema.core.tssrc/config/zod-schema.agent-defaults.tsto dropcompat,apioptional fieldssrc/config/schema.base.generated.tsfrom the updated Zod sourcessrc/config/config-misc.test.tsreferencing the removed fieldsz.object(...).passthrough()on the model definition) — tolerant but hides drifttsc --noEmitand full test suiteAcceptance Criteria
rg "MODEL_APIS|ModelCompatConfig|ModelApiSchema|supportsReasoningEffort|supportsStrictMode|thinkingFormat" src/returns no hits outside the migration shim (if Option B)tsc --noEmitclean