Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 0 additions & 108 deletions docs/design/heterogeneous-model-guide.md

This file was deleted.

13 changes: 0 additions & 13 deletions internal/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ type Agent struct {
taintInfluence *taintInfluenceState // tainted data influence detection (IFC: tracks untrusted content flowing into privileged tool calls)
falsePremise *falsePremiseState // false premise detection: ungrounded success claims contradicting tool errors (world-model drift)
perfBaseline *perfBaselineState // cross-session performance regression detection
heterogeneousModel *heterogeneousModelState // FinOps: heterogeneous model selection guidance (sa-131)
lastRunStats *RunStats // stats from the most recent run (for post-run summary display)
qualityScorer *ResponseQualityScorer // per-run response quality scoring for provider/model A/B comparison
systemPromptInjector func() string // returns extra system prompt text to inject (e.g. lanchat peer warnings)
Expand Down Expand Up @@ -463,7 +462,6 @@ func NewAgent(p provider.Provider, tools *tool.Registry, systemPrompt string, ma
toolEquivDetect: newToolEquivDetectState(),
bgOrphan: newBgOrphanState(),
actionAnnihil: newActionAnnihilateState(),
heterogeneousModel: newHeterogeneousModelState(),
exploreFrag: newExploreFragState(),
batchCoupling: newBatchCouplingState(),
buildIdempot: newBuildIdempotencyState(),
Expand Down Expand Up @@ -1377,11 +1375,6 @@ func (a *Agent) RunStreamWithContent(ctx context.Context, content []provider.Con
a.buildIdempot.reset()
a.orphanFile.reset()
a.cfDep.reset()
// #1466-A: the per-run reset block's own #677 note lists the
// same-family misses it fixed - heterogeneousModel was missed too:
// hmMaxWarns=1 burned in run 1 kept the detector silent for every
// later run of the Agent's lifetime.
a.heterogeneousModel.reset()
// #1843 case 1: foresightCalib.reset() was never called outside
// compaction - "at most 2 per run" (file-header promise) was in fact
// per-LIFETIME: mismatches and warnCount accumulated across every
Expand Down Expand Up @@ -3904,12 +3897,6 @@ func (a *Agent) RunStreamWithContent(ctx context.Context, content []provider.Con
// Query convergence tracking: record search queries and code
// actions to detect repeated similar searches without progress.
a.queryConverge.recordToolCall(tc.Name, string(tc.Arguments), i+1)
// cost-effective model tier selection. Detects execution-heavy
// patterns and suggests using cheaper models for routine work.
// Research basis: 2025-2026 AI Agent trends (Deloitte, Machine Learning Mastery)
if hmGuidance := a.heterogeneousModel.recordToolCall(tc.Name, i+1); hmGuidance != "" {
a.appendGuidance(&result, hmGuidance)
}
// Plan drift capture: when exit_plan_mode fires, extract plan items
// for later drift detection (spec-driven development tracking).
if tc.Name == "exit_plan_mode" {
Expand Down
7 changes: 0 additions & 7 deletions internal/agent/guidance_compact_reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,6 @@ var guidanceCounterResets = []func(*Agent){
a.phantomVerify.warnings = 0
}
},
func(a *Agent) {
if a.heterogeneousModel != nil {
a.heterogeneousModel.mu.Lock()
a.heterogeneousModel.warnsIssued = 0
a.heterogeneousModel.mu.Unlock()
}
},
func(a *Agent) {
if a.selfMod != nil {
a.selfMod.mu.Lock()
Expand Down
20 changes: 8 additions & 12 deletions internal/agent/guidance_compact_reset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,14 @@ func TestBClassDetectorsOncePerRun(t *testing.T) {
// (int counter, quota map, quota bools) must all reset.
func TestResetGuidanceCounters1651Extension(t *testing.T) {
a := &Agent{
trajectoryHealth: &trajectoryHealthState{warnings: 2},
planAbandon: &planAbandonState{warnings: 1},
delegationOrch: &delegationState{orphanWarnCount: 1, serialWarnCount: 2, overDelWarned: true},
fixAmnesia: newFixAmnesiaState(),
heterogeneousModel: &heterogeneousModelState{warnsIssued: 1},
driftRecurrence: &driftRecurrenceState{fired: true, warned: true},
crossFileImpact: &crossFileImpactState{fired: true},
serialRead: &serialReadState{fired: true},
diskSpace: &diskSpaceState{fired: true},
trajectoryHealth: &trajectoryHealthState{warnings: 2},
planAbandon: &planAbandonState{warnings: 1},
delegationOrch: &delegationState{orphanWarnCount: 1, serialWarnCount: 2, overDelWarned: true},
fixAmnesia: newFixAmnesiaState(),
driftRecurrence: &driftRecurrenceState{fired: true, warned: true},
crossFileImpact: &crossFileImpactState{fired: true},
serialRead: &serialReadState{fired: true},
diskSpace: &diskSpaceState{fired: true},
}
a.fixAmnesia.mu.Lock()
a.fixAmnesia.warned["build"] = true
Expand All @@ -128,9 +127,6 @@ func TestResetGuidanceCounters1651Extension(t *testing.T) {
if len(a.fixAmnesia.warned) != 0 {
t.Fatal("fixAmnesia warned map must clear")
}
if a.heterogeneousModel.warnsIssued != 0 {
t.Fatal("heterogeneousModel quota must reset")
}
if a.driftRecurrence.fired || a.driftRecurrence.warned || a.crossFileImpact.fired || a.serialRead.fired || a.diskSpace.fired {
t.Fatal("quota bools must reset")
}
Expand Down
Loading
Loading