gut(config): remove remaining LLM-platform z.unknown() stubs (#2489)#2492
Merged
alexey-pelykh merged 1 commit intomainfrom Apr 23, 2026
Merged
gut(config): remove remaining LLM-platform z.unknown() stubs (#2489)#2492alexey-pelykh merged 1 commit intomainfrom
alexey-pelykh merged 1 commit intomainfrom
Conversation
Consolidates middleware-not-platform boundary: removes 8 z.unknown() stubs
describing LLM-platform concerns (api/compat model routing, memory backend,
memorySearch/RAG, pdfModel/pdfMax* tool limits) and all paired surfaces
(TS types, help/label entries, test assertions, dead passthrough).
No migration infrastructure added — features were gutted months ago, so
configs carrying these fields now fail zod strict validation with
"Unrecognized key", signalling a one-time manual edit.
Removals:
- zod-schema.core.ts: ModelDefinition{.api,.compat} + ModelProvider.api
- zod-schema.agent-defaults.ts: pdfModel/pdfMaxBytesMb/pdfMaxPages + memorySearch stubs
- zod-schema.ts: top-level memory stub
- zod-schema.agent-runtime.ts: full MemorySearchSchema + AgentEntry.memorySearch
- types.agent-defaults.ts + types.agents.ts: pdfModel/pdfMax*/memorySearch declarations
- schema.help.ts (~50 entries) + schema.labels.ts (~50 entries): memorySearch/pdf/memory docs
- schema.help.quality.test.ts: memorySearch path assertions + "memory" ROOT_SECTION
- agent-scope.ts: dead memorySearch passthrough in ResolvedAgentConfig
Obsolete compat-stub tests removed:
- config.schema-regressions.test.ts: legacy memorySearch / pdf* accept tests
- config.secrets-schema.test.ts: legacy model provider api tolerance test
- config-misc.test.ts: legacy api/compat fields accept test
- status.scan.test.ts: two zombie tests mocking a non-existent deps module
Replaced sensitive-path fixtures in redact-snapshot tests: memorySearch.remote.apiKey
→ models.providers.{openai,anthropic}.apiKey (still sensitive, still exists).
New adversarial regression tests in config-misc.test.ts verify each cluster
gets rejected with "Unrecognized key": top-level memory, defaults.memorySearch,
per-agent memorySearch, defaults.pdfModel + pdf limits, ModelDefinition.api/compat,
ModelProvider.api.
Generated artifacts regenerated: schema.base.generated.ts, config-baseline.json.
Closes #2489
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
Closes #2489. Consolidates the middleware-not-platform boundary by removing 8
z.unknown()stubs that described LLM-platform concerns (model API routing / capability flags, memory backend, memorySearch/RAG, PDF tool limits) plus all paired surfaces (TS types, help/label docs, test assertions, dead passthrough). Also reverts Option-A additions from #2478 (api/compatstubs added in the same batch where the fork pivoted to Option B).No migration infrastructure is added — the underlying features were gutted months ago, so configs carrying these fields now fail zod strict validation with
Unrecognized key, signalling a one-time manual edit.What was removed
Cluster A — Model API routing / capability flags (zero production readers)
ModelDefinition.{api, compat},ModelProvider.apiinzod-schema.core.tsCluster B — PDF tool stubs (zero production readers, divergent TS types)
pdfModel,pdfMaxBytesMb,pdfMaxPagesinzod-schema.agent-defaults.ts+types.agent-defaults.ts+ help/labelsCluster C — Top-level memory backend (zero production readers)
memory: z.unknown()atRemoteClawSchemaroot + top-levelmemoryhelp/label/ROOT_SECTIONS entryCluster D — memorySearch / RAG (zero production reads; only a dead passthrough in
agent-scope.ts)AgentDefaults.memorySearchstub +AgentEntry.memorySearchfull structured schema (including the completeMemorySearchSchemadefinition ~150 lines)types.agent-defaults.ts+types.agents.tsmemorySearch declarationsschema.help.tsentries + ~40schema.labels.tsentriesschema.help.quality.test.tsmemorySearch path assertionsagent-scope.ts:73,179dead passthrough inResolvedAgentConfigObsolete tests cleaned up
config.schema-regressions.test.ts: three compat-stub accept tests (memorySearch, pdf default, pdf legacy)config.secrets-schema.test.ts: legacyapitolerance testconfig-misc.test.ts:accepts legacy api and compat fieldsteststatus.scan.test.ts: two zombie tests mocking a non-existentstatus.scan.deps.runtime.jsmoduleNew adversarial regression tests
config-misc.test.ts § gutted LLM-platform fields are rejected (#2489)— verifies each removed cluster is rejected by zod strict parsing.Redact-snapshot test fixtures migrated
memorySearch.remote.apiKey→models.providers.{openai,anthropic}.apiKey(different sensitive path, same redaction mechanism).Generated artifacts
Regenerated via
scripts/generate-base-config-schema.tsandscripts/generate-config-doc-baseline.ts:src/config/schema.base.generated.tsdocs/.generated/config-baseline.jsonTest plan
pnpm format:checkcleanpnpm tsgo— nosrc/errorspnpm lint— 0 warnings, 0 errorspnpm test— 800 files, 7014 tests passrg "memorySearch|pdfModel|pdfMaxBytesMb|pdfMaxPages" src/returns only references in new rejection testsLIVE=1 pnpm test:liveskipped because changes do not touchsrc/middleware/.🤖 Generated with Claude Code