mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 09:04:26 +00:00
feat: add xhigh thinking level support for gpt-5.2 and gpt-5.2-codex
- Add XHIGH_MODELS constant and getAvailableThinkingLevels() to AgentSession - Update ThinkingSelectorComponent to accept availableLevels parameter - Both shift+tab cycling and /thinking command now show xhigh for supported models - Update types.ts documentation to list supported models
This commit is contained in:
parent
b24a2ec037
commit
4f981d8ebc
4 changed files with 52 additions and 16 deletions
|
|
@ -3,28 +3,40 @@ import { Container, type SelectItem, SelectList } from "@mariozechner/pi-tui";
|
|||
import { getSelectListTheme } from "../theme/theme.js";
|
||||
import { DynamicBorder } from "./dynamic-border.js";
|
||||
|
||||
const LEVEL_DESCRIPTIONS: Record<ThinkingLevel, string> = {
|
||||
off: "No reasoning",
|
||||
minimal: "Very brief reasoning (~1k tokens)",
|
||||
low: "Light reasoning (~2k tokens)",
|
||||
medium: "Moderate reasoning (~8k tokens)",
|
||||
high: "Deep reasoning (~16k tokens)",
|
||||
xhigh: "Maximum reasoning (~32k tokens)",
|
||||
};
|
||||
|
||||
/**
|
||||
* Component that renders a thinking level selector with borders
|
||||
*/
|
||||
export class ThinkingSelectorComponent extends Container {
|
||||
private selectList: SelectList;
|
||||
|
||||
constructor(currentLevel: ThinkingLevel, onSelect: (level: ThinkingLevel) => void, onCancel: () => void) {
|
||||
constructor(
|
||||
currentLevel: ThinkingLevel,
|
||||
availableLevels: ThinkingLevel[],
|
||||
onSelect: (level: ThinkingLevel) => void,
|
||||
onCancel: () => void,
|
||||
) {
|
||||
super();
|
||||
|
||||
const thinkingLevels: SelectItem[] = [
|
||||
{ value: "off", label: "off", description: "No reasoning" },
|
||||
{ value: "minimal", label: "minimal", description: "Very brief reasoning (~1k tokens)" },
|
||||
{ value: "low", label: "low", description: "Light reasoning (~2k tokens)" },
|
||||
{ value: "medium", label: "medium", description: "Moderate reasoning (~8k tokens)" },
|
||||
{ value: "high", label: "high", description: "Deep reasoning (~16k tokens)" },
|
||||
];
|
||||
const thinkingLevels: SelectItem[] = availableLevels.map((level) => ({
|
||||
value: level,
|
||||
label: level,
|
||||
description: LEVEL_DESCRIPTIONS[level],
|
||||
}));
|
||||
|
||||
// Add top border
|
||||
this.addChild(new DynamicBorder());
|
||||
|
||||
// Create selector
|
||||
this.selectList = new SelectList(thinkingLevels, 5, getSelectListTheme());
|
||||
this.selectList = new SelectList(thinkingLevels, thinkingLevels.length, getSelectListTheme());
|
||||
|
||||
// Preselect current level
|
||||
const currentIndex = thinkingLevels.findIndex((item) => item.value === currentLevel);
|
||||
|
|
|
|||
|
|
@ -1301,6 +1301,7 @@ export class InteractiveMode {
|
|||
this.showSelector((done) => {
|
||||
const selector = new ThinkingSelectorComponent(
|
||||
this.session.thinkingLevel,
|
||||
this.session.getAvailableThinkingLevels(),
|
||||
(level) => {
|
||||
this.session.setThinkingLevel(level);
|
||||
this.updateEditorBorderColor();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue