Skip to content

Commit 523a129

Browse files
anandgupta42claude
andcommitted
fix: add dedicated training feature flag and remove unused insight type
- Add `ALTIMATE_DISABLE_TRAINING` flag independent of memory's disable flag - Use new flag in session prompt injection and tool registry - Remove unused `budget-warning` insight type from `TrainingInsight` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1d52086 commit 523a129

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/opencode/src/altimate/training/insights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { TrainingStore, type TrainingEntry } from "./store"
55
import { TRAINING_MAX_PATTERNS_PER_KIND, type TrainingKind } from "./types"
66

77
export interface TrainingInsight {
8-
type: "stale" | "high-value" | "near-limit" | "budget-warning" | "consolidation"
8+
type: "stale" | "high-value" | "near-limit" | "consolidation"
99
severity: "info" | "warning"
1010
message: string
1111
entries?: string[]

packages/opencode/src/flag/flag.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export namespace Flag {
3636
// altimate_change start - opt-in for session-end auto-extraction
3737
export const ALTIMATE_MEMORY_AUTO_EXTRACT = altTruthy("ALTIMATE_MEMORY_AUTO_EXTRACT", "OPENCODE_MEMORY_AUTO_EXTRACT")
3838
// altimate_change end
39+
// altimate_change start - opt-out for AI Teammate training system
40+
export const ALTIMATE_DISABLE_TRAINING = altTruthy("ALTIMATE_DISABLE_TRAINING", "OPENCODE_DISABLE_TRAINING")
41+
// altimate_change end
3942
export const OPENCODE_DISABLE_TERMINAL_TITLE = truthy("OPENCODE_DISABLE_TERMINAL_TITLE")
4043
export const OPENCODE_PERMISSION = process.env["OPENCODE_PERMISSION"]
4144
export const OPENCODE_DISABLE_DEFAULT_PLUGINS = truthy("OPENCODE_DISABLE_DEFAULT_PLUGINS")

packages/opencode/src/session/prompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ export namespace SessionPrompt {
698698
// Inject persistent memory blocks from previous sessions (gated by feature flag)
699699
const memoryInjection = Flag.ALTIMATE_DISABLE_MEMORY ? "" : await MemoryPrompt.inject()
700700
// altimate_change start - inject training knowledge from AI teammate learning
701-
const trainingInjection = Flag.ALTIMATE_DISABLE_MEMORY ? "" : await TrainingPrompt.inject()
701+
const trainingInjection = Flag.ALTIMATE_DISABLE_TRAINING ? "" : await TrainingPrompt.inject()
702702
// altimate_change end
703703
const system = [
704704
...(await SystemPrompt.environment(model)),

packages/opencode/src/tool/registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export namespace ToolRegistry {
284284
...(!Flag.ALTIMATE_DISABLE_MEMORY ? [MemoryReadTool, MemoryWriteTool, MemoryDeleteTool, MemoryAuditTool, ...(Flag.ALTIMATE_MEMORY_AUTO_EXTRACT ? [MemoryExtractTool] : [])] : []),
285285
// altimate_change end
286286
// altimate_change start - register training tools for AI teammate
287-
...(!Flag.ALTIMATE_DISABLE_MEMORY ? [TrainingSaveTool, TrainingListTool, TrainingRemoveTool] : []),
287+
...(!Flag.ALTIMATE_DISABLE_TRAINING ? [TrainingSaveTool, TrainingListTool, TrainingRemoveTool] : []),
288288
// altimate_change end
289289
...custom,
290290
]

0 commit comments

Comments
 (0)