Skip to content

Replace evolution iteration limit with token budget#272

Draft
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/ENG-525-linear-issue-triage-automation-d638
Draft

Replace evolution iteration limit with token budget#272
cursor[bot] wants to merge 4 commits into
mainfrom
cursor/ENG-525-linear-issue-triage-automation-d638

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented Jun 1, 2026

Summary

  • Adds a configurable maxTokenBudget preference and CLI flag for evolutions.
  • Stops evolution at the next loop pause when provider-reported token usage reaches the budget, while keeping build-attempt ceilings independent.
  • Replaces the Settings “Max Iterations” control with “Token Budget” and shows live cumulative token spend in the evolution progress overlay.
  • Keeps the legacy iteration setting only as an internal fallback for providers that do not report token usage.

Resolves ENG-525

Test Plan

  • bun -F native lint
  • bun -F native build
  • bun -F native test:unit
  • bun -F native test:storybook -- "src/components/widget/settings/ai-models-tab.stories.tsx" "src/components/widget/overlays/evolve-progress.stories.tsx"
  • bun -F native test:storybook -- "src/components/widget/widget.stories.tsx"

Notes:

  • cargo +stable check --locked --manifest-path apps/native/src-tauri/Cargo.toml and cargo +stable run --locked --example specta_gen_ts are blocked in this Linux runner by missing system library gdk-3.0.
  • The full storybook suite still has unrelated snapshot mismatches in rebuild-overlay-panel.stories.tsx and file-view.stories.tsx; changed PR story surfaces pass.

Docs

  • Docs updated (companion PR in darkmatter/nixmac-web: #___)
  • No docs update needed
Open in Web View Automation 

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

Co-authored-by: cooper <czxtm@users.noreply.github.com>
Co-authored-by: cooper <czxtm@users.noreply.github.com>
Co-authored-by: cooper <czxtm@users.noreply.github.com>
Co-authored-by: cooper <czxtm@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Warnings
⚠️ PR is marked WIP / draft — do not merge until ready for review.
⚠️ Please assign this PR to someone (usually yourself).
Messages
📖 No docs update needed — acknowledged.

📋 PR Overview

Lines changed 355 (+254 / -101)
Files 0 added, 21 modified, 0 deleted
Draft / WIP yes
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

🔬 Coverage

Report Lines Statements Functions Branches
apps/native/coverage/coverage-summary.json 17.9% 17.9% 30.8% 54.1%

Generated by 🚫 dangerJS against f2b4863

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