Skip to content

feat(modes): let users edit builtin modes; drop the Goal budget setting - #2380

Merged
vastsa merged 2 commits into
mainfrom
refactor/remove-goal-budget-setting
Nov 16, 2026
Merged

vastsa merged 2 commits into
mainfrom
refactor/remove-goal-budget-setting

Conversation

@vastsa

@vastsa vastsa commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Why

Modes are defined by Markdown files, so the separate Goal budget setting duplicated the Goal definition's budget. Builtins were read-only, which left the setting as the only way to change it.

What changes

  • ~/.pi/modes/<agent|plan|goal>/mode.md overrides that builtin. Settings → Modes edits builtins in place; Restore default deletes the file.
  • An override must keep the shape the id-keyed behavior relies on (Agent/Plan simple at agent/contract; Goal staged, returnTo: agent). An invalid override is reported and the shipped definition stays in effect.
  • A document outside a builtin's folder that claims its id is still reserved and not loaded.
  • AppSettings.goalBudget, its settings row, Host validation and copy are removed. A stored value is ignored; new Goal runs take the definition budget.
  • ModeCatalogEntry.customized is added (additive).

Validation

  • agent-runtime vitest: 2034 passed
  • desktop mode tests incl. Electron user path (edit → save → restore a builtin): passed
  • desktop + package typecheck, i18n tests, biome lint, cargo fmt --check: passed
  • scripts/e2e-goal-layout.mjs: 8 cases, 1456 checks, 0 failures
  • Pre-existing on origin/main (not touched here): host-core plugins::tests::a_valid_id_cannot_take_over_a_legacy_plugin_stored_under_its_sanitized_name, rpc::review_rpc_tests::review_rpc_records_workspace_scratch_and_approved_external_write_edit; desktop extension row actions stay visible and labelled.

Compatibility

Users who set a Goal budget in settings return to 20 turns until they edit the Goal mode file.

Modes are now defined by Markdown files, so a separate settings value for
the Goal default budget duplicated what the Goal definition already
declares. Builtin modes were read-only, which left the setting as the only
way to change that budget.

A document in a builtin's own folder (~/.pi/modes/<id>/mode.md) now
overrides that builtin. Settings -> Modes edits it in place and Restore
default deletes the file. An override must keep the shape the id-keyed
behavior relies on; an invalid one is reported and the shipped definition
stays in effect. A stored goalBudget value is ignored from now on.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Deploying pi-desktop with  Cloudflare Pages  Cloudflare Pages

Latest commit: 76c8c8b
Status: ✅  Deploy successful!
Preview URL: https://0bf5fb91.pi-desktop.pages.dev
Branch Preview URL: https://refactor-remove-goal-budget.pi-desktop.pages.dev

View logs

@vastsa
vastsa merged commit e17e5e7 into main Nov 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant