Skip to content

Make compaction threshold an optional runtime override - #844

Merged
govindavashishtha merged 4 commits into
mainfrom
feat/compaction-threshold-toggle
Sep 23, 2026
Merged

govindavashishtha merged 4 commits into
mainfrom
feat/compaction-threshold-toggle

Conversation

@govindavashishtha

Copy link
Copy Markdown
Contributor

Summary

  • Add a custom compaction threshold toggle in runtime config (off by default; no trigger so the runtime derives ~80% of the model context window).
  • Turning the toggle on writes trigger: { type: 'input_tokens', value: 50000 } and shows an editable number input to the left of the switch; turning it off drops trigger entirely.
  • Clarify Context compaction copy and cover toggle on/off in UI tests.

Test plan

  • Open Runtime Config → Context compaction: custom threshold switch is off and no number input is shown
  • Toggle custom threshold on: input appears with 50000; config includes trigger
  • Change the input value and confirm it persists in the draft config
  • Toggle custom threshold off: input disappears and trigger is removed from config
  • With Context compaction off, custom threshold row is disabled/dimmed
  • pnpm --filter @truefoundry/trueforge-ui exec vitest run test/atoms/draft/AgentConfigEditors.test.tsx

Made with Cursor

Default omits trigger so the runtime derives 80% of the model context window; toggling on writes a 50000-token input_tokens trigger and shows the editable input.

Co-authored-by: Cursor <cursoragent@cursor.com>
@changeset-bot

changeset-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3c09e99

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…. The default mode is now Auto, which derives the threshold from the model context window, while Custom allows manual input with a default of 50,000 tokens. Update related tests to reflect these changes.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3d98bfe. Configure here.

Comment thread packages/trueforge-ui/src/atoms/draft/AgentRuntimeConfigFields.tsx
@govindavashishtha
govindavashishtha enabled auto-merge (squash) September 23, 2026 04:25
@govindavashishtha
govindavashishtha merged commit 73e146e into main Sep 23, 2026
10 checks passed
@govindavashishtha
govindavashishtha deleted the feat/compaction-threshold-toggle branch September 23, 2026 04:30
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.

2 participants