Skip to content

feat(config): persist the new-session work mode via default_work_mode - #7793

Open
lmsn-kang wants to merge 1 commit into
esengine:main-v2from
lmsn-kang:feat/default-work-mode
Open

feat(config): persist the new-session work mode via default_work_mode#7793
lmsn-kang wants to merge 1 commit into
esengine:main-v2from
lmsn-kang:feat/default-work-mode

Conversation

@lmsn-kang

@lmsn-kang lmsn-kang commented Aug 6, 2026

Copy link
Copy Markdown

Adds the top-level default_work_mode key (economy|balanced|delivery) so new sessions start in the configured runtime profile when no --profile flag is passed, mirroring the existing default_model/default_effort persistence. Explicit --profile still wins (flag > config > balanced default); invalid configured values fail exactly like invalid --profile values.

Resolves #7658

Summary

  • New Config.DefaultWorkMode field + TOML parsing (internal/config/config.go)
  • Render the key in full and project-delta config output (internal/config/render.go)
  • resolveRuntimeProfile: flag > config > default precedence, wired into runAgent / runServe / chatREPL after chdirTo so --dir project config is honored (internal/cli/cli.go)
  • Same wiring for the ACP server (internal/cli/acp.go)
  • 7 new tests covering config default, balanced fallback, explicit flag override, stdlib FlagSet path, invalid values, and project config after chdir (internal/cli/default_work_mode_test.go)
  • Docs: reasonix.example.toml + docs/GUIDE.md

Issues

Verification

  • go test ./internal/cli/ ./internal/config/ — all pass
  • gofmt / go vet — clean
  • E2E against a local fake OpenAI provider: default_work_mode = "delivery" injects the prompt block (8207 vs 7700 chars); explicit --profile balanced overrides the config; invalid configured value fails at startup exactly like an invalid --profile value

Documentation impact
Documentation-impact: updated - documents the new default_work_mode key in docs/GUIDE.md and reasonix.example.toml.

Cache impact
Cache-impact: none - the new key only selects the pre-existing profile path at session start; no system-prompt prefix bytes, tool schemas, or cache behavior change.
Cache-guard: go test ./internal/cli/ ./internal/config/ - the change does not touch boot/tool/provider prompt construction.
System-prompt-review: author-verified against the cache-stable prefix contract - no system prompt, memory prefix, output style, or skill index bytes change; delivery/economy injection is the pre-existing --profile path, untouched; maintainer review welcome.

Adds the top-level default_work_mode key (economy|balanced|delivery) so new
sessions start in the configured runtime profile when no --profile flag is
passed, mirroring the existing default_model/default_effort persistence.
Explicit --profile still wins (flag > config > balanced default); invalid
configured values fail exactly like invalid --profile values.

Resolves esengine#7658
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development tui Terminal UI / CLI (internal/cli, internal/control) config Configuration & setup (internal/config) labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 支持持久化新会话默认工作模式 (default_work_mode),让 delivery 与 yolo/max 一样可配置

1 participant