Conversation
… static schema pre-registration
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — Clean extraction of a reusable resolveSettings() template method into NativeToolEngine, and safe removal of static schema pre-registration that was already redundant with the bootstrap flow.
Verification
- No broken consumers: The removed re-exports (
ClaudeCodeSettingsSchema,CodexSettingsSchema,OpenCodeSettingsSchemaand their type aliases) fromsrc/config/engineSettings.tsare not imported from that path by any remaining file — all consumers import directly from their respective enginesettings.tsmodules. - Bootstrap coverage: All entry points (
router/index.ts,worker-entry.ts,dashboard.ts) plus the agent registry callregisterBuiltInEngines()before config parsing, so dynamic registration is guaranteed. resolveSettings()correctness: The implementation correctly delegates togetEngineSettings()withthis.definition.idas the key, handles thenull/undefinedcase by falling back to{}, and the??operator correctly prefersinput.engineSettingsoverinput.project.engineSettings.- Tests are well-structured: 5 test cases cover the key scenarios (no settings, project-level, override precedence, missing engine key, correct engine id lookup). The
resolveSettingsPublicwrapper pattern for exposing protected methods is a clean, common Vitest approach. - CI passes: All 7 checks green including lint, typecheck, unit tests, and integration tests.
Notes
The new resolveSettings() method is not yet used by any concrete engine (Claude Code, Codex, and OpenCode still use their own resolveXxxSettings() helper functions that also apply defaults). This is fine — it's an incremental step that lays groundwork for subclasses to migrate to the shared method later, and the existing per-engine resolve*Settings() functions do more than just parse (they apply defaults and return a Resolved*Settings type), so they can't be trivially replaced yet.
🕵️ claude-code · claude-opus-4-6 · run details
Summary
protected resolveSettings<S>()template method toNativeToolEnginebase class that readsinput.engineSettings ?? input.project.engineSettingsand validates via the engine's schema identified bythis.definition.idClaudeCodeSettingsSchema,CodexSettingsSchema,OpenCodeSettingsSchemafromsrc/config/engineSettings.ts(lines 1-12 import block and lines 24-26 pre-registration)registerEngineWithSettings()inbootstrap.ts, which is called by all entry points before config parsingTest plan
resolveSettings()inNativeToolEngine.test.ts(5 cases)registerBuiltInEngines()before config parsing — verifiedCard: https://trello.com/c/69c1aaa53b8e204b0317a47d
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details