feat(config): drive effort capabilities from provider config (#2963)#3037
feat(config): drive effort capabilities from provider config (#2963)#3037Bernardxu123 wants to merge 5 commits into
Conversation
|
Running the e2e suite to confirm this does not regress cache-hit % (watching the regression in #3091 before we merge any cache-sensitive change). /e2e |
🤖 Reasonix e2e benchmarkAccuracy: 3/4 (75%) · Cache hit: 78% · Tokens: 131,517 (prompt 129,698 / completion 1,819) · Compactions: 0 · Cost: ¥ 0.0336
Real provider run. Cache-hit % is cached prompt tokens / total prompt tokens. |
|
Re-running the suite — the previous run showed 3/4 (the compaction task failed) and a 63% cache hit on that task; checking whether that was a stochastic single-sample miss before we judge this PR. /e2e |
🤖 Reasonix e2e benchmarkAccuracy: 4/4 (100%) · Cache hit: 79% · Tokens: 167,392 (prompt 165,120 / completion 2,272) · Compactions: 0 · Cost: ¥ 0.0412
Real provider run. Cache-hit % is cached prompt tokens / total prompt tokens. |
Summary
Close #2963: drive
/effortcapability from provider config (instead of hard-coding the level list ininternal/config/effort.go).Two new optional
[[providers]]keys land everywhere (TOML, Go struct, Go renderer, desktop settings panel, i18n, example toml):supported_efforts = ["low", "medium", "high", ...]— non-empty list means/effort <level>is accepted for this provider (the literalautois always prepended to the level set, matching the existing UI/UX).default_effort = "medium"— applied when the user has not set an effort explicitly; falls back tosupported_efforts[0]if blank or not in the list, and is required to be one of the supported levels.Nothing changes for the bundled presets.
mimo-pro/mimo-flashkeep nosupported_efforts, so they remain rejected by/effort(preservingTestEffortCommandRejectsUnsupportedProvider).DeepSeekandanthropickeep their hard-coded capability paths — users can still opt-in to a custom list by TOML-overriding, but they don't have to.Why a v2
The earlier draft attached
supported_effortsto themimo-*presets inDefault(). That made/effortstart acceptingmimo-pro(which the test in #2963 was specifically designed to reject), so v1 had to be reworked.v2 instead treats
supported_effortsas a pure opt-in knob:Default()provider list is unchanged — the existing rejection test stays green.[[providers]]block inreasonix.example.toml).RenderTOMLonly emits the new keys when non-empty, so existing~/.config/reasonix/config.tomlfiles round-trip byte-for-byte.Commits (5)
config: add SupportedEfforts/DefaultEffort to ProviderEntry— struct + TOML tags.config(effort): support config-driven SupportedEfforts/DefaultEffort— capability + normalize branches ineffort.go; prependingauto; default-effort fallback tosupported_efforts[0]when blank or unknown.config(render): emit supported_efforts/default_effort in TOML output— round-trip output; only emit when non-empty.config: cover config-driven effort paths in tests— 4 new tests: custom supported, custom normalize, custom default fallback, empty-slice behavior.desktop+ui: expose supported_efforts/default_effort in settings panel— desktopProviderView+ 2 fields,Settings()mapping,SaveProviderround-trip; TS interface + 2 fields; 2 inputs inSettingsPanel(en + zh locales); mock data updated; commented example inreasonix.example.toml.MiMo opt-in story
User adds to
~/.config/reasonix/config.toml:/effort low|medium|high|autothen works formimo-pro. Withoutsupported_effortsset, the existing rejection path is unchanged.Verification
go vet ./...(root + desktop) — exit 0go test ./...(root,REASONIX_RELEASE_CACHE_GUARD=1) — exit 0go test ./...(desktop) — exit 0pnpm build(desktop frontend) — 0 TS errorsgofmt -lon changed Go files (in LF form) — cleanTestEffortCapabilityCustomSupportedEfforts,TestNormalizeEffortCustomSupportedEfforts,TestNormalizeEffortCustomDefaultEffort,TestEffortCapabilityEmptySupportedEffortsNotConfigurable— all passTestEffortCommandRejectsUnsupportedProviderstill passesRisk register
en.tsandzh.tsare updated; if a third locale exists it would lose the new keys. The repo currently only ships en + zh, but a TODO is left in code review for any future locale authors.SaveProvidernow writes 2 new fields; users with provider entries that previously hadeffort = "high"would round-trip toeffort = "high"+ (emptydefault_effort), whichRenderTOMLskips. No data loss.pnpm-lock.yamlis intentionally not committed in log-frame: migrateplan-resumedrole from ink to frame #5; an unrelated pnpm 11 housekeeping diff (deprecatedoverrides, newlibcentries) was reverted.Files
Test plan
test(ubuntu/macos/windows),race(ubuntu),desktop(ubuntu),lint(golangci-lint),coveragesupported_efforts = ["low","medium","high"]anddefault_effort = "medium"→ save → reopen config.toml → see the keys present → start CLI session →/effort highacceptedmimo-prowithoutsupported_effortsset →/effort highrejected with the same error message as beforeRef: #2963