You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The isV1() function in packages/core/src/v1/config/migrate.ts determines whether a config file uses V1 or V2 format by checking for specific keys. The key set is missing "compaction", so configs that ONLY set compaction.* fields (without V1-specific keys like provider, agent, etc.) are treated as V2 format.
Root Cause
When isV1() returns false, the config goes through V2 schema decoding directly. The V2 ConfigCompaction.Info schema does not recognize preserve_recent_tokens (a V1 field) - it only knows keep.tokens. Since V2 has onExcessProperty: "ignore", the preserve_recent_tokens value is silently dropped.
Impact
Users who configure compaction in a minimal config:
...will have preserve_recent_tokens silently ignored without warning. The compaction system uses the default token budget (8000) instead of the user's configured value (500000).
Steps to reproduce
Create an opencode.jsonc with ONLY compaction.preserve_recent_tokens: 500000 and no V1-specific keys
isV1() returns false
The value is silently dropped by V2 schema decoding
Compaction uses default 8000 tokens instead of 500000
Activity