feat(tui): use configured compaction threshold for /context output
This commit is contained in:
@@ -50,6 +50,7 @@ export interface AppProps {
|
||||
agent?: NativeAgent;
|
||||
hookEngine?: HookEngine;
|
||||
modelProviderConfigs?: Partial<Record<ModelProvider, ModelConfig>>;
|
||||
contextThresholdPct?: number;
|
||||
onExit?: () => void;
|
||||
}
|
||||
|
||||
@@ -62,6 +63,7 @@ export function App({
|
||||
agent,
|
||||
hookEngine,
|
||||
modelProviderConfigs,
|
||||
contextThresholdPct,
|
||||
onExit,
|
||||
}: AppProps): React.ReactElement {
|
||||
const { exit } = useApp();
|
||||
@@ -247,7 +249,7 @@ export function App({
|
||||
const modelName = modelRouter?.getLabel(tier) ?? model;
|
||||
const window = getContextWindow(modelName);
|
||||
const usagePct = window > 0 ? (estimated / window) * 100 : 0;
|
||||
const thresholdPct = 80;
|
||||
const thresholdPct = contextThresholdPct ?? 80;
|
||||
const thresholdTokens = Math.floor((thresholdPct / 100) * window);
|
||||
const remaining = Math.max(0, window - estimated);
|
||||
const text = [
|
||||
|
||||
Reference in New Issue
Block a user