Add auto_compact_enabled setting and /autocompact command#44
Merged
Conversation
Add a boolean setting 'auto_compact_enabled' (default: true) that controls whether the auto_compact tool is registered with the provider. When disabled, the model never sees auto_compact as an available tool. - New /autocompact [on|off] slash command to toggle at runtime - Supported in global settings and per-project config - Shown in /settings, /project-settings, and /debug output - Project override takes precedence over global setting
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new auto_compact_enabled configuration flag (default true) to control whether the auto_compact tool is exposed to the model, plus a /autocompact slash command to view/toggle the setting at runtime. This fits into TinyHarness’s existing settings + per-project override model and tool-registration pipeline.
Changes:
- Introduces
Settings.auto_compact_enabledandProjectSettings.auto_compact_enabled, merged intoMergedSettings. - Filters the tool list sent to the provider to exclude
auto_compactwhen disabled. - Adds
/autocompactcommand and surfaces the setting in/settings,/project-settings, and/debug.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tinyharness-lib/src/tools/mod.rs | Adds filtering so auto_compact can be omitted from advertised tools based on settings. |
| tinyharness-lib/src/config/mod.rs | Adds the new setting to global/project structs and merge logic. |
| src/commands/settings.rs | Displays global auto-compact status in /settings. |
| src/commands/project_settings.rs | Displays merged auto-compact status in /project-settings and updates init template comments. |
| src/commands/mod.rs | Registers /autocompact and its subcommands. |
| src/commands/debug.rs | Includes auto-compact status in debug dump output. |
| src/commands/config_settings.rs | Implements /autocompact global setting toggle. |
| src/agent/tui_loop.rs | Uses merged settings when building tool list per provider call (TUI path). |
| src/agent/mod.rs | Uses merged settings when building tool list per provider call (non-TUI path). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a boolean setting 'auto_compact_enabled' (default: true) that controls whether the auto_compact tool is registered with the provider. When disabled, the model never sees auto_compact as an available tool.