Skip to content

Commit d466761

Browse files
committed
chore: subagent tool classifier
1 parent c9a6fd7 commit d466761

5 files changed

Lines changed: 8 additions & 24 deletions

File tree

internal/agent/session_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func TestSwitchSessionKeepsCurrentStateOnModelRestoreFailure(t *testing.T) {
385385
"openai": {APIKey: "k"},
386386
},
387387
ContextWindow: 128000,
388-
AutoCompaction: false,
388+
389389
MaxTurns: 30,
390390
},
391391
Cwd: dir,
@@ -445,7 +445,7 @@ func TestSetModelKeepsStateWhenPersistFails(t *testing.T) {
445445
"openai": {APIKey: "k"},
446446
},
447447
ContextWindow: 128000,
448-
AutoCompaction: false,
448+
449449
MaxTurns: 30,
450450
},
451451
Cwd: dir,
@@ -514,7 +514,7 @@ func TestSetModelDoesNotRewriteGlobalSettings(t *testing.T) {
514514
"anthropic": {APIKey: "anthropic-key"},
515515
},
516516
ContextWindow: 128000,
517-
AutoCompaction: false,
517+
518518
MaxTurns: 30,
519519
},
520520
Cwd: dir,
@@ -677,7 +677,7 @@ func TestApplySkillInvocationUsesTemporaryOverrides(t *testing.T) {
677677
Model: "base-model",
678678
ThinkingLevel: "low",
679679
ContextWindow: 128000,
680-
AutoCompaction: false,
680+
681681
MaxTurns: 30,
682682
Providers: map[string]config.ProviderConfig{
683683
"openai": {APIKey: "k", Models: []string{"base-model", "skill-model"}},

internal/bootstrap/subagents.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ func newSubAgentContextManager(model agentcore.ChatModel, window int) agentcore.
121121
ContextWindow: window,
122122
Strategies: []agentctx.Strategy{
123123
agentctx.NewToolResultMicrocompact(agentctx.ToolResultMicrocompactConfig{
124+
Classifier: agent.CodebotToolClassifier,
124125
KeepRecent: 3,
125126
}),
126127
agentctx.NewLightTrim(agentctx.LightTrimConfig{}),

internal/config/settings.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ type Settings struct {
9191

9292
ContextWindow *int `json:"context_window,omitempty"`
9393

94-
AutoCompaction *bool `json:"auto_compaction,omitempty"`
95-
9694
ThinkingLevel *string `json:"thinking_level,omitempty"`
9795

9896
MaxTurns *int `json:"max_turns,omitempty"`
@@ -120,9 +118,8 @@ type Resolved struct {
120118
SmallModel string // sub-agent model; equals Model when not configured
121119
Providers map[string]ProviderConfig // per-provider credentials
122120

123-
ContextWindow int // auto-detected from model registry at boot
124-
AutoCompaction bool
125-
ThinkingLevel string
121+
ContextWindow int // auto-detected from model registry at boot
122+
ThinkingLevel string
126123
MaxTurns int
127124
SearchProvider string
128125
SearchAPIKey string
@@ -197,8 +194,7 @@ func (s Settings) Resolve() Resolved {
197194
r := Resolved{
198195
Provider: "openai",
199196
Providers: make(map[string]ProviderConfig),
200-
AutoCompaction: true,
201-
ThinkingLevel: "low",
197+
ThinkingLevel: "low",
202198
MaxTurns: 200,
203199
}
204200
if s.Provider != nil && *s.Provider != "" {
@@ -218,9 +214,6 @@ func (s Settings) Resolve() Resolved {
218214
r.Providers[k] = *v
219215
}
220216
}
221-
if s.AutoCompaction != nil {
222-
r.AutoCompaction = *s.AutoCompaction
223-
}
224217
if s.ThinkingLevel != nil {
225218
r.ThinkingLevel = *s.ThinkingLevel
226219
}
@@ -399,9 +392,6 @@ func mergeSettings(base, override Settings) Settings {
399392
base.Providers[k] = existing
400393
}
401394
}
402-
if override.AutoCompaction != nil {
403-
base.AutoCompaction = override.AutoCompaction
404-
}
405395
if override.ThinkingLevel != nil {
406396
base.ThinkingLevel = override.ThinkingLevel
407397
}

internal/ui/command.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,6 @@ func (a *App) cmdSettings() tea.Cmd {
430430
valueStyle := lipgloss.NewStyle().Foreground(tui.ColorSoftText)
431431
metaStyle := lipgloss.NewStyle().Foreground(tui.ColorToken)
432432

433-
autoCompact := "off"
434-
if s.AutoCompaction {
435-
autoCompact = "on"
436-
}
437-
438433
var sb strings.Builder
439434
renderRow := func(label, value string) {
440435
sb.WriteString(labelStyle.Render(fmt.Sprintf("%-16s", label)))
@@ -456,7 +451,6 @@ func (a *App) cmdSettings() tea.Cmd {
456451
sb.WriteString("\n")
457452
renderRow("Thinking", thinking)
458453
renderRow("Context", tui.FormatTokens(s.ContextWindow))
459-
renderRow("Auto compact", autoCompact)
460454
renderRow("Max turns", fmt.Sprintf("%d", s.MaxTurns))
461455
renderMetaRow("Config", config.SettingsPath(a.Cwd))
462456

settings.example.jsonc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
},
4343

4444
"context_window": 128000, // tokens
45-
"auto_compaction": true, // compact when context fills up
4645
"thinking_level": "low", // off | low | medium | high | xhigh
4746
"max_turns": 30,
4847

0 commit comments

Comments
 (0)