Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Let Codex conversations pick a larger context window (PRD-8696) (#4640)
Abraham79e2f86b51c7
diff --git a/.changeset/prd-8696-codex-context-window.md b/.changeset/prd-8696-codex-context-window.mdnew file mode 100644index 000000000..83d1d9fcd--- /dev/null+++ b/.changeset/prd-8696-codex-context-window.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge": patch+---++Codex conversations can pick a larger context window from the agent settings popover, using the sizes the installed Codex CLI reports for the selected model. Picking one before the first message relaunches Codex with that window; afterwards the menu offers a new chat instead.diff --git a/packages/app/src/components/acp/ThreadView.dom.test.tsx b/packages/app/src/components/acp/ThreadView.dom.test.tsxindex e9dae504c..157292274 100644--- a/packages/app/src/components/acp/ThreadView.dom.test.tsx+++ b/packages/app/src/components/acp/ThreadView.dom.test.tsx@@ -14,6 +14,7 @@ import { afterEach, describe, expect, test, vi } from 'vitest';import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/components/ui/dialog';import { TooltipProvider } from '@/components/ui/tooltip';import { MAX_TOTAL_ATTACHMENT_BYTES } from '@/lib/acp/image-attachment';+import type { RemoteModelCandidate } from '@/lib/acp/model-candidates';import type {RenderedItem,RenderedTerminal,@@ -35,6 +36,8 @@ const setConfigOption = vi.fn((_threadId: string, _configId: string, _value: string | boolean) => {},);const setMode = vi.fn((_threadId: string, _modeId: string) => {});+let setContextWindowResult: () => Promise<unknown> = () => Promise.resolve({});+const setContextWindow = vi.fn((_threadId: string, _tokens: number) => setContextWindowResult());const prompt = vi.fn((_threadId: string, _content: string) => {});const steer = vi.fn((_threadId: string, _content: string) => {});let editQueuedResult: Promise<void> = Promise.resolve();@@ -67,6 +70,7 @@ vi.doMock('@/lib/acp/thread-client', () => ({removeQueued,setMode,setConfigOption,+ setContextWindow,closeThread: () => {},createThread,resumeThread,@@ -82,6 +86,13 @@ vi.doMock('@/lib/acp/thread-client', () => ({this.code = code;}},+ ThreadContextWindowError: class ThreadContextWindowError extends Error {+ readonly code: string;+ constructor(code: string, message: string) {+ super(message);+ this.code = code;+ }+ },ThreadChannelUnavailableError: class ThreadChannelUnavailableError extends Error {},useAgentThread: () => threadState,useAgentThreadModel: () => model,@@ -107,16 +118,27 @@ vi.doMock('@/editor/ComposerMentionInput', () => ({ComposerMentionInput: MockComposerMentionInput,}));+let modelCandidates: readonly RemoteModelCandidate[] = [];+vi.doMock('@/lib/acp/model-candidates', async () => {+ const actual = await vi.importActual<typeof import('@/lib/acp/model-candidates')>(+ '@/lib/acp/model-candidates',+ );+ return { ...actual, useModelCandidates: () => modelCandidates };+});+const { ThreadView } = await import('./ThreadView');const { resetStagedThreadDrafts, subscribeStagedThreadDraft } = await import('@/lib/acp/thread-draft-staging');const { launchAgentThread } = await import('@/lib/acp/launch-agent-thread');-const { ThreadResumeError } = await import('@/lib/acp/thread-client');+const { ThreadContextWindowError, ThreadResumeError } = await import('@/lib/acp/thread-client');const { buildThreadRenderModel } = await import('@/lib/acp/thread-event-model');-const { agentSettingsKey, getRememberedAgentConfig, getRememberedAgentMode } = await import(- '@/lib/acp/agent-settings-store'-);+const {+ agentSettingsKey,+ getRememberedAgentConfig,+ getRememberedAgentContextWindow,+ getRememberedAgentMode,+} = await import('@/lib/acp/agent-settings-store');function makeInfo(overrides?: Partial<ThreadInfo>): ThreadInfo {return {@@ -457,6 +479,9 @@ afterEach(() => {respondPermission.mockClear();setConfigOption.mockClear();setMode.mockClear();+ setContextWindow.mockClear();+ setContextWindowResult = () => Promise.resolve({});+ modelCandidates = [];prompt.mockClear();steer.mockClear();editQueued.mockClear();@@ -4290,3 +4315,217 @@ describe('ThreadView attachment budget and clear fence (PRD-8453)', () => {expect(screen.queryByTestId('agent-thread-drop-overlay')).toBeNull();});});++describe('ThreadView context window', () => {+ const codex = { id: 'codex-acp', name: 'Codex', source: 'registry' as const };+ const modelOption = {+ id: 'model',+ name: 'Model',+ category: 'model' as const,+ type: 'select' as const,+ currentValue: 'gpt-5.6-sol',+ options: [+ { value: 'gpt-5.6-sol', name: '5.6 Sol' },+ { value: 'gpt-5.5', name: '5.5' },+ ],+ };++ const twoWindows: readonly RemoteModelCandidate[] = [+ {+ value: 'gpt-5.6-sol',+ label: '5.6 Sol',+ contextChoices: [272_000, 872_000],+ context: { effectiveTokens: 258_400, origin: 'native-cli' },+ },+ {+ value: 'gpt-5.5',+ label: '5.5',+ contextChoices: [272_000],+ context: { effectiveTokens: 258_400, origin: 'native-cli' },+ },+ ];++ test('a fresh conversation offers the windows its model supports and remembers the pick', async () => {+ modelCandidates = twoWindows;+ model = makeModel({ turnActive: false, items: [] });+ render(+ <ThreadView+ info={makeInfo({ agent: codex, status: 'ready', configOptions: [modelOption] })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: 'Agent settings' }));+ const row = screen.getByTestId('agent-thread-context-window');+ expect(row.textContent).toContain('Context window');+ expect(row.textContent).toContain('Default');++ await userEvent.click(row);+ expect(await screen.findByTestId('agent-thread-context-window-272000')).toBeTruthy();+ await userEvent.click(screen.getByTestId('agent-thread-context-window-872000'));++ expect(setContextWindow).toHaveBeenCalledWith('thread-1', 872_000);+ await waitFor(() =>+ expect(getRememberedAgentContextWindow(agentSettingsKey(codex))).toBe(872_000),+ );+ });++ test('the row reports the window this thread launched with, not the remembered one', async () => {+ modelCandidates = twoWindows;+ model = makeModel({ turnActive: false, items: [] });+ localStorage.setItem(+ 'ok-acp-agent-settings-v1',+ JSON.stringify({ 'registry:codex-acp': { contextWindow: 872_000 } }),+ );+ render(+ <ThreadView+ info={makeInfo({+ agent: codex,+ status: 'ready',+ contextWindow: 272_000,+ configOptions: [modelOption],+ })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: 'Agent settings' }));+ const row = screen.getByTestId('agent-thread-context-window');+ expect(row.textContent).toContain('272K');+ expect(row.textContent).not.toContain('872K');+ });++ test('a thread that launched with no window of its own reads Default', async () => {+ modelCandidates = twoWindows;+ model = makeModel({ turnActive: false, items: [] });+ localStorage.setItem(+ 'ok-acp-agent-settings-v1',+ JSON.stringify({ 'registry:codex-acp': { contextWindow: 872_000 } }),+ );+ render(+ <ThreadView+ info={makeInfo({ agent: codex, status: 'ready', configOptions: [modelOption] })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: 'Agent settings' }));+ expect(screen.getByTestId('agent-thread-context-window').textContent).toContain('Default');+ });++ test('a refused pick is not remembered and says so', async () => {+ modelCandidates = twoWindows;+ model = makeModel({ turnActive: false, items: [] });+ setContextWindowResult = () => Promise.reject(new Error('start a new chat to change it'));+ render(+ <ThreadView+ info={makeInfo({ agent: codex, status: 'ready', configOptions: [modelOption] })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: 'Agent settings' }));+ await userEvent.click(screen.getByTestId('agent-thread-context-window'));+ await userEvent.click(await screen.findByTestId('agent-thread-context-window-872000'));++ await waitFor(() => expect(toastError).toHaveBeenCalled());+ expect(String(toastError.mock.calls[0]?.[0])).toContain('kept its current context window');+ expect(getRememberedAgentContextWindow(agentSettingsKey(codex))).toBeUndefined();+ });++ test('a pick whose relaunch died points at the recovery already on screen', async () => {+ modelCandidates = twoWindows;+ model = makeModel({ turnActive: false, items: [] });+ setContextWindowResult = () =>+ Promise.reject(new ThreadContextWindowError('spawn-failed', 'the agent failed to start'));+ render(+ <ThreadView+ info={makeInfo({ agent: codex, status: 'ready', configOptions: [modelOption] })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: 'Agent settings' }));+ await userEvent.click(screen.getByTestId('agent-thread-context-window'));+ await userEvent.click(await screen.findByTestId('agent-thread-context-window-872000'));++ await waitFor(() => expect(toastError).toHaveBeenCalled());+ expect(String(toastError.mock.calls[0]?.[0])).toContain("couldn't restart");+ expect(getRememberedAgentContextWindow(agentSettingsKey(codex))).toBeUndefined();+ });++ test('a model with one window shows no choice to make', async () => {+ modelCandidates = twoWindows;+ model = makeModel({ turnActive: false, items: [] });+ render(+ <ThreadView+ info={makeInfo({+ agent: codex,+ status: 'ready',+ configOptions: [{ ...modelOption, currentValue: 'gpt-5.5' }],+ })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: 'Agent settings' }));+ expect(screen.queryByTestId('agent-thread-context-window')).toBeNull();+ });++ test('an agent with no discovered windows shows no row either', async () => {+ modelCandidates = [];+ model = makeModel({ turnActive: false, items: [] });+ render(+ <ThreadView+ info={makeInfo({ agent: codex, status: 'ready', configOptions: [modelOption] })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: 'Agent settings' }));+ expect(screen.queryByTestId('agent-thread-context-window')).toBeNull();+ });++ test('a conversation that has already run keeps its window and offers a new chat instead', async () => {+ modelCandidates = twoWindows;+ model = makeModel({+ turnActive: false,+ items: [{ kind: 'message', role: 'user', text: 'summarise the standup', messageId: 'u1' }],+ });+ render(+ <ThreadView+ info={makeInfo({ agent: codex, status: 'ready', configOptions: [modelOption] })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: 'Agent settings' }));+ await userEvent.click(screen.getByTestId('agent-thread-context-window'));++ expect((await screen.findByTestId('agent-thread-context-window-locked')).textContent).toContain(+ 'keeps the window it started with',+ );+ expect(screen.queryByTestId('agent-thread-context-window-872000')).toBeNull();++ await userEvent.click(screen.getByTestId('agent-thread-context-window-new-chat'));+ expect(setContextWindow).not.toHaveBeenCalled();+ await waitFor(() =>+ expect(createThread).toHaveBeenCalledWith(+ expect.objectContaining({ agent: { source: 'registry', id: 'codex-acp' } }),+ ),+ );+ });++ test('an archived conversation is locked the same way', async () => {+ modelCandidates = twoWindows;+ model = makeModel({ turnActive: false, items: [] });+ render(+ <ThreadView+ info={makeInfo({+ agent: codex,+ status: 'exited',+ archived: true,+ configOptions: [modelOption],+ })}+ />,+ );++ await userEvent.click(screen.getByRole('button', { name: /Agent settings/ }));+ await userEvent.click(screen.getByTestId('agent-thread-context-window'));++ expect(await screen.findByTestId('agent-thread-context-window-locked')).toBeTruthy();+ expect(screen.queryByTestId('agent-thread-context-window-872000')).toBeNull();+ });+});diff --git a/packages/app/src/components/acp/ThreadView.tsx b/packages/app/src/components/acp/ThreadView.tsxindex 71cc05938..062be79e7 100644--- a/packages/app/src/components/acp/ThreadView.tsx+++ b/packages/app/src/components/acp/ThreadView.tsx@@ -76,6 +76,7 @@ import {DropdownMenu,DropdownMenuCheckboxItem,DropdownMenuContent,+ DropdownMenuItem,DropdownMenuLabel,DropdownMenuRadioGroup,DropdownMenuRadioItem,@@ -109,6 +110,7 @@ import { agentDisplayName } from '@/lib/acp/agent-display';import {agentSettingsKey,rememberAgentConfigOption,+ rememberAgentContextWindow,rememberAgentMode,} from '@/lib/acp/agent-settings-store';import { configValueHint, resolveDefaultOptionLabel } from '@/lib/acp/config-value-hints';@@ -125,12 +127,14 @@ import {} from '@/lib/acp/image-attachment';import { computeDiffRows } from '@/lib/acp/inline-diff';import { launchAgentThread } from '@/lib/acp/launch-agent-thread';+import { contextChoicesForModel, useModelCandidates } from '@/lib/acp/model-candidates';import { isPermissiveMode } from '@/lib/acp/permissive-mode';import { formatShellCommand, revealHiddenCharacters } from '@/lib/acp/shell-command-format';import { parseSignInOutput, shortenUrl } from '@/lib/acp/sign-in-output';import { renderTerminalText } from '@/lib/acp/terminal-text';import {getAgentThreadClient,+ ThreadContextWindowError,ThreadResumeError,useAgentThread,useAgentThreadModel,@@ -1182,6 +1186,8 @@ export function ThreadView({) : null}<ThreadComposerinfo={info}+ hasStartedWork={items.some((item) => item.kind === 'message' && item.role === 'user')}+ onNewChat={startFreshThread}composerRef={composerRef}onSubmit={submit}canPrompt={canPrompt}@@ -1377,11 +1383,30 @@ function deriveModeSurface(info: ThreadInfo): ModeSurface | null {return null;}-function AgentSettingsPopover({ info }: { info: ThreadInfo }): ReactNode {+function AgentSettingsPopover({+ info,+ hasStartedWork,+ onNewChat,+}: {+ info: ThreadInfo;+ hasStartedWork: boolean;+ onNewChat: () => void;+}): ReactNode {const { t } = useLingui();const reasonId = useId();const client = getAgentThreadClient();const settingsKey = agentSettingsKey(info.agent);+ const modelCandidates = useModelCandidates(info.agent.id);+ const selectedModel =+ (info.configOptions ?? []).find(+ (option) => option.type === 'select' && option.category === 'model',+ )?.currentValue ?? null;+ const contextChoices = contextChoicesForModel(+ modelCandidates,+ typeof selectedModel === 'string' ? selectedModel : null,+ );+ const currentContextWindow = info.contextWindow ?? null;+ const canChangeContextWindow = info.archived !== true && !hasStartedWork;const applyConfig = (option: SessionConfigOption, value: string | boolean): void => {client.setConfigOption(info.threadId, option.id, value);rememberAgentConfigOption(settingsKey, option.id, value);@@ -1506,6 +1531,33 @@ function AgentSettingsPopover({ info }: { info: ThreadInfo }): ReactNode {/>),)}+ <ContextWindowSub+ choices={contextChoices}+ currentTokens={currentContextWindow}+ canApply={canChangeContextWindow}+ onSelect={(tokens) => {+ void client.setContextWindow(info.threadId, tokens).then(+ () => rememberAgentContextWindow(settingsKey, tokens),+ (err: unknown) => {+ const code = err instanceof ThreadContextWindowError ? err.code : null;+ if (code === 'spawn-failed') {+ toast.error(+ t`${info.agent.name} couldn't restart on that context window. Use Retry to bring it back.`,+ );+ return;+ }+ if (code === 'timeout') {+ toast.error(+ t`${info.agent.name} didn't confirm the context window change. Check the conversation before picking again.`,+ );+ return;+ }+ toast.error(t`${info.agent.name} kept its current context window.`);+ },+ );+ }}+ onNewChat={onNewChat}+ />{showLegacyModes ? (<ConfigSelectSubagentId={info.agent.id}@@ -1528,6 +1580,75 @@ function AgentSettingsPopover({ info }: { info: ThreadInfo }): ReactNode {);}+function ContextWindowSub({+ choices,+ currentTokens,+ canApply,+ onSelect,+ onNewChat,+}: {+ choices: readonly number[];+ currentTokens: number | null;+ canApply: boolean;+ onSelect: (tokens: number) => void;+ onNewChat: () => void;+}): ReactNode {+ const { t } = useLingui();+ if (choices.length < 2) return null;+ const summary = currentTokens === null ? t`Default` : formatContextTokens(currentTokens);+ return (+ <DropdownMenuSub>+ <DropdownMenuSubTrigger className="gap-2" data-testid="agent-thread-context-window">+ <span className="min-w-0 flex-1 truncate">{t`Context window`}</span>+ <span className="max-w-[11rem] truncate text-1sm text-muted-foreground">{summary}</span>+ </DropdownMenuSubTrigger>+ <DropdownMenuSubContent className="max-w-72 overscroll-contain">+ <DropdownMenuLabel>{t`Context window`}</DropdownMenuLabel>+ {canApply ? (+ <DropdownMenuRadioGroup+ value={currentTokens === null ? undefined : String(currentTokens)}+ onValueChange={(next) => onSelect(Number(next))}+ >+ {choices.map((tokens) => (+ <DropdownMenuRadioItem+ key={tokens}+ value={String(tokens)}+ data-testid={`agent-thread-context-window-${tokens}`}+ >+ {formatContextTokens(tokens)}+ </DropdownMenuRadioItem>+ ))}+ </DropdownMenuRadioGroup>+ ) : (+ <>+ <DropdownMenuLabel+ className="font-normal text-muted-foreground"+ data-testid="agent-thread-context-window-locked"+ >+ {t`This conversation keeps the window it started with. A new chat can use a different one.`}+ </DropdownMenuLabel>+ <DropdownMenuItem+ onSelect={onNewChat}+ data-testid="agent-thread-context-window-new-chat"+ >+ {t`New chat with a different window`}+ </DropdownMenuItem>+ </>+ )}+ </DropdownMenuSubContent>+ </DropdownMenuSub>+ );+}++function formatContextTokens(tokens: number): string {+ if (tokens >= 1_000_000) {+ const millions = tokens / 1_000_000;+ return `${Number.isInteger(millions) ? millions : millions.toFixed(1)}M`;+ }+ if (tokens >= 1_000) return `${Math.round(tokens / 1_000)}K`;+ return String(tokens);+}+function ConfigSelectSub({agentId,option,@@ -3497,6 +3618,8 @@ function ContextUsageRing({function ThreadComposer({info,+ hasStartedWork,+ onNewChat,composerRef,onSubmit,canPrompt,@@ -3522,6 +3645,8 @@ function ThreadComposer({onRemovePendingAttachment,}: {info: ThreadInfo;+ hasStartedWork: boolean;+ onNewChat: () => void;composerRef: RefObject<ComposerMentionInputHandle | null>;onSubmit: () => void;canPrompt: boolean;@@ -3656,7 +3781,7 @@ function ThreadComposer({/>{}<div className="flex items-center gap-2 px-1.5 pt-1 pb-1.5">- <AgentSettingsPopover info={info} />+ <AgentSettingsPopover info={info} hasStartedWork={hasStartedWork} onNewChat={onNewChat} /><AttachFilesButtontestId="agent-thread-attach-files"onFiles={onIngestAllFiles}diff --git a/packages/app/src/lib/acp/agent-settings-store.ts b/packages/app/src/lib/acp/agent-settings-store.tsindex 793928220..f63556e36 100644--- a/packages/app/src/lib/acp/agent-settings-store.ts+++ b/packages/app/src/lib/acp/agent-settings-store.ts@@ -1,7 +1,11 @@const STORAGE_KEY = 'ok-acp-agent-settings-v1';type ConfigValue = string | boolean;-type StoredAgentSettings = { config?: Record<string, ConfigValue>; modeId?: string };+type StoredAgentSettings = {+ config?: Record<string, ConfigValue>;+ modeId?: string;+ contextWindow?: number;+};type Store = Record<string, StoredAgentSettings>;export function agentSettingsKey(agent: { source: 'registry' | 'custom'; id: string }): string {@@ -62,3 +66,20 @@ export function getRememberedAgentMode(agentKey: string): string | undefined {const modeId = read()[agentKey]?.modeId;return typeof modeId === 'string' && modeId !== '' ? modeId : undefined;}++export function rememberAgentContextWindow(agentKey: string, tokens: number | null): void {+ const store = read();+ const entry = store[agentKey] ?? {};+ if (tokens === null || !Number.isFinite(tokens) || tokens <= 0) {+ const { contextWindow: _dropped, ...rest } = entry;+ store[agentKey] = rest;+ } else {+ store[agentKey] = { ...entry, contextWindow: Math.floor(tokens) };+ }+ write(store);+}++export function getRememberedAgentContextWindow(agentKey: string): number | undefined {+ const stored = read()[agentKey]?.contextWindow;+ return typeof stored === 'number' && Number.isFinite(stored) && stored > 0 ? stored : undefined;+}diff --git a/packages/app/src/lib/acp/model-candidates.ts b/packages/app/src/lib/acp/model-candidates.tsnew file mode 100644index 000000000..def700136--- /dev/null+++ b/packages/app/src/lib/acp/model-candidates.ts@@ -0,0 +1,47 @@+import { useEffect, useState } from 'react';++export interface RemoteModelCandidate {+ readonly value: string;+ readonly label: string;+ readonly contextChoices: readonly number[];+ readonly context: { readonly effectiveTokens: number; readonly origin: string } | null;+}++const cache = new Map<string, readonly RemoteModelCandidate[]>();++export function useModelCandidates(agentId: string | null): readonly RemoteModelCandidate[] {+ const [candidates, setCandidates] = useState<readonly RemoteModelCandidate[]>(() =>+ agentId === null ? [] : (cache.get(agentId) ?? []),+ );+ useEffect(() => {+ if (agentId === null) return;+ const cached = cache.get(agentId);+ if (cached !== undefined) {+ setCandidates(cached);+ return;+ }+ let cancelled = false;+ void fetch(`/api/acp/models?agent=${encodeURIComponent(agentId)}`)+ .then((res) => (res.ok ? res.json() : { candidates: [] }))+ .then((body: { candidates?: readonly RemoteModelCandidate[] }) => {+ const rows = body.candidates ?? [];+ cache.set(agentId, rows);+ if (!cancelled) setCandidates(rows);+ })+ .catch(() => {+ if (!cancelled) setCandidates([]);+ });+ return () => {+ cancelled = true;+ };+ }, [agentId]);+ return candidates;+}++export function contextChoicesForModel(+ candidates: readonly RemoteModelCandidate[],+ modelValue: string | null,+): readonly number[] {+ if (modelValue === null) return [];+ return candidates.find((candidate) => candidate.value === modelValue)?.contextChoices ?? [];+}diff --git a/packages/app/src/lib/acp/thread-client.test.ts b/packages/app/src/lib/acp/thread-client.test.tsindex 4f35a98bd..f4c1cbd4e 100644--- a/packages/app/src/lib/acp/thread-client.test.ts+++ b/packages/app/src/lib/acp/thread-client.test.ts@@ -399,6 +399,33 @@ describe('retry and sign-in lifecycle', () => {await expect(pending).rejects.toThrow(/harness not installed/);});+ test('a refused context window change carries the server code to the caller', async () => {+ const { client, sent, frame } = makeWiredClient();+ const pending = client.setContextWindow('t1', 872_000);+ await flush();+ const reqId = sent.find((f) => f.op === 'set_context_window')?.reqId as string;+ expect(reqId).toBeTruthy();++ frame({+ op: 'error',+ code: 'spawn-failed',+ message: 'the agent failed to start',+ reqId,+ threadId: 't1',+ });+ await expect(pending).rejects.toMatchObject({ code: 'spawn-failed' });+ });++ test('an accepted context window change settles with the thread info', async () => {+ const { client, sent, frame } = makeWiredClient();+ const pending = client.setContextWindow('t1', 872_000);+ await flush();+ const reqId = sent.find((f) => f.op === 'set_context_window')?.reqId as string;++ frame({ op: 'context_window_set', reqId, info: { ...info, contextWindow: 872_000 } });+ await expect(pending).resolves.toMatchObject({ contextWindow: 872_000 });+ });+test('authenticateThread sends the method id and resolves with the signed-in info', async () => {const { client, sent, frame } = makeWiredClient();const pending = client.authenticateThread('t1', 'test_login');diff --git a/packages/app/src/lib/acp/thread-client.ts b/packages/app/src/lib/acp/thread-client.tsindex 90da84ca1..2d2a04323 100644--- a/packages/app/src/lib/acp/thread-client.ts+++ b/packages/app/src/lib/acp/thread-client.ts@@ -13,6 +13,7 @@ import { toast } from 'sonner';import {agentSettingsKey,getRememberedAgentConfig,+ getRememberedAgentContextWindow,getRememberedAgentMode,} from './agent-settings-store';import { type ThreadRenderModel, ThreadRenderModelBuilder } from './thread-event-model';@@ -53,6 +54,15 @@ const AUTHENTICATE_TIMEOUT_MS = 5 * 60 * 1000 + 30_000;const CHANNEL_WAIT_MS = 8_000;const QUEUE_EDIT_TIMEOUT_MS = 10_000;+export class ThreadContextWindowError extends Error {+ readonly code: ThreadErrorCode | 'timeout';+ constructor(code: ThreadErrorCode | 'timeout', message: string) {+ super(message);+ this.name = 'ThreadContextWindowError';+ this.code = code;+ }+}+export class ThreadResumeError extends Error {readonly code: ThreadErrorCode | 'timeout';constructor(code: ThreadErrorCode | 'timeout', message: string) {@@ -79,6 +89,7 @@ export class AgentThreadClient {private pendingCreates = new Map<string, PendingCreate>();private pendingResumes = new Map<string, PendingCreate>();private pendingRetries = new Map<string, PendingCreate>();+ private pendingContextWindows = new Map<string, PendingCreate>();private pendingAuths = new Map<string, PendingCreate>();private pendingQueueEdits = new Map<string, PendingQueueEdit>();private openedArchived = new Set<string>();@@ -202,11 +213,13 @@ export class AgentThreadClient {const settingsKey = agentSettingsKey(params.agent);const config = getRememberedAgentConfig(settingsKey);const modeId = getRememberedAgentMode(settingsKey);+ const contextWindow = getRememberedAgentContextWindow(settingsKey);const settings =- config !== undefined || modeId !== undefined+ config !== undefined || modeId !== undefined || contextWindow !== undefined? {...(config !== undefined ? { config } : {}),...(modeId !== undefined ? { modeId } : {}),+ ...(contextWindow !== undefined ? { contextWindow } : {}),}: undefined;this.send({@@ -312,6 +325,22 @@ export class AgentThreadClient {this.send({ op: 'set_config_option', threadId, configId, value });}+ async setContextWindow(threadId: string, tokens: number): Promise<ThreadInfo> {+ this.connectNow();+ await this.waitForOpen(CHANNEL_WAIT_MS);+ this.reqCounter += 1;+ const reqId = `context-window-${this.reqCounter}`;+ const promise = new Promise<ThreadInfo>((resolve, reject) => {+ const timer = setTimeout(() => {+ this.pendingContextWindows.delete(reqId);+ reject(new ThreadContextWindowError('timeout', 'the context window change timed out'));+ }, RETRY_TIMEOUT_MS);+ this.pendingContextWindows.set(reqId, { resolve, reject, timer });+ });+ this.send({ op: 'set_context_window', threadId, reqId, tokens });+ return promise;+ }+closeThread(threadId: string): void {const state = this.threads.get(threadId);if (state?.info.archived === true) {@@ -491,6 +520,11 @@ export class AgentThreadClient {pending.reject(new ThreadChannelUnavailableError());}this.pendingRetries.clear();+ for (const pending of this.pendingContextWindows.values()) {+ clearTimeout(pending.timer);+ pending.reject(new ThreadChannelUnavailableError());+ }+ this.pendingContextWindows.clear();for (const pending of this.pendingAuths.values()) {clearTimeout(pending.timer);pending.reject(new ThreadChannelUnavailableError());@@ -600,6 +634,16 @@ export class AgentThreadClient {this.upsertInfo(frame.info);return;}+ case 'context_window_set': {+ const pending = this.pendingContextWindows.get(frame.reqId);+ if (pending !== undefined) {+ this.pendingContextWindows.delete(frame.reqId);+ clearTimeout(pending.timer);+ pending.resolve(frame.info);+ }+ this.upsertInfo(frame.info);+ return;+ }case 'authenticated': {const pending = this.pendingAuths.get(frame.reqId);if (pending !== undefined) {@@ -666,6 +710,13 @@ export class AgentThreadClient {pendingRetry.reject(new Error(frame.message));return;}+ const pendingWindow = this.pendingContextWindows.get(frame.reqId);+ if (pendingWindow !== undefined) {+ this.pendingContextWindows.delete(frame.reqId);+ clearTimeout(pendingWindow.timer);+ pendingWindow.reject(new ThreadContextWindowError(frame.code, frame.message));+ return;+ }const pendingAuth = this.pendingAuths.get(frame.reqId);if (pendingAuth !== undefined) {this.pendingAuths.delete(frame.reqId);diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.jsonindex f0c4bfacd..d66441565 100644--- a/packages/app/src/locales/ar/messages.json+++ b/packages/app/src/locales/ar/messages.json@@ -251,6 +251,7 @@"أضف ترتيبًا قائمًا على المعنى إلى البحث لتظهر الصفحات المرتبطة مفاهيميًا حتى لو لم تشترك في أي كلمات مفتاحية."],"1NgrlY": ["طرق أخرى للتثبيت"],+ "1Ou_BW": [["0"], " لم يؤكد تغيير نافذة السياق. راجع المحادثة قبل الاختيار مرة أخرى."],"1QfxQT": ["تجاهل"],"1RluQD": ["إظهار الاستبدال"],"1TA-aJ": ["تم السحب ", ["pulled"], " · تم الدفع ", ["pushed"]],@@ -307,6 +308,7 @@"2QoAQ-": ["عرض ", ["publisher"], " على skills.sh"],"2RnFoM": ["تعذّر استئناف هذه المحادثة: ", ["0"]],"2Snes1": ["هذا يرسل عنوان الرابط خارج جهازك"],+ "2UTDg2": [["0"], " احتفظ بنافذة السياق الحالية."],"2VSPan": ["أُغلق Terminal لإفساح المجال للوحة الوكيل."],"2XQ8Ww": ["فتح المعاينة عند تحرير الوكيل"],"2YOwme": ["أُعيد التشغيل — يعمل الآن بالإصدار v", ["appRuntime"], "."],@@ -1440,6 +1442,7 @@"Dut9Ht": ["صِف المهارة التي تريد إنشاءها"],"DvGkXq": ["تعذر إنشاء ", ["effective"], ": ", ["0"]],"Dvr1Sg": ["يجري النسخ"],+ "Dvvrs8": [["0"], " تعذر إعادة تشغيله بنافذة السياق هذه. استخدم إعادة المحاولة لاستعادته."],"Dvwa0U": ["إنشاء شجرة عمل من هذا الفرع"],"Dz7fsq": ["تكبير"],"E-G19G": [@@ -2112,6 +2115,7 @@"LRLKnQ": ["إخفاء المحلولة"],"LRgZAt": [["owner"], "/", ["name"], " موجود بالفعل"],"LTeJuX": ["تبديل ملء الشاشة"],+ "LXIm4m": ["نافذة السياق"],"LXdWeS": ["عنوان قسم متوسط."],"LXfNU-": ["التنقل والاقتراحات"],"LYufDw": ["فشل تفعيل البحث الدلالي — ", ["detail"]],@@ -2586,6 +2590,7 @@"QWdKwH": ["نقل"],"QYTOaN": ["يمكنك تغيير هذا لاحقًا من <0>الإعدادات ← المزامنة</0>."],"QYfQdv": ["واجهة ", ["displayName"], " السطرية"],+ "QcTjRP": ["تحتفظ هذه المحادثة بالنافذة التي بدأت بها. يمكن لمحادثة جديدة استخدام نافذة أخرى."],"Qca--K": ["برنامج آخر يستخدم Git هنا — انتظر حتى ينتهي، ثم أعد المزامنة (يحتجز <0>.git/index.lock</0>)"],@@ -5044,6 +5049,7 @@"nCzR-G": ["نسخ الرمز ", ["userCode"]],"nDT8qt": ["تمت تهيئة ", ["0"], " لكن تعذّر فتحه."],"nFAvDj": ["يتضمن ", ["plugin"], " ", ["0"], " مهارات أخرى"],+ "nHUawj": ["محادثة جديدة بنافذة مختلفة"],"nJaz5Q": ["يستبدل إدخال OpenKnowledge الموجود لدى كل منها."],"nMSYz5": ["هذا المسار على وحدة تخزين خارجية (/Volumes/...). سيفقد OpenKnowledge تتبّع الملفات عند إخراج القرص."@@ -5169,6 +5175,7 @@"otE4aj": ["إظهار عقد الروابط الخارجية"],"ou1hFW": ["بدّل القائمة المرتّبة."],"outYNy": ["اسم مكرر «", ["keyName"], "»"],+ "ovBPCi": ["الافتراضي"],"ovIGrT": ["تعذّر مسح بيانات التعاون المحلية لـ «",["docName"],diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.poindex fc123d7f5..c171a5a32 100644--- a/packages/app/src/locales/ar/messages.po+++ b/packages/app/src/locales/ar/messages.po@@ -302,6 +302,16 @@ msgstr "{0} يتصرف دون سؤال — لا يمكن لـ OpenKnowledge إضmsgid "{0} added, {1} removed"msgstr "تمت إضافة {0}، وإزالة {1}"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} تعذر إعادة تشغيله بنافذة السياق هذه. استخدم إعادة المحاولة لاستعادته."++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} لم يؤكد تغيير نافذة السياق. راجع المحادثة قبل الاختيار مرة أخرى."+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} فوق {destination}."msgid "{0} isn't installed yet — opening its download page."msgstr "{0} غير مثبَّت بعد — يجري فتح صفحة تنزيله."+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} احتفظ بنافذة السياق الحالية."+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3563,6 +3578,10 @@ msgstr "قواعد المحتوى"msgid "Content rules not yet loaded — try again in a moment"msgstr "لم تُحمَّل قواعد المحتوى بعد — أعد المحاولة بعد قليل"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "نافذة السياق"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "نافذة السياق:"@@ -4694,6 +4713,10 @@ msgstr "البيانات"msgid "Date"msgstr "التاريخ"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "الافتراضي"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "الموقع الافتراضي للمرفقات الجديدة"@@ -8798,6 +8821,10 @@ msgstr "تظهر التغييرات الجديدة من مستودعك البعmsgid "New chat with {agentName}"msgstr "محادثة جديدة مع {agentName}"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "محادثة جديدة بنافذة مختلفة"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14425,6 +14452,10 @@ msgstr "هذا التعليق على الخاصية بأكملها"msgid "This composer doesn't accept attachments."msgstr "لا يمكن إرفاق الملفات هنا."+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "تحتفظ هذه المحادثة بالنافذة التي بدأت بها. يمكن لمحادثة جديدة استخدام نافذة أخرى."+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "تعذّر إعداد هذا لأن إدخال خادم MCP الذي يحتاجه لم تتم كتابته."diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.jsonindex 5b45fa38d..d7f5ee9de 100644--- a/packages/app/src/locales/bn/messages.json+++ b/packages/app/src/locales/bn/messages.json@@ -193,6 +193,7 @@"অনুসন্ধানে অর্থভিত্তিক ক্রম যোগ করুন যাতে ধারণাগতভাবে সম্পর্কিত পাতাগুলো অভিন্ন কীওয়ার্ড না থাকলেও সামনে আসে।"],"1NgrlY": ["ইনস্টল করার অন্যান্য উপায়"],+ "1Ou_BW": [["0"], " কনটেক্সট উইন্ডো পরিবর্তন নিশ্চিত করেনি। আবার বেছে নেওয়ার আগে কথোপকথনটি দেখুন।"],"1QfxQT": ["সরিয়ে দিন"],"1RluQD": ["বদলানো দেখান"],"1TA-aJ": [["pulled"], " টানা · ", ["pushed"], " পাঠানো"],@@ -251,6 +252,7 @@"2QoAQ-": ["skills.sh-এ ", ["publisher"], " দেখুন"],"2RnFoM": ["এই চ্যাট পুনরায় শুরু করা যায়নি: ", ["0"]],"2Snes1": ["এটি লিংকের ঠিকানা আপনার মেশিনের বাইরে পাঠায়"],+ "2UTDg2": [["0"], " তার বর্তমান কনটেক্সট উইন্ডো ধরে রেখেছে।"],"2VSPan": ["এজেন্ট প্যানেলের জন্য জায়গা করতে Terminal বন্ধ করা হয়েছে।"],"2XQ8Ww": ["এজেন্ট সম্পাদনা করলে প্রাকদর্শন খুলুন"],"2YOwme": ["পুনরায় চালু হয়েছে — এখন v", ["appRuntime"], " চলছে।"],@@ -1168,6 +1170,7 @@"Dut9Ht": ["আপনি যে স্কিলটি তৈরি করতে চান তার বর্ণনা দিন"],"DvGkXq": [["effective"], " তৈরি করা যায়নি: ", ["0"]],"Dvr1Sg": ["কপি করা হচ্ছে"],+ "Dvvrs8": [["0"], " সেই কনটেক্সট উইন্ডোতে পুনরায় চালু হতে পারেনি। ফিরিয়ে আনতে আবার চেষ্টা করুন।"],"Dvwa0U": ["এই ব্রাঞ্চ থেকে একটি ওয়ার্কট্রি তৈরি করুন"],"Dz7fsq": ["বড় করুন"],"E-G19G": [@@ -1786,6 +1789,7 @@"LRLKnQ": ["মীমাংসিত লুকান"],"LRgZAt": [["owner"], "/", ["name"], " আগে থেকেই আছে"],"LTeJuX": ["পূর্ণ পর্দা চালু বা বন্ধ করুন"],+ "LXIm4m": ["প্রসঙ্গ উইন্ডো"],"LXdWeS": ["মাঝারি বিভাগ শিরোনাম।"],"LXfNU-": ["নেভিগেশন ও পরামর্শ"],"LYufDw": ["অর্থভিত্তিক অনুসন্ধান চালু করতে ব্যর্থ — ", ["detail"]],@@ -2198,6 +2202,7 @@"QWdKwH": ["সরান"],"QYTOaN": ["আপনি এটি পরে <0>Settings → Sync</0>-এ বদলাতে পারেন।"],"QYfQdv": [["displayName"], " CLI"],+ "QcTjRP": ["এই কথোপকথন যে উইন্ডো দিয়ে শুরু হয়েছিল সেটিই রাখে। নতুন কথোপকথনে অন্য উইন্ডো ব্যবহার করা যায়।"],"Qca--K": ["অন্য একটি প্রোগ্রাম এখানে Git ব্যবহার করছে — সেটি শেষ হওয়া পর্যন্ত অপেক্ষা করুন, তারপর আবার সিঙ্ক করুন (এটি <0>.git/index.lock</0> ধরে রেখেছে)"],@@ -4280,6 +4285,7 @@"nCzR-G": ["কোড ", ["userCode"], " কপি করুন"],"nDT8qt": [["0"], " চালু করা হয়েছে কিন্তু সেটি খোলা যায়নি।"],"nFAvDj": [["plugin"], "-এ আরও ", ["0"], "টি স্কিল আছে"],+ "nHUawj": ["অন্য উইন্ডো দিয়ে নতুন কথোপকথন"],"nJaz5Q": ["প্রত্যেকটিতে আগে থেকে থাকা OpenKnowledge এন্ট্রি প্রতিস্থাপন করে।"],"nMSYz5": ["এই পথটি একটি বাইরের ভলিউমে (/Volumes/…)। ড্রাইভটি বের করে নিলে OpenKnowledge ফাইলগুলোর হদিস হারিয়ে ফেলবে।"@@ -4400,6 +4406,7 @@"otE4aj": ["বাইরের URL নোড দেখান"],"ou1hFW": ["ক্রমিক তালিকা চালু বা বন্ধ করুন।"],"outYNy": ["একই নাম \"", ["keyName"], "\""],+ "ovBPCi": ["ডিফল্ট"],"ovIGrT": ["\"",["docName"],diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.poindex d5b25262f..626b4e1ec 100644--- a/packages/app/src/locales/bn/messages.po+++ b/packages/app/src/locales/bn/messages.po@@ -302,6 +302,16 @@ msgstr "{0} জিজ্ঞাসা না করেই কাজ করে —msgid "{0} added, {1} removed"msgstr "{0} যোগ হয়েছে, {1} সরানো হয়েছে"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} সেই কনটেক্সট উইন্ডোতে পুনরায় চালু হতে পারেনি। ফিরিয়ে আনতে আবার চেষ্টা করুন।"++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} কনটেক্সট উইন্ডো পরিবর্তন নিশ্চিত করেনি। আবার বেছে নেওয়ার আগে কথোপকথনটি দেখুন।"+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} {destination}-এর উপরে রয়েছে।"msgid "{0} isn't installed yet — opening its download page."msgstr "{0} এখনও ইনস্টল করা নেই — এর ডাউনলোড পাতা খোলা হচ্ছে।"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} তার বর্তমান কনটেক্সট উইন্ডো ধরে রেখেছে।"+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3559,6 +3574,10 @@ msgstr "বিষয়বস্তুর নিয়ম"msgid "Content rules not yet loaded — try again in a moment"msgstr "বিষয়বস্তুর নিয়ম এখনও লোড হয়নি — একটু পরে আবার চেষ্টা করুন"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "প্রসঙ্গ উইন্ডো"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "প্রসঙ্গ জানালা:"@@ -4690,6 +4709,10 @@ msgstr "তথ্য"msgid "Date"msgstr "তারিখ"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "ডিফল্ট"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "নতুন সংযুক্তির ডিফল্ট জায়গা"@@ -8794,6 +8817,10 @@ msgstr "আপনার রিমোটের নতুন পরিবর্তmsgid "New chat with {agentName}"msgstr "{agentName}-এর সাথে নতুন চ্যাট"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "অন্য উইন্ডো দিয়ে নতুন কথোপকথন"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14421,6 +14448,10 @@ msgstr "এই মন্তব্যটি পুরো প্রপার্টmsgid "This composer doesn't accept attachments."msgstr "এখানে ফাইল যুক্ত করা যায় না।"+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "এই কথোপকথন যে উইন্ডো দিয়ে শুরু হয়েছিল সেটিই রাখে। নতুন কথোপকথনে অন্য উইন্ডো ব্যবহার করা যায়।"+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "এটি সেট আপ করা যায়নি কারণ এর প্রয়োজনীয় MCP সার্ভার এন্ট্রি লেখা হয়নি।"diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.jsonindex ca7779423..34a924dc4 100644--- a/packages/app/src/locales/en/messages.json+++ b/packages/app/src/locales/en/messages.json@@ -197,6 +197,10 @@"Add meaning-based ranking to search so conceptually-related pages surface even when they share no keywords."],"1NgrlY": ["Other ways to install"],+ "1Ou_BW": [+ ["0"],+ " didn't confirm the context window change. Check the conversation before picking again."+ ],"1QfxQT": ["Dismiss"],"1RluQD": ["Show replace"],"1TA-aJ": ["Pulled ", ["pulled"], " · pushed ", ["pushed"]],@@ -255,6 +259,7 @@"2QoAQ-": ["View ", ["publisher"], " on skills.sh"],"2RnFoM": ["Couldn't resume this chat: ", ["0"]],"2Snes1": ["This sends the link's address off your machine"],+ "2UTDg2": [["0"], " kept its current context window."],"2VSPan": ["Terminal closed to make room for the agent panel."],"2XQ8Ww": ["Open preview when agent edits"],"2YOwme": ["Restarted — now running v", ["appRuntime"], "."],@@ -1203,6 +1208,7 @@"Dut9Ht": ["Describe the skill you want to create"],"DvGkXq": ["Couldn't create ", ["effective"], ": ", ["0"]],"Dvr1Sg": ["Copying"],+ "Dvvrs8": [["0"], " couldn't restart on that context window. Use Retry to bring it back."],"Dvwa0U": ["Create a worktree from this branch"],"Dz7fsq": ["Zoom In"],"E-G19G": [@@ -1841,6 +1847,7 @@"LRLKnQ": ["Hide resolved"],"LRgZAt": [["owner"], "/", ["name"], " already exists"],"LTeJuX": ["Toggle Full Screen"],+ "LXIm4m": ["Context window"],"LXdWeS": ["Medium section heading."],"LXfNU-": ["Navigation and suggestions"],"LYufDw": ["Failed to enable semantic search — ", ["detail"]],@@ -2268,6 +2275,9 @@"QWdKwH": ["Move"],"QYTOaN": ["You can change this later in <0>Settings → Sync</0>."],"QYfQdv": [["displayName"], " CLI"],+ "QcTjRP": [+ "This conversation keeps the window it started with. A new chat can use a different one."+ ],"Qca--K": ["Another program is using Git here — wait for it to finish, then sync again (it holds <0>.git/index.lock</0>)"],@@ -4418,6 +4428,7 @@"nCzR-G": ["Copy code ", ["userCode"]],"nDT8qt": ["Initialized ", ["0"], " but could not open it."],"nFAvDj": [["plugin"], " ships ", ["0"], " other skills"],+ "nHUawj": ["New chat with a different window"],"nJaz5Q": ["Replaces the OpenKnowledge entry each of them already has."],"nMSYz5": ["This path is on an external volume (/Volumes/...). OpenKnowledge will lose track of files when the drive ejects."@@ -4545,6 +4556,7 @@"otE4aj": ["Show external URL nodes"],"ou1hFW": ["Toggle an ordered list."],"outYNy": ["Duplicate name \"", ["keyName"], "\""],+ "ovBPCi": ["Default"],"ovIGrT": ["Local collaboration data for \"",["docName"],diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.poindex cbfc080e0..e8496efc7 100644--- a/packages/app/src/locales/en/messages.po+++ b/packages/app/src/locales/en/messages.po@@ -302,6 +302,16 @@ msgstr "{0} acts without asking — OpenKnowledge can't add permission prompts fmsgid "{0} added, {1} removed"msgstr "{0} added, {1} removed"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} couldn't restart on that context window. Use Retry to bring it back."++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} didn't confirm the context window change. Check the conversation before picking again."+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} is over {destination}."msgid "{0} isn't installed yet — opening its download page."msgstr "{0} isn't installed yet — opening its download page."+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} kept its current context window."+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3563,6 +3578,10 @@ msgstr "Content rules"msgid "Content rules not yet loaded — try again in a moment"msgstr "Content rules not yet loaded — try again in a moment"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "Context window"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "Context window:"@@ -4694,6 +4713,10 @@ msgstr "Data"msgid "Date"msgstr "Date"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "Default"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "Default location for new attachments"@@ -8798,6 +8821,10 @@ msgstr "New changes from your remote appear in your copy automatically."msgid "New chat with {agentName}"msgstr "New chat with {agentName}"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "New chat with a different window"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14425,6 +14452,10 @@ msgstr "This comment is on the whole property"msgid "This composer doesn't accept attachments."msgstr "This composer doesn't accept attachments."+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "This conversation keeps the window it started with. A new chat can use a different one."+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "This could not be set up because the MCP server entry it needs was not written."diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.jsonindex e9cb443aa..a03204ac8 100644--- a/packages/app/src/locales/es/messages.json+++ b/packages/app/src/locales/es/messages.json@@ -233,6 +233,10 @@"Añade a la búsqueda una clasificación por significado para que aparezcan páginas relacionadas conceptualmente aunque no compartan palabras clave."],"1NgrlY": ["Otras formas de instalarlo"],+ "1Ou_BW": [+ ["0"],+ " no confirmó el cambio de ventana de contexto. Revisa la conversación antes de elegir otra vez."+ ],"1QfxQT": ["Descartar"],"1RluQD": ["Mostrar reemplazar"],"1TA-aJ": ["Traído ", ["pulled"], " · enviado ", ["pushed"]],@@ -295,6 +299,7 @@"2QoAQ-": ["Ver ", ["publisher"], " en skills.sh"],"2RnFoM": ["No se pudo reanudar este chat: ", ["0"]],"2Snes1": ["Esto envía la dirección del enlace fuera de tu equipo"],+ "2UTDg2": [["0"], " mantuvo su ventana de contexto actual."],"2VSPan": ["Se cerró Terminal para dejar espacio al panel de agentes."],"2XQ8Ww": ["Abrir la vista previa cuando el agente edite"],"2YOwme": ["Reiniciado: ahora se ejecuta la v", ["appRuntime"], "."],@@ -1424,6 +1429,10 @@"Dut9Ht": ["Describe la habilidad que quieres crear"],"DvGkXq": ["No se pudo crear ", ["effective"], ": ", ["0"]],"Dvr1Sg": ["Copiando"],+ "Dvvrs8": [+ ["0"],+ " no pudo reiniciarse con esa ventana de contexto. Usa Reintentar para recuperarlo."+ ],"Dvwa0U": ["Crear un worktree desde esta rama"],"Dz7fsq": ["Acercar"],"E-G19G": [@@ -2143,6 +2152,7 @@"LRLKnQ": ["Ocultar los resueltos"],"LRgZAt": [["owner"], "/", ["name"], " ya existe"],"LTeJuX": ["Activar o desactivar la pantalla completa"],+ "LXIm4m": ["Ventana de contexto"],"LXdWeS": ["Encabezado de sección mediano."],"LXfNU-": ["Navegación y sugerencias"],"LYufDw": ["No se pudo activar la búsqueda semántica — ", ["detail"]],@@ -2617,6 +2627,9 @@"QWdKwH": ["Mover"],"QYTOaN": ["Puedes cambiarlo más adelante en <0>Ajustes → Sincronización</0>."],"QYfQdv": ["CLI de ", ["displayName"]],+ "QcTjRP": [+ "Esta conversacion mantiene la ventana con la que empezo. Un chat nuevo puede usar otra."+ ],"Qca--K": ["Otro programa está usando Git aquí: espera a que termine y vuelve a sincronizar (está reteniendo <0>.git/index.lock</0>)"],@@ -5126,6 +5139,7 @@"nCzR-G": ["Copiar el código ", ["userCode"]],"nDT8qt": ["Se inicializó ", ["0"], ", pero no se pudo abrir."],"nFAvDj": [["plugin"], " incluye ", ["0"], " habilidades más"],+ "nHUawj": ["Nuevo chat con otra ventana"],"nJaz5Q": ["Reemplaza la entrada de OpenKnowledge que cada uno ya tiene."],"nMSYz5": ["Esta ruta está en un volumen externo (/Volumes/...). OpenKnowledge perderá la pista de los archivos cuando se expulse la unidad."@@ -5258,6 +5272,7 @@"otE4aj": ["Mostrar los nodos de URL externas"],"ou1hFW": ["Activa o desactiva una lista numerada."],"outYNy": ["Nombre duplicado \"", ["keyName"], "\""],+ "ovBPCi": ["Predeterminado"],"ovIGrT": ["No se pudieron borrar los datos locales de colaboración de \"",["docName"],diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.poindex d0bb6d54a..a52c4a6e1 100644--- a/packages/app/src/locales/es/messages.po+++ b/packages/app/src/locales/es/messages.po@@ -302,6 +302,16 @@ msgstr "{0} actúa sin preguntar — OpenKnowledge no puede añadirle solicitudemsgid "{0} added, {1} removed"msgstr "{0} añadidos, {1} eliminados"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} no pudo reiniciarse con esa ventana de contexto. Usa Reintentar para recuperarlo."++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} no confirmó el cambio de ventana de contexto. Revisa la conversación antes de elegir otra vez."+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} está sobre {destination}."msgid "{0} isn't installed yet — opening its download page."msgstr "{0} todavía no está instalado: abriendo su página de descarga."+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} mantuvo su ventana de contexto actual."+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3563,6 +3578,10 @@ msgstr "Reglas de contenido"msgid "Content rules not yet loaded — try again in a moment"msgstr "Las reglas de contenido aún no se han cargado; inténtalo de nuevo en un momento"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "Ventana de contexto"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "Ventana de contexto:"@@ -4694,6 +4713,10 @@ msgstr "Datos"msgid "Date"msgstr "Fecha"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "Predeterminado"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "Ubicación por defecto de los adjuntos nuevos"@@ -8798,6 +8821,10 @@ msgstr "Los cambios nuevos de tu remoto aparecen en tu copia automáticamente."msgid "New chat with {agentName}"msgstr "Nuevo chat con {agentName}"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "Nuevo chat con otra ventana"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14425,6 +14452,10 @@ msgstr "Este comentario es sobre toda la propiedad"msgid "This composer doesn't accept attachments."msgstr "Aquí no se pueden adjuntar archivos."+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "Esta conversacion mantiene la ventana con la que empezo. Un chat nuevo puede usar otra."+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "No se pudo configurar porque la entrada del servidor MCP que necesita no se escribió."diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.jsonindex 60a9228a6..fc482b6a0 100644--- a/packages/app/src/locales/fr/messages.json+++ b/packages/app/src/locales/fr/messages.json@@ -239,6 +239,10 @@"Ajoute à la recherche un classement fondé sur le sens, afin que les pages liées par le concept ressortent même sans mots-clés communs."],"1NgrlY": ["Autres méthodes d'installation"],+ "1Ou_BW": [+ ["0"],+ " n'a pas confirmé le changement de fenêtre de contexte. Vérifiez la conversation avant de choisir à nouveau."+ ],"1QfxQT": ["Ignorer"],"1RluQD": ["Afficher le remplacement"],"1TA-aJ": ["Récupéré ", ["pulled"], " · envoyé ", ["pushed"]],@@ -307,6 +311,7 @@"2QoAQ-": ["Voir ", ["publisher"], " sur skills.sh"],"2RnFoM": ["Impossible de reprendre ce chat : ", ["0"]],"2Snes1": ["Ceci envoie l'adresse du lien hors de votre machine"],+ "2UTDg2": [["0"], " a conservé sa fenêtre de contexte actuelle."],"2VSPan": ["Terminal a été fermé pour faire de la place au panneau des agents."],"2XQ8Ww": ["Ouvrir l'aperçu quand l'agent modifie"],"2YOwme": ["Redémarré — exécute maintenant la v", ["appRuntime"], "."],@@ -1455,6 +1460,10 @@"Dut9Ht": ["Décrivez la compétence que vous voulez créer"],"DvGkXq": ["Impossible de créer ", ["effective"], " : ", ["0"]],"Dvr1Sg": ["Copie en cours"],+ "Dvvrs8": [+ ["0"],+ " n'a pas pu redémarrer avec cette fenêtre de contexte. Utilisez Réessayer pour le relancer."+ ],"Dvwa0U": ["Créer un worktree à partir de cette branche"],"Dz7fsq": ["Zoom avant"],"E-G19G": [@@ -2188,6 +2197,7 @@"LRLKnQ": ["Masquer les éléments résolus"],"LRgZAt": [["owner"], "/", ["name"], " existe déjà"],"LTeJuX": ["Basculer en plein écran"],+ "LXIm4m": ["Fenetre de contexte"],"LXdWeS": ["Titre de section moyen."],"LXfNU-": ["Navigation et suggestions"],"LYufDw": ["Échec de l'activation de la recherche sémantique — ", ["detail"]],@@ -2656,6 +2666,9 @@"QWdKwH": ["Déplacer"],"QYTOaN": ["Vous pourrez changer cela plus tard dans <0>Paramètres → Synchronisation</0>."],"QYfQdv": ["CLI ", ["displayName"]],+ "QcTjRP": [+ "Cette conversation garde la fenetre avec laquelle elle a commence. Une nouvelle conversation peut en utiliser une autre."+ ],"Qca--K": ["Un autre programme utilise Git ici — attendez qu'il termine, puis relancez la synchronisation (il retient <0>.git/index.lock</0>)"],@@ -5167,6 +5180,7 @@"nCzR-G": ["Copier le code ", ["userCode"]],"nDT8qt": [["0"], " initialisé mais impossible à ouvrir."],"nFAvDj": [["plugin"], " fournit ", ["0"], " autres compétences"],+ "nHUawj": ["Nouvelle conversation avec une autre fenetre"],"nJaz5Q": ["Remplace l'entrée OpenKnowledge que chacun possède déjà."],"nMSYz5": ["Ce chemin se trouve sur un volume externe (/Volumes/...). OpenKnowledge perdra la trace des fichiers lorsque le disque sera éjecté."@@ -5299,6 +5313,7 @@"otE4aj": ["Afficher les nœuds d'URL externes"],"ou1hFW": ["Bascule une liste numérotée."],"outYNy": ["Nom en double « ", ["keyName"], " »"],+ "ovBPCi": ["Par defaut"],"ovIGrT": ["Les données de collaboration locales de « ",["docName"],diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.poindex db0a935e7..559722d39 100644--- a/packages/app/src/locales/fr/messages.po+++ b/packages/app/src/locales/fr/messages.po@@ -302,6 +302,16 @@ msgstr "{0} agit sans demander — OpenKnowledge ne peut pas lui ajouter de demamsgid "{0} added, {1} removed"msgstr "{0} ajouté(s), {1} retiré(s)"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} n'a pas pu redémarrer avec cette fenêtre de contexte. Utilisez Réessayer pour le relancer."++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} n'a pas confirmé le changement de fenêtre de contexte. Vérifiez la conversation avant de choisir à nouveau."+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} est au-dessus de {destination}."msgid "{0} isn't installed yet — opening its download page."msgstr "{0} n'est pas encore installé — ouverture de sa page de téléchargement."+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} a conservé sa fenêtre de contexte actuelle."+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3563,6 +3578,10 @@ msgstr "Règles de contenu"msgid "Content rules not yet loaded — try again in a moment"msgstr "Les règles de contenu ne sont pas encore chargées — réessayez dans un instant"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "Fenetre de contexte"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "Fenêtre de contexte :"@@ -4694,6 +4713,10 @@ msgstr "Données"msgid "Date"msgstr "Date"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "Par defaut"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "Emplacement par défaut des nouvelles pièces jointes"@@ -8798,6 +8821,10 @@ msgstr "Les nouvelles modifications de votre dépôt distant apparaissent automamsgid "New chat with {agentName}"msgstr "Nouveau chat avec {agentName}"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "Nouvelle conversation avec une autre fenetre"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14425,6 +14452,10 @@ msgstr "Ce commentaire porte sur toute la propriété"msgid "This composer doesn't accept attachments."msgstr "Impossible de joindre des fichiers ici."+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "Cette conversation garde la fenetre avec laquelle elle a commence. Une nouvelle conversation peut en utiliser une autre."+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "La configuration a échoué, car l'entrée de serveur MCP nécessaire n'a pas été écrite."diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.jsonindex 11a10a782..8039497c0 100644--- a/packages/app/src/locales/hi/messages.json+++ b/packages/app/src/locales/hi/messages.json@@ -195,6 +195,7 @@"खोज में अर्थ-आधारित रैंकिंग जोड़ें ताकि वैचारिक रूप से जुड़े पेज तब भी सामने आएँ जब उनमें कोई साझा कीवर्ड न हो।"],"1NgrlY": ["इंस्टॉल करने के अन्य तरीके"],+ "1Ou_BW": [["0"], " ने संदर्भ विंडो बदलने की पुष्टि नहीं की। दोबारा चुनने से पहले बातचीत देखें।"],"1QfxQT": ["ख़ारिज करें"],"1RluQD": ["बदलें दिखाएँ"],"1TA-aJ": [["pulled"], " खींचा · ", ["pushed"], " भेजा"],@@ -253,6 +254,7 @@"2QoAQ-": ["skills.sh पर ", ["publisher"], " देखें"],"2RnFoM": ["यह चैट फिर से शुरू नहीं हो सकी: ", ["0"]],"2Snes1": ["यह लिंक का पता आपकी मशीन से बाहर भेजता है"],+ "2UTDg2": [["0"], " ने अपनी मौजूदा संदर्भ विंडो बनाए रखी।"],"2VSPan": ["एजेंट पैनल के लिए जगह बनाने हेतु Terminal बंद कर दिया गया।"],"2XQ8Ww": ["एजेंट के संपादन करने पर पूर्वावलोकन खोलें"],"2YOwme": ["पुनः आरंभ हुआ — अब v", ["appRuntime"], " चल रहा है।"],@@ -1179,6 +1181,7 @@"Dut9Ht": ["जो स्किल आप बनाना चाहते हैं उसका वर्णन करें"],"DvGkXq": [["effective"], " नहीं बनाया जा सका: ", ["0"]],"Dvr1Sg": ["कॉपी किया जा रहा है"],+ "Dvvrs8": [["0"], " उस संदर्भ विंडो पर पुनः आरंभ नहीं हो सका। इसे वापस लाने के लिए पुनः प्रयास करें।"],"Dvwa0U": ["इस ब्रांच से एक वर्कट्री बनाएँ"],"Dz7fsq": ["बड़ा करें"],"E-G19G": [@@ -1789,6 +1792,7 @@"LRLKnQ": ["सुलझे हुए छिपाएँ"],"LRgZAt": [["owner"], "/", ["name"], " पहले से मौजूद है"],"LTeJuX": ["पूर्ण स्क्रीन चालू या बंद करें"],+ "LXIm4m": ["संदर्भ विंडो"],"LXdWeS": ["मध्यम अनुभाग शीर्षक।"],"LXfNU-": ["नेविगेशन और सुझाव"],"LYufDw": ["अर्थ-आधारित खोज सक्षम करने में विफल — ", ["detail"]],@@ -2201,6 +2205,9 @@"QWdKwH": ["हिलाएँ"],"QYTOaN": ["आप इसे बाद में <0>Settings → Sync</0> में बदल सकते हैं।"],"QYfQdv": [["displayName"], " CLI"],+ "QcTjRP": [+ "यह बातचीत उसी विंडो के साथ चलती रहेगी जिससे शुरू हुई थी। नई बातचीत में दूसरी विंडो चुनी जा सकती है।"+ ],"Qca--K": ["कोई दूसरा प्रोग्राम यहाँ Git का उपयोग कर रहा है — उसके पूरा होने की प्रतीक्षा करें, फिर दोबारा सिंक करें (वह <0>.git/index.lock</0> रोके हुए है)"],@@ -4272,6 +4279,7 @@"nCzR-G": ["कोड ", ["userCode"], " कॉपी करें"],"nDT8qt": [["0"], " आरंभ किया गया पर उसे खोला नहीं जा सका।"],"nFAvDj": [["plugin"], " में ", ["0"], " अन्य स्किलें शामिल हैं"],+ "nHUawj": ["दूसरी विंडो के साथ नई बातचीत"],"nJaz5Q": ["हर एक में पहले से मौजूद OpenKnowledge प्रविष्टि को बदलता है।"],"nMSYz5": ["यह पथ किसी बाहरी वॉल्यूम (/Volumes/…) पर है। ड्राइव निकलने पर OpenKnowledge फ़ाइलों का पता खो देगा।"@@ -4395,6 +4403,7 @@"otE4aj": ["बाहरी URL नोड दिखाएँ"],"ou1hFW": ["क्रमित सूची चालू या बंद करें।"],"outYNy": ["दोहरा नाम \"", ["keyName"], "\""],+ "ovBPCi": ["डिफ़ॉल्ट"],"ovIGrT": ["\"",["docName"],diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.poindex f8ea762b4..ce1197760 100644--- a/packages/app/src/locales/hi/messages.po+++ b/packages/app/src/locales/hi/messages.po@@ -302,6 +302,16 @@ msgstr "{0} बिना पूछे काम करता है — OpenKnowmsgid "{0} added, {1} removed"msgstr "{0} जोड़े गए, {1} हटाए गए"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} उस संदर्भ विंडो पर पुनः आरंभ नहीं हो सका। इसे वापस लाने के लिए पुनः प्रयास करें।"++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} ने संदर्भ विंडो बदलने की पुष्टि नहीं की। दोबारा चुनने से पहले बातचीत देखें।"+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} {destination} के ऊपर है।"msgid "{0} isn't installed yet — opening its download page."msgstr "{0} अभी इंस्टॉल नहीं है — इसका डाउनलोड पेज खोला जा रहा है।"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} ने अपनी मौजूदा संदर्भ विंडो बनाए रखी।"+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3559,6 +3574,10 @@ msgstr "सामग्री नियम"msgid "Content rules not yet loaded — try again in a moment"msgstr "सामग्री नियम अभी लोड नहीं हुए — कुछ देर बाद फिर कोशिश करें"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "संदर्भ विंडो"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "संदर्भ विंडो:"@@ -4690,6 +4709,10 @@ msgstr "डेटा"msgid "Date"msgstr "तारीख़"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "डिफ़ॉल्ट"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "नए संलग्नकों का डिफ़ॉल्ट स्थान"@@ -8794,6 +8817,10 @@ msgstr "आपके रिमोट के नए बदलाव आपकीmsgid "New chat with {agentName}"msgstr "{agentName} के साथ नई चैट"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "दूसरी विंडो के साथ नई बातचीत"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14421,6 +14448,10 @@ msgstr "यह टिप्पणी पूरी प्रॉपर्टीmsgid "This composer doesn't accept attachments."msgstr "यहाँ फ़ाइलें अटैच नहीं की जा सकतीं।"+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "यह बातचीत उसी विंडो के साथ चलती रहेगी जिससे शुरू हुई थी। नई बातचीत में दूसरी विंडो चुनी जा सकती है।"+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "इसे सेट अप नहीं किया जा सका क्योंकि इसके लिए ज़रूरी MCP सर्वर एंट्री नहीं लिखी गई।"diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.jsonindex 151036706..21c0a99df 100644--- a/packages/app/src/locales/id/messages.json+++ b/packages/app/src/locales/id/messages.json@@ -195,6 +195,10 @@"Menambahkan pemeringkatan berbasis makna ke pencarian agar halaman yang berkaitan secara konsep tetap muncul meski tidak berbagi kata kunci."],"1NgrlY": ["Cara lain untuk memasang"],+ "1Ou_BW": [+ ["0"],+ " tidak mengonfirmasi perubahan jendela konteks. Periksa percakapan sebelum memilih lagi."+ ],"1QfxQT": ["Tutup"],"1RluQD": ["Tampilkan penggantian"],"1TA-aJ": ["Ditarik ", ["pulled"], " · dikirim ", ["pushed"]],@@ -255,6 +259,7 @@"2QoAQ-": ["Lihat ", ["publisher"], " di skills.sh"],"2RnFoM": ["Tidak dapat melanjutkan obrolan ini: ", ["0"]],"2Snes1": ["Ini mengirim alamat tautannya keluar dari komputer Anda"],+ "2UTDg2": [["0"], " mempertahankan jendela konteksnya saat ini."],"2VSPan": ["Terminal ditutup untuk memberi ruang bagi panel agen."],"2XQ8Ww": ["Buka pratinjau saat agen menyunting"],"2YOwme": ["Dimulai ulang — kini menjalankan v", ["appRuntime"], "."],@@ -1206,6 +1211,10 @@"Dut9Ht": ["Jelaskan keterampilan yang ingin Anda buat"],"DvGkXq": ["Tidak dapat membuat ", ["effective"], ": ", ["0"]],"Dvr1Sg": ["Menyalin"],+ "Dvvrs8": [+ ["0"],+ " tidak dapat dijalankan ulang pada jendela konteks itu. Gunakan Coba lagi untuk memulihkannya."+ ],"Dvwa0U": ["Buat worktree dari cabang ini"],"Dz7fsq": ["Perbesar"],"E-G19G": [@@ -1874,6 +1883,7 @@"LRLKnQ": ["Sembunyikan yang sudah selesai"],"LRgZAt": [["owner"], "/", ["name"], " sudah ada"],"LTeJuX": ["Layar Penuh"],+ "LXIm4m": ["Jendela konteks"],"LXdWeS": ["Judul bagian sedang."],"LXfNU-": ["Navigasi dan saran"],"LYufDw": ["Gagal mengaktifkan pencarian semantik — ", ["detail"]],@@ -2286,6 +2296,9 @@"QWdKwH": ["Pindahkan"],"QYTOaN": ["Anda bisa mengubah ini nanti di <0>Pengaturan → Sinkronisasi</0>."],"QYfQdv": ["CLI ", ["displayName"]],+ "QcTjRP": [+ "Percakapan ini mempertahankan jendela awalnya. Percakapan baru bisa memakai jendela lain."+ ],"Qca--K": ["Program lain sedang memakai Git di sini — tunggu sampai selesai, lalu sinkronkan lagi (program itu menahan <0>.git/index.lock</0>)"],@@ -4450,6 +4463,7 @@"nCzR-G": ["Salin kode ", ["userCode"]],"nDT8qt": [["0"], " diinisialisasi tetapi tidak dapat dibuka."],"nFAvDj": [["plugin"], " menyertakan ", ["0"], " keterampilan lain"],+ "nHUawj": ["Percakapan baru dengan jendela lain"],"nJaz5Q": ["Mengganti entri OpenKnowledge yang sudah dimiliki masing-masing."],"nMSYz5": ["Jalur ini berada di volume eksternal (/Volumes/...). OpenKnowledge akan kehilangan jejak berkasnya ketika drive itu dicabut."@@ -4572,6 +4586,7 @@"otE4aj": ["Tampilkan simpul URL eksternal"],"ou1hFW": ["Menyalakan atau mematikan daftar berurut."],"outYNy": ["Nama ganda \"", ["keyName"], "\""],+ "ovBPCi": ["Bawaan"],"ovIGrT": ["Data kolaborasi lokal untuk \"",["docName"],diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.poindex 101941ce5..2a1a494e7 100644--- a/packages/app/src/locales/id/messages.po+++ b/packages/app/src/locales/id/messages.po@@ -302,6 +302,16 @@ msgstr "{0} bertindak tanpa bertanya — OpenKnowledge tidak dapat menambahkan pmsgid "{0} added, {1} removed"msgstr "{0} ditambahkan, {1} dihapus"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} tidak dapat dijalankan ulang pada jendela konteks itu. Gunakan Coba lagi untuk memulihkannya."++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} tidak mengonfirmasi perubahan jendela konteks. Periksa percakapan sebelum memilih lagi."+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} berada di atas {destination}."msgid "{0} isn't installed yet — opening its download page."msgstr "{0} belum terpasang — membuka halaman unduhannya."+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} mempertahankan jendela konteksnya saat ini."+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3559,6 +3574,10 @@ msgstr "Aturan konten"msgid "Content rules not yet loaded — try again in a moment"msgstr "Aturan konten belum dimuat — coba lagi sebentar"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "Jendela konteks"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "Jendela konteks:"@@ -4690,6 +4709,10 @@ msgstr "Data"msgid "Date"msgstr "Tanggal"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "Bawaan"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "Lokasi bawaan untuk lampiran baru"@@ -8794,6 +8817,10 @@ msgstr "Perubahan baru dari remote Anda muncul di salinan Anda secara otomatis."msgid "New chat with {agentName}"msgstr "Obrolan baru dengan {agentName}"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "Percakapan baru dengan jendela lain"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14421,6 +14448,10 @@ msgstr "Komentar ini berlaku untuk seluruh properti"msgid "This composer doesn't accept attachments."msgstr "Berkas tidak bisa dilampirkan di sini."+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "Percakapan ini mempertahankan jendela awalnya. Percakapan baru bisa memakai jendela lain."+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "Ini tidak dapat disiapkan karena entri server MCP yang diperlukan tidak ditulis."diff --git a/packages/app/src/locales/ko/messages.json b/packages/app/src/locales/ko/messages.jsonindex e23270535..12b44cf45 100644--- a/packages/app/src/locales/ko/messages.json+++ b/packages/app/src/locales/ko/messages.json@@ -187,6 +187,10 @@"검색에 의미 기반 순위를 추가하여 공통 키워드가 없어도 개념적으로 관련된 페이지가 나타나게 합니다."],"1NgrlY": ["다른 설치 방법"],+ "1Ou_BW": [+ ["0"],+ "이(가) 컨텍스트 창 변경을 확인하지 않았습니다. 다시 선택하기 전에 대화를 확인하세요."+ ],"1QfxQT": ["닫기"],"1RluQD": ["바꾸기 표시"],"1TA-aJ": [["pulled"], " 풀 · ", ["pushed"], " 푸시"],@@ -245,6 +249,7 @@"2QoAQ-": ["skills.sh에서 ", ["publisher"], " 보기"],"2RnFoM": ["채팅 재개 실패: ", ["0"]],"2Snes1": ["이 컴퓨터 밖으로 링크 주소를 전송합니다"],+ "2UTDg2": [["0"], "이(가) 현재 컨텍스트 창을 유지했습니다."],"2VSPan": ["에이전트 패널을 위한 공간을 만들려고 Terminal을 닫았습니다."],"2XQ8Ww": ["에이전트가 편집할 때 미리보기를 엽니다."],"2YOwme": ["다시 시작했습니다. 현재 v", ["appRuntime"], "을 실행 중입니다."],@@ -1167,6 +1172,10 @@"Dut9Ht": ["만들려는 스킬 설명"],"DvGkXq": [["effective"], "을(를) 만들 수 없습니다: ", ["0"]],"Dvr1Sg": ["복사 중"],+ "Dvvrs8": [+ ["0"],+ "이(가) 해당 컨텍스트 창으로 다시 시작하지 못했습니다. 다시 시도를 눌러 복구하세요."+ ],"Dvwa0U": ["이 브랜치에서 워크트리 만들기"],"Dz7fsq": ["확대"],"E-G19G": [@@ -1790,6 +1799,7 @@"LRLKnQ": ["해결됨 숨기기"],"LRgZAt": [["owner"], "/", ["name"], "이 이미 존재합니다"],"LTeJuX": ["전체 화면 전환"],+ "LXIm4m": ["컨텍스트 창"],"LXdWeS": ["중간 크기 섹션 제목입니다."],"LXfNU-": ["탐색 및 제안"],"LYufDw": ["의미 기반 검색을 켜지 못했습니다: ", ["detail"]],@@ -2189,6 +2199,7 @@"QWdKwH": ["이동"],"QYTOaN": ["나중에 <0>설정 → 동기화</0>에서 변경할 수 있습니다."],"QYfQdv": [["displayName"], " CLI"],+ "QcTjRP": ["이 대화는 시작할 때의 창을 유지합니다. 새 대화에서는 다른 창을 쓸 수 있습니다."],"Qca--K": ["다른 프로그램이 여기서 Git을 사용 중입니다. 끝날 때까지 기다린 후 다시 동기화하세요(<0>.git/index.lock</0>을 잡고 있습니다)."],@@ -4259,6 +4270,7 @@"nCzR-G": ["코드 ", ["userCode"], " 복사"],"nDT8qt": [["0"], " 초기화 완료. 열기에 실패했습니다."],"nFAvDj": [["plugin"], "에 다른 스킬 ", ["0"], "개가 더 있습니다"],+ "nHUawj": ["다른 창으로 새 대화 시작"],"nJaz5Q": ["각각에 이미 있는 OpenKnowledge 항목을 교체합니다."],"nMSYz5": ["이 경로는 외부 볼륨(/Volumes/...)에 있습니다. 드라이브를 꺼내면 OpenKnowledge가 파일 추적을 잃습니다."@@ -4373,6 +4385,7 @@"otE4aj": ["외부 URL 노드 보기"],"ou1hFW": ["번호 매기기 목록을 전환합니다."],"outYNy": ["중복된 이름 \"", ["keyName"], "\""],+ "ovBPCi": ["기본값"],"ovIGrT": ["\"",["docName"],diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.poindex 24ab3674d..2fbefcad3 100644--- a/packages/app/src/locales/ko/messages.po+++ b/packages/app/src/locales/ko/messages.po@@ -302,6 +302,16 @@ msgstr "{0}이 확인 없이 작업합니다. OpenKnowledge는 이 에이전트msgid "{0} added, {1} removed"msgstr "{0}개 추가, {1}개 제거"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0}이(가) 해당 컨텍스트 창으로 다시 시작하지 못했습니다. 다시 시도를 눌러 복구하세요."++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0}이(가) 컨텍스트 창 변경을 확인하지 않았습니다. 다시 선택하기 전에 대화를 확인하세요."+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0}이 {destination} 위에 있습니다."msgid "{0} isn't installed yet — opening its download page."msgstr "{0} 미설치 상태입니다. 다운로드 페이지를 엽니다."+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0}이(가) 현재 컨텍스트 창을 유지했습니다."+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3563,6 +3578,10 @@ msgstr "콘텐츠 규칙"msgid "Content rules not yet loaded — try again in a moment"msgstr "콘텐츠 규칙을 아직 불러오지 못했습니다. 잠시 후 다시 시도합니다."+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "컨텍스트 창"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "컨텍스트 창:"@@ -4694,6 +4713,10 @@ msgstr "데이터"msgid "Date"msgstr "날짜"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "기본값"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "새 첨부 파일의 기본 위치"@@ -8798,6 +8821,10 @@ msgstr "원격의 새 변경 사항이 사본에 자동으로 표시됩니다."msgid "New chat with {agentName}"msgstr "{agentName}와 새 채팅"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "다른 창으로 새 대화 시작"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14425,6 +14452,10 @@ msgstr "이 댓글, 속성 전체에 적용됨"msgid "This composer doesn't accept attachments."msgstr "여기에는 파일을 첨부할 수 없습니다."+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "이 대화는 시작할 때의 창을 유지합니다. 새 대화에서는 다른 창을 쓸 수 있습니다."+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "필요한 MCP 서버 항목이 기록되지 않아 설정할 수 없었습니다."diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.jsonindex cfb4f6e21..c9c86edf6 100644--- a/packages/app/src/locales/pseudo/messages.json+++ b/packages/app/src/locales/pseudo/messages.json@@ -197,6 +197,10 @@"Àďď ḿēàńĩńĝ-ƀàśēď ŕàńķĩńĝ ţō śēàŕćĥ śō ćōńćēƥţũàĺĺŷ-ŕēĺàţēď ƥàĝēś śũŕƒàćē ēvēń ŵĥēń ţĥēŷ śĥàŕē ńō ķēŷŵōŕďś."],"1NgrlY": ["Ōţĥēŕ ŵàŷś ţō ĩńśţàĺĺ"],+ "1Ou_BW": [+ ["0"],+ " ďĩďń'ţ ćōńƒĩŕḿ ţĥē ćōńţēxţ ŵĩńďōŵ ćĥàńĝē. Ćĥēćķ ţĥē ćōńvēŕśàţĩōń ƀēƒōŕē ƥĩćķĩńĝ àĝàĩń."+ ],"1QfxQT": ["Ďĩśḿĩśś"],"1RluQD": ["Śĥōŵ ŕēƥĺàćē"],"1TA-aJ": ["Ƥũĺĺēď ", ["pulled"], " · ƥũśĥēď ", ["pushed"]],@@ -255,6 +259,7 @@"2QoAQ-": ["Vĩēŵ ", ["publisher"], " ōń śķĩĺĺś.śĥ"],"2RnFoM": ["Ćōũĺďń'ţ ŕēśũḿē ţĥĩś ćĥàţ: ", ["0"]],"2Snes1": ["Ţĥĩś śēńďś ţĥē ĺĩńķ'ś àďďŕēśś ōƒƒ ŷōũŕ ḿàćĥĩńē"],+ "2UTDg2": [["0"], " ķēƥţ ĩţś ćũŕŕēńţ ćōńţēxţ ŵĩńďōŵ."],"2VSPan": ["Ţēŕḿĩńàĺ ćĺōśēď ţō ḿàķē ŕōōḿ ƒōŕ ţĥē àĝēńţ ƥàńēĺ."],"2XQ8Ww": ["Ōƥēń ƥŕēvĩēŵ ŵĥēń àĝēńţ ēďĩţś"],"2YOwme": ["Ŕēśţàŕţēď — ńōŵ ŕũńńĩńĝ v", ["appRuntime"], "."],@@ -1203,6 +1208,7 @@"Dut9Ht": ["Ďēśćŕĩƀē ţĥē śķĩĺĺ ŷōũ ŵàńţ ţō ćŕēàţē"],"DvGkXq": ["Ćōũĺďń'ţ ćŕēàţē ", ["effective"], ": ", ["0"]],"Dvr1Sg": ["Ćōƥŷĩńĝ"],+ "Dvvrs8": [["0"], " ćōũĺďń'ţ ŕēśţàŕţ ōń ţĥàţ ćōńţēxţ ŵĩńďōŵ. Ũśē Ŕēţŕŷ ţō ƀŕĩńĝ ĩţ ƀàćķ."],"Dvwa0U": ["Ćŕēàţē à ŵōŕķţŕēē ƒŕōḿ ţĥĩś ƀŕàńćĥ"],"Dz7fsq": ["Źōōḿ Ĩń"],"E-G19G": [@@ -1841,6 +1847,7 @@"LRLKnQ": ["Ĥĩďē ŕēśōĺvēď"],"LRgZAt": [["owner"], "/", ["name"], " àĺŕēàďŷ ēxĩśţś"],"LTeJuX": ["Ţōĝĝĺē Ƒũĺĺ Śćŕēēń"],+ "LXIm4m": ["Ćōńţēxţ ŵĩńďōŵ"],"LXdWeS": ["Ḿēďĩũḿ śēćţĩōń ĥēàďĩńĝ."],"LXfNU-": ["Ńàvĩĝàţĩōń àńď śũĝĝēśţĩōńś"],"LYufDw": ["Ƒàĩĺēď ţō ēńàƀĺē śēḿàńţĩć śēàŕćĥ — ", ["detail"]],@@ -2268,6 +2275,9 @@"QWdKwH": ["Ḿōvē"],"QYTOaN": ["Ŷōũ ćàń ćĥàńĝē ţĥĩś ĺàţēŕ ĩń <0>Śēţţĩńĝś → Śŷńć</0>."],"QYfQdv": [["displayName"], " ĆĹĨ"],+ "QcTjRP": [+ "Ţĥĩś ćōńvēŕśàţĩōń ķēēƥś ţĥē ŵĩńďōŵ ĩţ śţàŕţēď ŵĩţĥ. À ńēŵ ćĥàţ ćàń ũśē à ďĩƒƒēŕēńţ ōńē."+ ],"Qca--K": ["Àńōţĥēŕ ƥŕōĝŕàḿ ĩś ũśĩńĝ Ĝĩţ ĥēŕē — ŵàĩţ ƒōŕ ĩţ ţō ƒĩńĩśĥ, ţĥēń śŷńć àĝàĩń (ĩţ ĥōĺďś <0>.ĝĩţ/ĩńďēx.ĺōćķ</0>)"],@@ -4418,6 +4428,7 @@"nCzR-G": ["Ćōƥŷ ćōďē ", ["userCode"]],"nDT8qt": ["Ĩńĩţĩàĺĩźēď ", ["0"], " ƀũţ ćōũĺď ńōţ ōƥēń ĩţ."],"nFAvDj": [["plugin"], " śĥĩƥś ", ["0"], " ōţĥēŕ śķĩĺĺś"],+ "nHUawj": ["Ńēŵ ćĥàţ ŵĩţĥ à ďĩƒƒēŕēńţ ŵĩńďōŵ"],"nJaz5Q": ["Ŕēƥĺàćēś ţĥē ŌƥēńĶńōŵĺēďĝē ēńţŕŷ ēàćĥ ōƒ ţĥēḿ àĺŕēàďŷ ĥàś."],"nMSYz5": ["Ţĥĩś ƥàţĥ ĩś ōń àń ēxţēŕńàĺ vōĺũḿē (/Vōĺũḿēś/...). ŌƥēńĶńōŵĺēďĝē ŵĩĺĺ ĺōśē ţŕàćķ ōƒ ƒĩĺēś ŵĥēń ţĥē ďŕĩvē ēĴēćţś."@@ -4545,6 +4556,7 @@"otE4aj": ["Śĥōŵ ēxţēŕńàĺ ŨŔĹ ńōďēś"],"ou1hFW": ["Ţōĝĝĺē àń ōŕďēŕēď ĺĩśţ."],"outYNy": ["Ďũƥĺĩćàţē ńàḿē \"", ["keyName"], "\""],+ "ovBPCi": ["Ďēƒàũĺţ"],"ovIGrT": ["Ĺōćàĺ ćōĺĺàƀōŕàţĩōń ďàţà ƒōŕ \"",["docName"],diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.poindex c2cf684a0..1e1b4ad29 100644--- a/packages/app/src/locales/pseudo/messages.po+++ b/packages/app/src/locales/pseudo/messages.po@@ -302,6 +302,16 @@ msgstr ""msgid "{0} added, {1} removed"msgstr ""+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr ""++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr ""+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr ""msgid "{0} isn't installed yet — opening its download page."msgstr ""+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr ""+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3559,6 +3574,10 @@ msgstr ""msgid "Content rules not yet loaded — try again in a moment"msgstr ""+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr ""+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr ""@@ -4690,6 +4709,10 @@ msgstr ""msgid "Date"msgstr ""+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr ""+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr ""@@ -8794,6 +8817,10 @@ msgstr ""msgid "New chat with {agentName}"msgstr ""+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr ""+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14421,6 +14448,10 @@ msgstr ""msgid "This composer doesn't accept attachments."msgstr ""+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr ""+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr ""diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.jsonindex ac01cb885..733abd003 100644--- a/packages/app/src/locales/pt-BR/messages.json+++ b/packages/app/src/locales/pt-BR/messages.json@@ -233,6 +233,10 @@"Adiciona à busca uma classificação por significado para que páginas relacionadas conceitualmente apareçam mesmo sem palavras-chave em comum."],"1NgrlY": ["Outras formas de instalar"],+ "1Ou_BW": [+ ["0"],+ " não confirmou a mudança da janela de contexto. Verifique a conversa antes de escolher de novo."+ ],"1QfxQT": ["Dispensar"],"1RluQD": ["Mostrar substituir"],"1TA-aJ": ["Baixado ", ["pulled"], " · enviado ", ["pushed"]],@@ -295,6 +299,7 @@"2QoAQ-": ["Ver ", ["publisher"], " no skills.sh"],"2RnFoM": ["Não foi possível retomar este chat: ", ["0"]],"2Snes1": ["Isto envia o endereço do link para fora do seu computador"],+ "2UTDg2": [["0"], " manteve a janela de contexto atual."],"2VSPan": ["O Terminal foi fechado para abrir espaço para o painel de agentes."],"2XQ8Ww": ["Abrir a pré-visualização quando o agente editar"],"2YOwme": ["Reiniciado — agora rodando a v", ["appRuntime"], "."],@@ -1402,6 +1407,10 @@"Dut9Ht": ["Descreva a habilidade que você quer criar"],"DvGkXq": ["Não foi possível criar ", ["effective"], ": ", ["0"]],"Dvr1Sg": ["Copiando"],+ "Dvvrs8": [+ ["0"],+ " não conseguiu reiniciar com essa janela de contexto. Use Tentar novamente para retomá-lo."+ ],"Dvwa0U": ["Criar um worktree a partir deste ramo"],"Dz7fsq": ["Aproximar"],"E-G19G": [@@ -2118,6 +2127,7 @@"LRLKnQ": ["Ocultar os resolvidos"],"LRgZAt": [["owner"], "/", ["name"], " já existe"],"LTeJuX": ["Ativar ou desativar a tela cheia"],+ "LXIm4m": ["Janela de contexto"],"LXdWeS": ["Título de seção médio."],"LXfNU-": ["Navegação e sugestões"],"LYufDw": ["Falha ao ativar a busca semântica — ", ["detail"]],@@ -2586,6 +2596,7 @@"QWdKwH": ["Mover"],"QYTOaN": ["Você pode mudar isto depois em <0>Configurações → Sincronização</0>."],"QYfQdv": ["CLI do ", ["displayName"]],+ "QcTjRP": ["Esta conversa mantem a janela com que comecou. Uma nova conversa pode usar outra."],"Qca--K": ["Outro programa está usando o Git aqui — espere ele terminar e sincronize de novo (ele está segurando o <0>.git/index.lock</0>)"],@@ -5022,6 +5033,7 @@"nCzR-G": ["Copiar o código ", ["userCode"]],"nDT8qt": [["0"], " inicializado, mas não foi possível abri-lo."],"nFAvDj": [["plugin"], " inclui ", ["0"], " outras habilidades"],+ "nHUawj": ["Nova conversa com outra janela"],"nJaz5Q": ["Substitui a entrada do OpenKnowledge que cada um já tem."],"nMSYz5": ["Este caminho está em um volume externo (/Volumes/...). O OpenKnowledge vai perder os arquivos de vista quando a unidade for ejetada."@@ -5152,6 +5164,7 @@"otE4aj": ["Mostrar os nós de URL externa"],"ou1hFW": ["Liga ou desliga uma lista ordenada."],"outYNy": ["Nome duplicado \"", ["keyName"], "\""],+ "ovBPCi": ["Padrao"],"ovIGrT": ["Não foi possível limpar os dados locais de colaboração de \"",["docName"],diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.poindex 85c40c40f..43b15e554 100644--- a/packages/app/src/locales/pt-BR/messages.po+++ b/packages/app/src/locales/pt-BR/messages.po@@ -302,6 +302,16 @@ msgstr "{0} age sem perguntar — o OpenKnowledge não consegue adicionar pedidomsgid "{0} added, {1} removed"msgstr "{0} adicionados, {1} removidos"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} não conseguiu reiniciar com essa janela de contexto. Use Tentar novamente para retomá-lo."++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} não confirmou a mudança da janela de contexto. Verifique a conversa antes de escolher de novo."+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} está sobre {destination}."msgid "{0} isn't installed yet — opening its download page."msgstr "{0} ainda não está instalado — abrindo sua página de download."+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} manteve a janela de contexto atual."+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3559,6 +3574,10 @@ msgstr "Regras de conteúdo"msgid "Content rules not yet loaded — try again in a moment"msgstr "As regras de conteúdo ainda não carregaram — tente de novo em instantes"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "Janela de contexto"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "Janela de contexto:"@@ -4690,6 +4709,10 @@ msgstr "Dados"msgid "Date"msgstr "Data"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "Padrao"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "Local padrão para novos anexos"@@ -8794,6 +8817,10 @@ msgstr "As novidades do seu remoto aparecem na sua cópia automaticamente."msgid "New chat with {agentName}"msgstr "Novo chat com {agentName}"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "Nova conversa com outra janela"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14421,6 +14448,10 @@ msgstr "Este comentário é sobre a propriedade inteira"msgid "This composer doesn't accept attachments."msgstr "Não é possível anexar arquivos aqui."+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "Esta conversa mantem a janela com que comecou. Uma nova conversa pode usar outra."+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "Não foi possível configurar porque a entrada do servidor MCP necessária não foi gravada."diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.jsonindex 2693f70f1..9d3e40677 100644--- a/packages/app/src/locales/ur/messages.json+++ b/packages/app/src/locales/ur/messages.json@@ -195,6 +195,10 @@"تلاش میں معنی پر مبنی درجہ بندی شامل کریں تاکہ تصوراتی طور پر متعلقہ صفحات اس وقت بھی سامنے آئیں جب ان میں کوئی مشترک کلیدی الفاظ نہ ہوں۔"],"1NgrlY": ["انسٹال کرنے کے دیگر طریقے"],+ "1Ou_BW": [+ ["0"],+ " نے سیاق ونڈو کی تبدیلی کی تصدیق نہیں کی۔ دوبارہ منتخب کرنے سے پہلے گفتگو دیکھیں۔"+ ],"1QfxQT": ["برخاست کریں"],"1RluQD": ["تبدیلی دکھائیں"],"1TA-aJ": [["pulled"], " کھینچا · ", ["pushed"], " بھیجا"],@@ -255,6 +259,7 @@"2QoAQ-": ["skills.sh پر ", ["publisher"], " دیکھیں"],"2RnFoM": ["یہ چیٹ دوبارہ شروع نہیں ہو سکی: ", ["0"]],"2Snes1": ["یہ لنک کا پتہ آپ کی مشین سے باہر بھیجتا ہے"],+ "2UTDg2": [["0"], " نے اپنی موجودہ سیاق ونڈو برقرار رکھی۔"],"2VSPan": ["ایجنٹ پینل کے لیے جگہ بنانے کی خاطر Terminal بند کر دیا گیا۔"],"2XQ8Ww": ["ایجنٹ کی ترمیم پر پیش منظر کھولیں"],"2YOwme": ["دوبارہ چل پڑا — اب v", ["appRuntime"], " چل رہا ہے۔"],@@ -1223,6 +1228,10 @@"Dut9Ht": ["جو مہارت آپ بنانا چاہتے ہیں اسے بیان کریں"],"DvGkXq": [["effective"], " نہیں بنایا جا سکا: ", ["0"]],"Dvr1Sg": ["نقل کیا جا رہا ہے"],+ "Dvvrs8": [+ ["0"],+ " اس سیاق ونڈو پر دوبارہ شروع نہیں ہو سکا۔ اسے واپس لانے کے لیے دوبارہ کوشش کریں۔"+ ],"Dvwa0U": ["اس برانچ سے ورک ٹری بنائیں"],"Dz7fsq": ["بڑا کریں"],"E-G19G": [@@ -1881,6 +1890,7 @@"LRLKnQ": ["حل شدہ چھپائیں"],"LRgZAt": [["owner"], "/", ["name"], " پہلے سے موجود ہے"],"LTeJuX": ["پوری اسکرین بدلیں"],+ "LXIm4m": ["سیاق و سباق ونڈو"],"LXdWeS": ["درمیانہ سیکشن عنوان۔"],"LXfNU-": ["نیویگیشن اور تجاویز"],"LYufDw": ["معنوی تلاش فعال نہیں ہو سکی — ", ["detail"]],@@ -2309,6 +2319,9 @@"QWdKwH": ["منتقل کریں"],"QYTOaN": ["آپ اسے بعد میں <0>ترتیبات ← مطابقت پذیری</0> میں بدل سکتے ہیں۔"],"QYfQdv": [["displayName"], " CLI"],+ "QcTjRP": [+ "یہ گفتگو اسی ونڈو کے ساتھ رہتی ہے جس سے شروع ہوئی تھی۔ نئی گفتگو میں دوسری ونڈو استعمال ہو سکتی ہے۔"+ ],"Qca--K": ["کوئی دوسرا پروگرام یہاں Git استعمال کر رہا ہے — اس کے مکمل ہونے کا انتظار کریں، پھر دوبارہ مطابقت پذیری کریں (وہ <0>.git/index.lock</0> روکے ہوئے ہے)"],@@ -4516,6 +4529,7 @@"nCzR-G": ["کوڈ ", ["userCode"], " نقل کریں"],"nDT8qt": [["0"], " کا ابتدائیہ ہو گیا مگر یہ کھل نہیں سکا۔"],"nFAvDj": [["plugin"], " میں ", ["0"], " مزید مہارتیں شامل ہیں"],+ "nHUawj": ["مختلف ونڈو کے ساتھ نئی گفتگو"],"nJaz5Q": ["ہر ایک میں پہلے سے موجود OpenKnowledge اندراج کو بدل دیتا ہے۔"],"nMSYz5": ["یہ راستہ بیرونی والیوم پر ہے (/Volumes/...)۔ ڈرائیو نکالنے پر OpenKnowledge فائلوں کا سراغ کھو دے گا۔"@@ -4641,6 +4655,7 @@"otE4aj": ["بیرونی URL نوڈز دکھائیں"],"ou1hFW": ["مرتب فہرست بدلیں۔"],"outYNy": ["دہرا نام «", ["keyName"], "»"],+ "ovBPCi": ["ڈیفالٹ"],"ovIGrT": ["«",["docName"],diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.poindex 7f5c35541..d509076a1 100644--- a/packages/app/src/locales/ur/messages.po+++ b/packages/app/src/locales/ur/messages.po@@ -302,6 +302,16 @@ msgstr "{0} پوچھے بغیر عمل کرتا ہے — OpenKnowledge اس کےmsgid "{0} added, {1} removed"msgstr "{0} شامل، {1} ہٹائے گئے"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} اس سیاق ونڈو پر دوبارہ شروع نہیں ہو سکا۔ اسے واپس لانے کے لیے دوبارہ کوشش کریں۔"++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} نے سیاق ونڈو کی تبدیلی کی تصدیق نہیں کی۔ دوبارہ منتخب کرنے سے پہلے گفتگو دیکھیں۔"+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} {destination} کے اوپر ہے۔"msgid "{0} isn't installed yet — opening its download page."msgstr "{0} ابھی نصب نہیں ہے — اس کا ڈاؤن لوڈ صفحہ کھولا جا رہا ہے۔"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} نے اپنی موجودہ سیاق ونڈو برقرار رکھی۔"+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3563,6 +3578,10 @@ msgstr "مواد کے قواعد"msgid "Content rules not yet loaded — try again in a moment"msgstr "مواد کے قواعد ابھی لوڈ نہیں ہوئے — تھوڑی دیر بعد دوبارہ کوشش کریں"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "سیاق و سباق ونڈو"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "سیاق کی ونڈو:"@@ -4694,6 +4713,10 @@ msgstr "ڈیٹا"msgid "Date"msgstr "تاریخ"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "ڈیفالٹ"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "نئے منسلکات کے لیے طے شدہ مقام"@@ -8798,6 +8821,10 @@ msgstr "آپ کے ریموٹ کی نئی تبدیلیاں خودکار طور پmsgid "New chat with {agentName}"msgstr "{agentName} کے ساتھ نئی چیٹ"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "مختلف ونڈو کے ساتھ نئی گفتگو"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14425,6 +14452,10 @@ msgstr "یہ تبصرہ پوری خصوصیت پر ہے"msgid "This composer doesn't accept attachments."msgstr "یہاں فائلیں منسلک نہیں کی جا سکتیں۔"+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "یہ گفتگو اسی ونڈو کے ساتھ رہتی ہے جس سے شروع ہوئی تھی۔ نئی گفتگو میں دوسری ونڈو استعمال ہو سکتی ہے۔"+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "اسے سیٹ اپ نہیں کیا جا سکا کیونکہ اس کے لیے درکار MCP سرور اندراج نہیں لکھا گیا۔"diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.jsonindex efc7998f1..d46e6b552 100644--- a/packages/app/src/locales/zh-Hans/messages.json+++ b/packages/app/src/locales/zh-Hans/messages.json@@ -174,6 +174,7 @@"1MGRQl": ["终端会话"],"1NKoc6": ["为搜索加入基于语义的排序,即使没有共同关键词,概念相关的页面也能被找到。"],"1NgrlY": ["其他安装方式"],+ "1Ou_BW": [["0"], " 未确认上下文窗口的更改。请先查看该对话,再重新选择。"],"1QfxQT": ["忽略"],"1RluQD": ["显示替换"],"1TA-aJ": [["pulled"], "拉取 · ", ["pushed"], "推送"],@@ -230,6 +231,7 @@"2QoAQ-": ["在 skills.sh 上查看 ", ["publisher"]],"2RnFoM": ["无法恢复此对话:", ["0"]],"2Snes1": ["这会把链接地址发送到你的电脑之外"],+ "2UTDg2": [["0"], " 保留了当前的上下文窗口。"],"2VSPan": ["已关闭 Terminal,为智能体面板腾出空间。"],"2XQ8Ww": ["智能体编辑时打开预览"],"2YOwme": ["已重启——现在运行的是 v", ["appRuntime"], "。"],@@ -1061,6 +1063,7 @@"Dut9Ht": ["描述你想创建的技能"],"DvGkXq": ["无法创建 ", ["effective"], ":", ["0"]],"Dvr1Sg": ["正在复制"],+ "Dvvrs8": [["0"], " 无法在该上下文窗口下重启。请使用「重试」将其恢复。"],"Dvwa0U": ["基于这个分支创建 worktree"],"Dz7fsq": ["放大"],"E-G19G": [@@ -1610,6 +1613,7 @@"LRLKnQ": ["隐藏已解决的"],"LRgZAt": [["owner"], "/", ["name"], " 已存在"],"LTeJuX": ["切换全屏"],+ "LXIm4m": ["上下文窗口"],"LXdWeS": ["中号章节标题。"],"LXfNU-": ["导航与建议"],"LYufDw": ["开启语义搜索失败——", ["detail"]],@@ -1983,6 +1987,7 @@"QWdKwH": ["移动"],"QYTOaN": ["之后可以在<0>「设置 → 同步」</0>中更改。"],"QYfQdv": [["displayName"], " CLI"],+ "QcTjRP": ["本次对话保持开始时的窗口。新对话可以使用其他窗口。"],"Qca--K": ["另一个程序正在这里使用 Git——等它完成后再同步一次(它占用着 <0>.git/index.lock</0>)"],@@ -3855,6 +3860,7 @@"nCzR-G": ["复制验证码 ", ["userCode"]],"nDT8qt": ["已初始化 ", ["0"], ",但无法打开它。"],"nFAvDj": [["plugin"], " 还提供另外 ", ["0"], " 个技能"],+ "nHUawj": ["使用其他窗口新建对话"],"nJaz5Q": ["替换它们各自已有的 OpenKnowledge 条目。"],"nMSYz5": ["这个路径位于外置卷(/Volumes/...)。驱动器弹出后,OpenKnowledge 会跟丢这些文件。"],"nNYV3Y": ["另外还有 ", ["remaining"], " 个"],@@ -3963,6 +3969,7 @@"otE4aj": ["显示外部 URL 节点"],"ou1hFW": ["切换有序列表。"],"outYNy": ["名称重复 \"", ["keyName"], "\""],+ "ovBPCi": ["默认"],"ovIGrT": ["无法清除“", ["docName"], "”的本地协作数据。请重新加载后重试。"],"oxdGJn": ["在你离开之前,方便说说原因吗?"],"oxj8er": ["将智能体连接到此项目,使其可以读取、搜索和编辑你的文档。"],diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.poindex 899f71c76..5f922e482 100644--- a/packages/app/src/locales/zh-Hans/messages.po+++ b/packages/app/src/locales/zh-Hans/messages.po@@ -302,6 +302,16 @@ msgstr "{0} 不经询问即执行操作 — OpenKnowledge 无法为其添加权msgid "{0} added, {1} removed"msgstr "新增 {0} 项,移除 {1} 项"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} 无法在该上下文窗口下重启。请使用「重试」将其恢复。"++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} 未确认上下文窗口的更改。请先查看该对话,再重新选择。"+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} 位于 {destination} 上方。"msgid "{0} isn't installed yet — opening its download page."msgstr "{0} 尚未安装——正在打开它的下载页面。"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} 保留了当前的上下文窗口。"+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3563,6 +3578,10 @@ msgstr "内容规则"msgid "Content rules not yet loaded — try again in a moment"msgstr "内容规则尚未加载——请稍后再试"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "上下文窗口"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "上下文窗口:"@@ -4694,6 +4713,10 @@ msgstr "数据"msgid "Date"msgstr "日期"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "默认"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "新附件的默认位置"@@ -8798,6 +8821,10 @@ msgstr "来自远程的新改动会自动出现在你的副本中。"msgid "New chat with {agentName}"msgstr "与 {agentName} 的新对话"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "使用其他窗口新建对话"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14425,6 +14452,10 @@ msgstr "这条评论针对的是整个属性"msgid "This composer doesn't accept attachments."msgstr "此处无法添加附件。"+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "本次对话保持开始时的窗口。新对话可以使用其他窗口。"+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "无法完成设置,因为它所需的 MCP 服务器条目未写入。"diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.jsonindex 8b39ba70e..2d24909c5 100644--- a/packages/app/src/locales/zh-Hant/messages.json+++ b/packages/app/src/locales/zh-Hant/messages.json@@ -176,6 +176,7 @@"為搜尋加入以語意為基礎的排序,這樣即使沒有共同關鍵字,概念相關的頁面也能被找出來。"],"1NgrlY": ["其他安裝方式"],+ "1Ou_BW": [["0"], " 未確認脈絡視窗的變更。請先查看該對話,再重新選擇。"],"1QfxQT": ["關閉"],"1RluQD": ["顯示取代"],"1TA-aJ": [["pulled"], "拉取 · ", ["pushed"], "推送"],@@ -232,6 +233,7 @@"2QoAQ-": ["在 skills.sh 上檢視 ", ["publisher"]],"2RnFoM": ["無法恢復此對話:", ["0"]],"2Snes1": ["這會把連結的網址送出你的電腦"],+ "2UTDg2": [["0"], " 保留了目前的脈絡視窗。"],"2VSPan": ["已關閉 Terminal,為智慧代理面板騰出空間。"],"2XQ8Ww": ["代理編輯時開啟預覽"],"2YOwme": ["已重新啟動——現在執行的是 v", ["appRuntime"], "。"],@@ -1065,6 +1067,7 @@"Dut9Ht": ["描述你想建立的技能"],"DvGkXq": ["無法建立 ", ["effective"], ":", ["0"]],"Dvr1Sg": ["正在複製"],+ "Dvvrs8": [["0"], " 無法在該脈絡視窗下重新啟動。請使用「重試」將其復原。"],"Dvwa0U": ["從這個分支建立 worktree"],"Dz7fsq": ["放大"],"E-G19G": [@@ -1622,6 +1625,7 @@"LRLKnQ": ["隱藏已解決的"],"LRgZAt": [["owner"], "/", ["name"], " 已存在"],"LTeJuX": ["切換全螢幕"],+ "LXIm4m": ["上下文視窗"],"LXdWeS": ["中型章節標題。"],"LXfNU-": ["導覽與建議"],"LYufDw": ["開啟語意搜尋失敗——", ["detail"]],@@ -2001,6 +2005,7 @@"QWdKwH": ["移動"],"QYTOaN": ["之後可以在<0>「設定 → 同步」</0>中變更。"],"QYfQdv": [["displayName"], " CLI"],+ "QcTjRP": ["本次對話保持開始時的視窗。新對話可以使用其他視窗。"],"Qca--K": ["另一個程式正在這裡使用 Git——等它完成後再同步一次(它佔用著 <0>.git/index.lock</0>)"],@@ -3873,6 +3878,7 @@"nCzR-G": ["複製驗證碼 ", ["userCode"]],"nDT8qt": ["已初始化 ", ["0"], ",但無法開啟它。"],"nFAvDj": [["plugin"], " 還提供另外 ", ["0"], " 個技能"],+ "nHUawj": ["使用其他視窗新建對話"],"nJaz5Q": ["取代它們各自已有的 OpenKnowledge 項目。"],"nMSYz5": ["這個路徑在外接磁碟區(/Volumes/...)上。磁碟退出後,OpenKnowledge 會找不到這些檔案。"@@ -3983,6 +3989,7 @@"otE4aj": ["顯示外部 URL 節點"],"ou1hFW": ["切換編號清單。"],"outYNy": ["名稱重複「", ["keyName"], "」"],+ "ovBPCi": ["預設"],"ovIGrT": ["無法清除「", ["docName"], "」的本機協作資料。請重新載入後再試一次。"],"oxdGJn": ["在你離開之前,方便說說原因嗎?"],"oxj8er": ["將智慧代理連線至此專案,使其可以讀取、搜尋和編輯你的文件。"],diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.poindex d5aaa0596..6520fd477 100644--- a/packages/app/src/locales/zh-Hant/messages.po+++ b/packages/app/src/locales/zh-Hant/messages.po@@ -302,6 +302,16 @@ msgstr "{0} 不經詢問即執行操作 — OpenKnowledge 無法為其加入權msgid "{0} added, {1} removed"msgstr "新增 {0} 項,移除 {1} 項"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} couldn't restart on that context window. Use Retry to bring it back."+msgstr "{0} 無法在該脈絡視窗下重新啟動。請使用「重試」將其復原。"++#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} didn't confirm the context window change. Check the conversation before picking again."+msgstr "{0} 未確認脈絡視窗的變更。請先查看該對話,再重新選擇。"+#. placeholder {0}: info.agent.name#: src/components/acp/ThreadView.tsxmsgid "{0} doesn't offer any settings to adjust"@@ -331,6 +341,11 @@ msgstr "{0} 位於 {destination} 上方。"msgid "{0} isn't installed yet — opening its download page."msgstr "{0} 尚未安裝——正在開啟它的下載頁面。"+#. placeholder {0}: info.agent.name+#: src/components/acp/ThreadView.tsx+msgid "{0} kept its current context window."+msgstr "{0} 保留了目前的脈絡視窗。"+#. placeholder {0}: modeSurface.currentName#. placeholder {1}: info.agent.name#: src/components/acp/ThreadView.tsx@@ -3563,6 +3578,10 @@ msgstr "內容規則"msgid "Content rules not yet loaded — try again in a moment"msgstr "內容規則尚未載入——請稍候再試"+#: src/components/acp/ThreadView.tsx+msgid "Context window"+msgstr "上下文視窗"+#: src/components/acp/ThreadView.tsxmsgid "Context window:"msgstr "脈絡視窗:"@@ -4694,6 +4713,10 @@ msgstr "資料"msgid "Date"msgstr "日期"+#: src/components/acp/ThreadView.tsx+msgid "Default"+msgstr "預設"+#: src/components/settings/AttachmentsSection.tsxmsgid "Default location for new attachments"msgstr "新附件的預設位置"@@ -8798,6 +8821,10 @@ msgstr "來自遠端的新變更會自動出現在你的副本裡。"msgid "New chat with {agentName}"msgstr "與 {agentName} 的新對話"+#: src/components/acp/ThreadView.tsx+msgid "New chat with a different window"+msgstr "使用其他視窗新建對話"+#: src/components/AppMenubar.tsx#: src/components/command-palette-commands.ts#: src/components/FileSidebar.tsx@@ -14425,6 +14452,10 @@ msgstr "這則註解是針對整個屬性的"msgid "This composer doesn't accept attachments."msgstr "此處無法附加檔案。"+#: src/components/acp/ThreadView.tsx+msgid "This conversation keeps the window it started with. A new chat can use a different one."+msgstr "本次對話保持開始時的視窗。新對話可以使用其他視窗。"+#: src/components/settings/AgentConnectionDialogs.tsxmsgid "This could not be set up because the MCP server entry it needs was not written."msgstr "無法完成設定,因為它所需的 MCP 伺服器項目未寫入。"diff --git a/packages/app/tests/integration/attribution-sweep-coverage.test.ts b/packages/app/tests/integration/attribution-sweep-coverage.test.tsindex ca67438ff..a0f75c468 100644--- a/packages/app/tests/integration/attribution-sweep-coverage.test.ts+++ b/packages/app/tests/integration/attribution-sweep-coverage.test.ts@@ -52,6 +52,7 @@ const EXEMPT_HANDLERS = new Set(['handleDocumentRead','handleDocumentList','handleAcpCatalog',+ 'handleAcpModels','handleEmbedDetect','handleAsset','handleAssetText',diff --git a/packages/app/tests/integration/conflict-gate-coverage.test.ts b/packages/app/tests/integration/conflict-gate-coverage.test.tsindex 72dfa0aea..2dd8b04d8 100644--- a/packages/app/tests/integration/conflict-gate-coverage.test.ts+++ b/packages/app/tests/integration/conflict-gate-coverage.test.ts@@ -44,6 +44,7 @@ const EXEMPT_HANDLERS = new Set(['handleDocumentRead','handleDocumentList','handleAcpCatalog',+ 'handleAcpModels','handleAsset','handleAssetText','handleBacklinks',diff --git a/packages/core/src/acp/thread-protocol.test.ts b/packages/core/src/acp/thread-protocol.test.tsindex 807058c1d..9249342ef 100644--- a/packages/core/src/acp/thread-protocol.test.ts+++ b/packages/core/src/acp/thread-protocol.test.ts@@ -390,6 +390,29 @@ describe('parseThreadClientFrame', () => {),).toBeNull();});++ test('set_context_window carries a positive token count and a reqId to answer', () => {+ expect(+ parseThreadClientFrame(+ JSON.stringify({ op: 'set_context_window', threadId: 't', reqId: 'cw1', tokens: 872000 }),+ ),+ ).toMatchObject({ op: 'set_context_window', threadId: 't', reqId: 'cw1', tokens: 872000 });+ for (const tokens of [0, -1, Number.NaN, Number.POSITIVE_INFINITY, '872000']) {+ expect(+ parseThreadClientFrame(+ JSON.stringify({ op: 'set_context_window', threadId: 't', reqId: 'cw1', tokens }),+ ),+ ).toBeNull();+ }+ expect(+ parseThreadClientFrame(+ JSON.stringify({ op: 'set_context_window', threadId: 't', tokens: 872000 }),+ ),+ ).toBeNull();+ expect(+ parseThreadClientFrame(JSON.stringify({ op: 'set_context_window', reqId: 'cw1', tokens: 1 })),+ ).toBeNull();+ });});describe('parseThreadClientFrame create settings', () => {diff --git a/packages/core/src/acp/thread-protocol.ts b/packages/core/src/acp/thread-protocol.tsindex 0b770ef04..d3a17dc76 100644--- a/packages/core/src/acp/thread-protocol.ts+++ b/packages/core/src/acp/thread-protocol.ts@@ -122,6 +122,7 @@ export interface ThreadInfo {promptCapabilities?: PromptCapabilities | null;modes?: SessionModeState | null;configOptions?: SessionConfigOption[] | null;+ contextWindow?: number | null;availableCommands?: AvailableCommand[] | null;lastSeq: number;archived?: boolean;@@ -308,6 +309,7 @@ export type ThreadClientFrame =configId: string;value: string | boolean;}+ | { op: 'set_context_window'; threadId: string; reqId: string; tokens: number }| { op: 'close'; threadId: string }| {op: 'rename';@@ -342,6 +344,7 @@ export type ThreadServerFrame =| { op: 'created'; reqId: string; info: ThreadInfo }| { op: 'resumed'; reqId: string; info: ThreadInfo }| { op: 'retried'; reqId: string; info: ThreadInfo }+ | { op: 'context_window_set'; reqId: string; info: ThreadInfo }| { op: 'authenticated'; reqId: string; info: ThreadInfo }| { op: 'subscribed'; threadId: string; fromSeq: number; info: ThreadInfo }| { op: 'event'; threadId: string; seq: number; event: ThreadEvent }@@ -393,6 +396,7 @@ const CLIENT_OPS = new Set(['cancel','set_mode','set_config_option',+ 'set_context_window','close','rename','resume',@@ -538,6 +542,11 @@ export function parseThreadClientFrame(raw: string): ThreadClientFrame | null {if (typeof frame.value !== 'string' && typeof frame.value !== 'boolean') return null;if (frame.value === '') return null;return frame as unknown as ThreadClientFrame;+ case 'set_context_window':+ if (!str('threadId') || !str('reqId')) return null;+ if (typeof frame.tokens !== 'number' || !Number.isFinite(frame.tokens)) return null;+ if (frame.tokens <= 0) return null;+ return frame as unknown as ThreadClientFrame;case 'resume':if (!str('threadId') || !str('reqId')) return null;if (frame.prompt !== undefined && typeof frame.prompt !== 'string') return null;diff --git a/packages/desktop/tests/smoke/agent-patch-divergence-probe.e2e.ts b/packages/desktop/tests/smoke/agent-patch-divergence-probe.e2e.tsindex ad1e39ae5..d21b40af0 100644--- a/packages/desktop/tests/smoke/agent-patch-divergence-probe.e2e.ts+++ b/packages/desktop/tests/smoke/agent-patch-divergence-probe.e2e.ts@@ -131,9 +131,19 @@ async function resolveLeftoverConflict(port: number, docName: string): Promise<vif (res.ok || res.status === 404 || res.status === 503) return;}+function seedRetryDelayMs(body: string): number {+ try {+ const parsed = JSON.parse(body) as { retryAfterSeconds?: unknown };+ const seconds = Number(parsed.retryAfterSeconds);+ if (Number.isFinite(seconds) && seconds > 0) return Math.min(seconds, 10) * 1000;+ } catch {}+ return 3_000;+}+async function seedProbeDocument(port: number, docName: string, markdown: string): Promise<void> {await resolveLeftoverConflict(port, docName);- for (let attempt = 0; attempt < 3; attempt++) {+ const attempts = 5;+ for (let attempt = 0; attempt < attempts; attempt++) {const seedRes = await fetch(`http://localhost:${port}/api/agent-write-md`, {method: 'POST',headers: { 'content-type': 'application/json' },@@ -146,12 +156,13 @@ async function seedProbeDocument(port: number, docName: string, markdown: string}),});if (seedRes.ok) return;- if (seedRes.status === 409 && attempt < 2) {+ const body = await seedRes.text();+ if (seedRes.status === 409 && attempt < attempts - 1) {await resolveLeftoverConflict(port, docName);- await wait(250);+ await wait(seedRetryDelayMs(body));continue;}- throw new Error(`Seed write failed: ${seedRes.status} ${await seedRes.text()}`);+ throw new Error(`Seed write failed: ${seedRes.status} ${body}`);}}diff --git a/packages/server/src/acp/model-discovery/candidates.test.ts b/packages/server/src/acp/model-discovery/candidates.test.tsnew file mode 100644index 000000000..64ecad553--- /dev/null+++ b/packages/server/src/acp/model-discovery/candidates.test.ts@@ -0,0 +1,162 @@+import { describe, expect, test } from 'vitest';+import { claudeCandidates, codexCandidates, revalidateFreshness } from './candidates.ts';+import type { ScopeFingerprint } from './types.ts';++const scope: ScopeFingerprint = {+ harness: 'test',+ cliVersion: '1.0.0',+ adapterVersion: '2.0.0',+ endpoint: null,+ account: null,+};++describe('Claude rows', () => {+ const rows = claudeCandidates(+ [+ { value: 'claude-opus-4-8', label: 'Opus 4.8' },+ { value: 'claude-opus-4-8[1m]', label: 'Opus 4.8 (1M)' },+ { value: 'claude-sonnet-5', label: 'Sonnet 5' },+ ],+ scope,+ );++ test('variants of one model share a group', () => {+ const opus = rows.filter((r) => r.group === 'claude-opus-4-8');+ expect(opus.map((r) => r.value)).toEqual(['claude-opus-4-8', 'claude-opus-4-8[1m]']);+ });++ test('a tagged variant carries the window its id encodes', () => {+ const long = rows.find((r) => r.value === 'claude-opus-4-8[1m]');+ expect(long?.context).toEqual({ effectiveTokens: 1_000_000, origin: 'model-variant' });+ });++ test('an untagged variant claims no window rather than inventing one', () => {+ expect(rows.find((r) => r.value === 'claude-opus-4-8')?.context).toBeNull();+ });++ test('every Claude row is applied after the session exists', () => {+ expect(rows.every((r) => r.setPhase === 'acp-post-create')).toBe(true);+ });++ test('advertised rows are marked advertised and live', () => {+ expect(rows.every((r) => r.selectability === 'advertised')).toBe(true);+ expect(rows.every((r) => r.freshness.kind === 'live')).toBe(true);+ });+});++describe('Codex rows', () => {+ const rows = codexCandidates(+ [+ {+ slug: 'gpt-5.6-sol',+ contextWindow: 256_000,+ maxContextWindow: 872_000,+ effectivePercent: 95,+ },+ { slug: 'gpt-5.5', contextWindow: 272_000, maxContextWindow: 272_000, effectivePercent: 95 },+ ],+ scope,+ 1_700_000_000_000,+ );++ test('a model with headroom offers both its default and its ceiling', () => {+ expect(rows[0]?.contextChoices).toEqual([256_000, 872_000]);+ });++ test('the shown window is what the ceiling actually grants', () => {+ expect(rows[0]?.context).toEqual({ effectiveTokens: 828_400, origin: 'native-catalog' });+ });++ test('a model with one size offers exactly that', () => {+ expect(rows[1]?.contextChoices).toEqual([272_000]);+ expect(rows[1]?.context?.effectiveTokens).toBe(258_400);+ });++ test('every Codex row is a launch-time choice, not an ACP call', () => {+ expect(rows.every((r) => r.setPhase === 'launch-only')).toBe(true);+ });++ test('catalog rows are candidates, never advertised, and carry their age', () => {+ expect(rows.every((r) => r.selectability === 'candidate')).toBe(true);+ expect(rows[0]?.freshness).toEqual({ kind: 'cached', at: 1_700_000_000_000 });+ });+});++describe('a cached row whose environment changed underneath it', () => {+ const cached = codexCandidates(+ [+ {+ slug: 'gpt-5.6-sol',+ contextWindow: 256_000,+ maxContextWindow: 872_000,+ effectivePercent: 95,+ },+ ],+ scope,+ 1_700_000_000_000,+ );++ test('a matching environment leaves the row exactly as it was', () => {+ expect(revalidateFreshness(cached, scope)).toEqual(cached);+ });++ test('a different CLI version marks the row stale, keeping when it was captured', () => {+ const moved = revalidateFreshness(cached, { ...scope, cliVersion: '1.1.0' });+ expect(moved[0]?.freshness).toEqual({ kind: 'stale', at: 1_700_000_000_000 });+ });++ test('a different account marks it stale too', () => {+ const moved = revalidateFreshness(cached, { ...scope, account: 'someone-else' });+ expect(moved[0]?.freshness.kind).toBe('stale');+ });++ test('a stale row is never advertised as selectable', () => {+ const live = claudeCandidates([{ value: 'claude-opus-4-8[1m]' }], scope);+ expect(live[0]?.selectability).toBe('advertised');+ const moved = revalidateFreshness(live, { ...scope, adapterVersion: '3.0.0' });+ expect(moved[0]?.selectability).toBe('candidate');+ });+});++describe('catalog rows the CLI marks hidden', () => {+ const withHidden = codexCandidates(+ [+ {+ slug: 'gpt-5.6-sol',+ visibility: 'list',+ contextWindow: 272_000,+ maxContextWindow: 872_000,+ effectivePercent: 95,+ },+ {+ slug: 'gpt-reserve',+ visibility: 'hide',+ contextWindow: 272_000,+ maxContextWindow: 872_000,+ effectivePercent: 95,+ },+ {+ slug: 'codex-auto-review',+ visibility: 'hide',+ contextWindow: 272_000,+ maxContextWindow: 872_000,+ effectivePercent: 95,+ },+ ],+ scope,+ 1,+ );++ test('a hidden row is never offered as a choice', () => {+ expect(withHidden.map((c) => c.value)).toEqual(['gpt-5.6-sol']);+ });++ test('a row with no visibility field is treated as listed', () => {+ const rows = codexCandidates(+ [{ slug: 'x', contextWindow: 100, maxContextWindow: 100, effectivePercent: 95 }],+ scope,+ 1,+ );+ expect(rows).toHaveLength(1);+ });+});diff --git a/packages/server/src/acp/model-discovery/candidates.ts b/packages/server/src/acp/model-discovery/candidates.tsnew file mode 100644index 000000000..40c6f995c--- /dev/null+++ b/packages/server/src/acp/model-discovery/candidates.ts@@ -0,0 +1,84 @@+import { groupClaudeModelFamilies } from './claude-variant.ts';+import {+ type CodexCatalogModel,+ contextChoicesFor,+ effectiveContextTokens,+ isSelectableCatalogModel,+} from './codex-context.ts';+import { type ModelCandidate, type ScopeFingerprint, sameScope } from './types.ts';++export interface AdvertisedModelOption {+ readonly value: string;+ readonly label?: string;+ readonly description?: string;+}++export function claudeCandidates(+ advertised: readonly AdvertisedModelOption[],+ fingerprint: ScopeFingerprint,+): readonly ModelCandidate[] {+ const byValue = new Map(advertised.map((option) => [option.value, option]));+ const families = groupClaudeModelFamilies(advertised.map((option) => option.value));+ return families.flatMap((family) =>+ family.variants.map((variant): ModelCandidate => {+ const option = byValue.get(variant.raw);+ return {+ value: variant.raw,+ label: option?.label ?? variant.raw,+ description: option?.description ?? null,+ group: family.baseId,+ source: 'acp-session',+ fingerprint,+ freshness: { kind: 'live' },+ selectability: 'advertised',+ context:+ variant.nominalTokens === null+ ? null+ : { effectiveTokens: variant.nominalTokens, origin: 'model-variant' },+ contextChoices: variant.nominalTokens === null ? [] : [variant.nominalTokens],+ setPhase: 'acp-post-create',+ };+ }),+ );+}++export function codexCandidates(+ catalog: readonly CodexCatalogModel[],+ fingerprint: ScopeFingerprint,+ discoveredAt: number,+): readonly ModelCandidate[] {+ return catalog.filter(isSelectableCatalogModel).map((model): ModelCandidate => {+ const choices = contextChoicesFor(model);+ const preferred = choices.at(-1) ?? null;+ return {+ value: model.slug,+ label: model.slug,+ description: null,+ group: null,+ source: 'native-cli',+ fingerprint,+ freshness: { kind: 'cached', at: discoveredAt },+ selectability: 'candidate',+ context:+ preferred === null+ ? null+ : { effectiveTokens: effectiveContextTokens(preferred, model), origin: 'native-catalog' },+ contextChoices: choices,+ setPhase: 'launch-only',+ };+ });+}++export function revalidateFreshness(+ candidates: readonly ModelCandidate[],+ current: ScopeFingerprint,+): readonly ModelCandidate[] {+ return candidates.map((candidate) => {+ if (sameScope(candidate.fingerprint, current)) return candidate;+ if (candidate.freshness.kind === 'stale' || candidate.freshness.kind === 'unknown') {+ return candidate;+ }+ const at = candidate.freshness.kind === 'cached' ? candidate.freshness.at : Date.now();+ return { ...candidate, freshness: { kind: 'stale', at }, selectability: 'candidate' };+ });+}diff --git a/packages/server/src/acp/model-discovery/claude-variant.test.ts b/packages/server/src/acp/model-discovery/claude-variant.test.tsnew file mode 100644index 000000000..0c874fa69--- /dev/null+++ b/packages/server/src/acp/model-discovery/claude-variant.test.ts@@ -0,0 +1,78 @@+import { describe, expect, test } from 'vitest';+import {+ groupClaudeModelFamilies,+ hasContextChoice,+ nominalTokensForTag,+ parseClaudeModelVariant,+} from './claude-variant.ts';++describe('reading the window out of a Claude model id', () => {+ test('a tagged id splits into its base and its tag', () => {+ expect(parseClaudeModelVariant('claude-opus-4-8[1m]')).toEqual({+ raw: 'claude-opus-4-8[1m]',+ baseId: 'claude-opus-4-8',+ contextTag: '1m',+ nominalTokens: 1_000_000,+ });+ });++ test('an untagged id is its own base and claims no window', () => {+ expect(parseClaudeModelVariant('claude-opus-4-8')).toEqual({+ raw: 'claude-opus-4-8',+ baseId: 'claude-opus-4-8',+ contextTag: null,+ nominalTokens: null,+ });+ });++ test('the tag is decoded as notation, not looked up in a table', () => {+ expect(nominalTokensForTag('1m')).toBe(1_000_000);+ expect(nominalTokensForTag('200k')).toBe(200_000);+ expect(nominalTokensForTag('1.5m')).toBe(1_500_000);+ expect(nominalTokensForTag('1M')).toBe(1_000_000);+ });++ test('a tag that is not a size yields no number rather than a guess', () => {+ for (const tag of ['beta', '', 'm', '1g', '1 m', 'v2']) {+ expect(nominalTokensForTag(tag)).toBeNull();+ }+ });++ test('a non-size tag still separates the base id', () => {+ expect(parseClaudeModelVariant('some-model[beta]')).toMatchObject({+ baseId: 'some-model',+ contextTag: 'beta',+ nominalTokens: null,+ });+ });+});++describe('grouping variants into the model they belong to', () => {+ const advertised = ['claude-opus-4-8', 'claude-opus-4-8[1m]', 'claude-sonnet-5'];++ test('variants of one model collapse into a single family', () => {+ const families = groupClaudeModelFamilies(advertised);+ expect(families).toHaveLength(2);+ const opus = families.find((f) => f.baseId === 'claude-opus-4-8');+ expect(opus?.variants.map((v) => v.raw)).toEqual(['claude-opus-4-8', 'claude-opus-4-8[1m]']);+ });++ test('a family with more than one variant offers a window choice', () => {+ const families = groupClaudeModelFamilies(advertised);+ expect(hasContextChoice(families.find((f) => f.baseId === 'claude-opus-4-8') as never)).toBe(+ true,+ );+ expect(hasContextChoice(families.find((f) => f.baseId === 'claude-sonnet-5') as never)).toBe(+ false,+ );+ });++ test('advertised order is preserved inside a family', () => {+ const families = groupClaudeModelFamilies(['m[1m]', 'm']);+ expect(families[0]?.variants.map((v) => v.contextTag)).toEqual(['1m', null]);+ });++ test('nothing advertised yields no families', () => {+ expect(groupClaudeModelFamilies([])).toEqual([]);+ });+});diff --git a/packages/server/src/acp/model-discovery/claude-variant.ts b/packages/server/src/acp/model-discovery/claude-variant.tsnew file mode 100644index 000000000..0e1b59253--- /dev/null+++ b/packages/server/src/acp/model-discovery/claude-variant.ts@@ -0,0 +1,51 @@+export interface ClaudeModelVariant {+ readonly raw: string;+ readonly baseId: string;+ readonly contextTag: string | null;+ readonly nominalTokens: number | null;+}++export interface ClaudeModelFamily {+ readonly baseId: string;+ readonly variants: readonly ClaudeModelVariant[];+}++const VARIANT_SUFFIX = /^(?<base>.+?)\[(?<tag>[^\]]+)\]$/;+const TAGGED_SIZE = /^(?<amount>\d+(?:\.\d+)?)(?<unit>[km])$/i;++const UNIT_MULTIPLIER: Readonly<Record<string, number>> = { k: 1_000, m: 1_000_000 };++export function nominalTokensForTag(tag: string): number | null {+ const parsed = TAGGED_SIZE.exec(tag.trim());+ const amount = parsed?.groups?.amount;+ const unit = parsed?.groups?.unit;+ if (amount === undefined || unit === undefined) return null;+ const multiplier = UNIT_MULTIPLIER[unit.toLowerCase()];+ if (multiplier === undefined) return null;+ return Math.round(Number(amount) * multiplier);+}++export function parseClaudeModelVariant(value: string): ClaudeModelVariant {+ const matched = VARIANT_SUFFIX.exec(value);+ const base = matched?.groups?.base;+ const tag = matched?.groups?.tag;+ if (base === undefined || tag === undefined) {+ return { raw: value, baseId: value, contextTag: null, nominalTokens: null };+ }+ return { raw: value, baseId: base, contextTag: tag, nominalTokens: nominalTokensForTag(tag) };+}++export function groupClaudeModelFamilies(values: readonly string[]): readonly ClaudeModelFamily[] {+ const families = new Map<string, ClaudeModelVariant[]>();+ for (const value of values) {+ const variant = parseClaudeModelVariant(value);+ const existing = families.get(variant.baseId);+ if (existing === undefined) families.set(variant.baseId, [variant]);+ else existing.push(variant);+ }+ return [...families].map(([baseId, variants]) => ({ baseId, variants }));+}++export function hasContextChoice(family: ClaudeModelFamily): boolean {+ return family.variants.length > 1;+}diff --git a/packages/server/src/acp/model-discovery/codex-context.test.ts b/packages/server/src/acp/model-discovery/codex-context.test.tsnew file mode 100644index 000000000..9d8600040--- /dev/null+++ b/packages/server/src/acp/model-discovery/codex-context.test.ts@@ -0,0 +1,115 @@+import { describe, expect, test } from 'vitest';+import {+ CODEX_CONFIG_ENV,+ contextChoicesFor,+ effectiveContextTokens,+ parseCodexConfigEnv,+ withCodexContextWindow,+} from './codex-context.ts';++const sol = { maxContextWindow: 872_000, effectivePercent: 95 };+const gpt55 = { maxContextWindow: 272_000, effectivePercent: 95 };++describe('the window Codex actually grants', () => {+ test('a request under the ceiling is reduced only by the effective factor', () => {+ expect(effectiveContextTokens(500_000, sol)).toBe(475_000);+ });++ test('a request over the ceiling is clamped first, then reduced', () => {+ expect(effectiveContextTokens(9_999_999, sol)).toBe(828_400);+ });++ test('the ceiling follows the selected model, not the one the session started on', () => {+ expect(effectiveContextTokens(9_999_999, gpt55)).toBe(258_400);+ });++ test('an absent ceiling grants what was asked for', () => {+ expect(effectiveContextTokens(300_000, { maxContextWindow: null, effectivePercent: 95 })).toBe(+ 285_000,+ );+ });++ test('a missing factor falls back to the observed 95 percent', () => {+ expect(+ effectiveContextTokens(500_000, { maxContextWindow: 872_000, effectivePercent: null }),+ ).toBe(475_000);+ });++ test('a nonsense request grants nothing rather than a negative window', () => {+ for (const bad of [0, -1, Number.NaN, Number.POSITIVE_INFINITY]) {+ expect(effectiveContextTokens(bad, sol)).toBe(0);+ }+ });+});++describe('what a model offers to choose between', () => {+ test('a model whose default is below its ceiling offers both', () => {+ expect(+ contextChoicesFor({+ slug: 'sol',+ contextWindow: 256_000,+ maxContextWindow: 872_000,+ effectivePercent: 95,+ }),+ ).toEqual([256_000, 872_000]);+ });++ test('a model with one usable size offers exactly that one', () => {+ expect(+ contextChoicesFor({+ slug: 'x',+ contextWindow: 272_000,+ maxContextWindow: 272_000,+ effectivePercent: 95,+ }),+ ).toEqual([272_000]);+ });++ test('a catalog row carrying no sizes offers none rather than inventing one', () => {+ expect(+ contextChoicesFor({+ slug: 'x',+ contextWindow: null,+ maxContextWindow: null,+ effectivePercent: 95,+ }),+ ).toEqual([]);+ });+});++describe('the config the adapter reads at startup', () => {+ test('the requested window rides in CODEX_CONFIG', () => {+ const env = withCodexContextWindow({ PATH: '/usr/bin' }, 500_000);+ expect(JSON.parse(env[CODEX_CONFIG_ENV] as string)).toEqual({ model_context_window: 500_000 });+ expect(env.PATH).toBe('/usr/bin');+ });++ test('an existing config keeps its other keys', () => {+ const env = withCodexContextWindow(+ { [CODEX_CONFIG_ENV]: '{"model":"gpt-5.6-sol","sandbox_mode":"read-only"}' },+ 500_000,+ );+ expect(JSON.parse(env[CODEX_CONFIG_ENV] as string)).toEqual({+ model: 'gpt-5.6-sol',+ sandbox_mode: 'read-only',+ model_context_window: 500_000,+ });+ });++ test('no choice leaves the environment untouched', () => {+ const env = { [CODEX_CONFIG_ENV]: '{"model":"gpt-5.6-sol"}' };+ expect(withCodexContextWindow(env, null)).toBe(env);+ expect(withCodexContextWindow(env, 0)).toBe(env);+ });++ test('a corrupt existing config is replaced rather than propagated', () => {+ const env = withCodexContextWindow({ [CODEX_CONFIG_ENV]: 'not json' }, 400_000);+ expect(JSON.parse(env[CODEX_CONFIG_ENV] as string)).toEqual({ model_context_window: 400_000 });+ });++ test('parsing tolerates every shape that is not an object', () => {+ for (const raw of [undefined, '', ' ', 'null', '[]', '"str"', '7']) {+ expect(parseCodexConfigEnv(raw)).toEqual({});+ }+ });+});diff --git a/packages/server/src/acp/model-discovery/codex-context.ts b/packages/server/src/acp/model-discovery/codex-context.tsnew file mode 100644index 000000000..ae651555d--- /dev/null+++ b/packages/server/src/acp/model-discovery/codex-context.ts@@ -0,0 +1,62 @@+export interface CodexCatalogModel {+ readonly slug: string;+ readonly visibility?: string | null;+ readonly contextWindow: number | null;+ readonly maxContextWindow: number | null;+ readonly effectivePercent: number | null;+}++export const CODEX_CONFIG_ENV = 'CODEX_CONFIG';++const DEFAULT_EFFECTIVE_PERCENT = 95;++export function effectiveContextTokens(+ requestedTokens: number,+ model: Pick<CodexCatalogModel, 'maxContextWindow' | 'effectivePercent'>,+): number {+ if (!Number.isFinite(requestedTokens) || requestedTokens <= 0) return 0;+ const ceiling = model.maxContextWindow ?? requestedTokens;+ const granted = Math.min(Math.floor(requestedTokens), ceiling);+ const percent = model.effectivePercent ?? DEFAULT_EFFECTIVE_PERCENT;+ return Math.floor((granted * percent) / 100);+}++export function contextChoicesFor(model: CodexCatalogModel): readonly number[] {+ const ceiling = model.maxContextWindow;+ const base = model.contextWindow;+ if (ceiling === null && base === null) return [];+ if (ceiling === null) return [base as number];+ if (base === null || base >= ceiling) return [ceiling];+ return [base, ceiling];+}++function asRecord(value: unknown): Record<string, unknown> {+ return typeof value === 'object' && value !== null && !Array.isArray(value)+ ? (value as Record<string, unknown>)+ : {};+}++export function parseCodexConfigEnv(raw: string | undefined): Record<string, unknown> {+ if (raw === undefined || raw.trim() === '') return {};+ try {+ return asRecord(JSON.parse(raw));+ } catch {+ return {};+ }+}++export function withCodexContextWindow(+ env: Record<string, string>,+ requestedTokens: number | null,+): Record<string, string> {+ if (requestedTokens === null || !Number.isFinite(requestedTokens) || requestedTokens <= 0) {+ return env;+ }+ const config = parseCodexConfigEnv(env[CODEX_CONFIG_ENV]);+ const next = { ...config, model_context_window: Math.floor(requestedTokens) };+ return { ...env, [CODEX_CONFIG_ENV]: JSON.stringify(next) };+}++export function isSelectableCatalogModel(model: CodexCatalogModel): boolean {+ return (model.visibility ?? 'list') === 'list';+}diff --git a/packages/server/src/acp/model-discovery/codex-probe.test.ts b/packages/server/src/acp/model-discovery/codex-probe.test.tsnew file mode 100644index 000000000..cffca54d1--- /dev/null+++ b/packages/server/src/acp/model-discovery/codex-probe.test.ts@@ -0,0 +1,95 @@+import { describe, expect, test } from 'vitest';+import { codexProbeCommand, parseCodexCatalog, probeCodexCatalog } from './codex-probe.ts';++const real = JSON.stringify({+ models: [+ {+ slug: 'gpt-5.6-sol',+ visibility: 'list',+ context_window: 272_000,+ max_context_window: 872_000,+ effective_context_window_percent: 95,+ },+ {+ slug: 'gpt-reserve',+ visibility: 'hide',+ context_window: 272_000,+ max_context_window: 872_000,+ effective_context_window_percent: 95,+ },+ ],+});++describe('reading the Codex catalog', () => {+ test('the shape the installed CLI emits is understood', () => {+ expect(parseCodexCatalog(real)).toEqual([+ {+ slug: 'gpt-5.6-sol',+ visibility: 'list',+ contextWindow: 272_000,+ maxContextWindow: 872_000,+ effectivePercent: 95,+ },+ {+ slug: 'gpt-reserve',+ visibility: 'hide',+ contextWindow: 272_000,+ maxContextWindow: 872_000,+ effectivePercent: 95,+ },+ ]);+ });++ test('a bare array is accepted as well as a models wrapper', () => {+ expect(parseCodexCatalog('[{"slug":"x"}]')).toEqual([+ {+ slug: 'x',+ visibility: null,+ contextWindow: null,+ maxContextWindow: null,+ effectivePercent: null,+ },+ ]);+ });++ test('a row with no slug is dropped rather than rendered nameless', () => {+ expect(parseCodexCatalog('{"models":[{"context_window":1},{"slug":""}]}')).toEqual([]);+ });++ test('missing numbers stay null instead of becoming zero', () => {+ const [row] = parseCodexCatalog('{"models":[{"slug":"x","context_window":"lots"}]}');+ expect(row?.contextWindow).toBeNull();+ });++ test('output that is not JSON yields no models rather than throwing', () => {+ for (const raw of ['', 'not json', 'null', '{}', '{"models":"nope"}']) {+ expect(parseCodexCatalog(raw)).toEqual([]);+ }+ });+});++describe('resolving the binary the launch path would use', () => {+ test('a missing binary reads as not-found, not as a failure', async () => {+ const probe = await probeCodexCatalog('definitely-not-a-real-binary-xyz', { PATH: '' });+ expect(probe.outcome).toBe('not-found');+ });++ test('a non-zero exit is a failure, so the login-shell retry does not fire for it', async () => {+ const probe = await probeCodexCatalog(process.execPath, process.env);+ expect(probe.outcome).toBe('failed');+ });++ test('a windows .cmd shim runs through the shell wrap, not execed directly', () => {+ const composed = codexProbeCommand('codex.cmd', { PATH: '' }, 'win32');+ expect(composed.wrap).toBe(true);+ expect(composed.cmd.toLowerCase()).toContain('cmd');+ expect(composed.args.join(' ')).toContain('debug');+ });++ test('elsewhere the binary is invoked directly with the catalog subcommand', () => {+ const composed = codexProbeCommand('codex', { PATH: '/usr/bin' }, 'darwin');+ expect(composed.wrap).toBe(false);+ expect(composed.cmd).toBe('codex');+ expect(composed.args).toEqual(['debug', 'models']);+ });+});diff --git a/packages/server/src/acp/model-discovery/codex-probe.ts b/packages/server/src/acp/model-discovery/codex-probe.tsnew file mode 100644index 000000000..8af79e96c--- /dev/null+++ b/packages/server/src/acp/model-discovery/codex-probe.ts@@ -0,0 +1,124 @@+import { spawn } from 'node:child_process';+import { envPath, resolveWindowsCommand, terminateAgentTree, windowsCmdWrap } from '../launch.ts';+import type { CodexCatalogModel } from './codex-context.ts';++const PROBE_TIMEOUT_MS = 8_000;+const PROBE_MAX_BUFFER = 4 * 1024 * 1024;++function asRecord(value: unknown): Record<string, unknown> {+ return typeof value === 'object' && value !== null && !Array.isArray(value)+ ? (value as Record<string, unknown>)+ : {};+}++function numberOrNull(value: unknown): number | null {+ return typeof value === 'number' && Number.isFinite(value) ? value : null;+}++export function parseCodexCatalog(raw: string): readonly CodexCatalogModel[] {+ let parsed: unknown;+ try {+ parsed = JSON.parse(raw);+ } catch {+ return [];+ }+ const container = asRecord(parsed);+ const rows = Array.isArray(parsed) ? parsed : container.models;+ if (!Array.isArray(rows)) return [];+ return rows.flatMap((row) => {+ const record = asRecord(row);+ const slug = record.slug;+ if (typeof slug !== 'string' || slug === '') return [];+ return [+ {+ slug,+ visibility: typeof record.visibility === 'string' ? record.visibility : null,+ contextWindow: numberOrNull(record.context_window),+ maxContextWindow: numberOrNull(record.max_context_window),+ effectivePercent: numberOrNull(record.effective_context_window_percent),+ },+ ];+ });+}++export type CodexCatalogProbe =+ | { readonly outcome: 'ok'; readonly models: readonly CodexCatalogModel[] }+ | { readonly outcome: 'not-found' }+ | { readonly outcome: 'failed' };++export function codexProbeCommand(+ codexPath: string,+ env: NodeJS.ProcessEnv,+ platform: NodeJS.Platform,+): { cmd: string; args: string[]; wrap: boolean; env: Record<string, string> } {+ const stringEnv: Record<string, string> = {};+ for (const [k, v] of Object.entries(env)) if (typeof v === 'string') stringEnv[k] = v;+ const win = platform === 'win32';+ const resolved = win ? resolveWindowsCommand(codexPath, envPath(stringEnv)) : codexPath;+ const wrap = win && /\.(cmd|bat)$/i.test(resolved);+ const composed = wrap+ ? windowsCmdWrap(resolved, ['debug', 'models'])+ : { cmd: resolved, args: ['debug', 'models'] };+ return { ...composed, wrap, env: stringEnv };+}++export async function probeCodexCatalog(+ codexPath: string,+ env: NodeJS.ProcessEnv = process.env,+ platform: NodeJS.Platform = process.platform,+): Promise<CodexCatalogProbe> {+ const { cmd, args, wrap, env: stringEnv } = codexProbeCommand(codexPath, env, platform);+ return new Promise<CodexCatalogProbe>((settle) => {+ let child: ReturnType<typeof spawn>;+ try {+ child = spawn(cmd, args, {+ env: stringEnv,+ stdio: ['ignore', 'pipe', 'ignore'],+ shell: false,+ detached: platform !== 'win32',+ windowsHide: true,+ windowsVerbatimArguments: wrap,+ });+ } catch (err) {+ settle(+ (err as NodeJS.ErrnoException).code === 'ENOENT'+ ? { outcome: 'not-found' }+ : { outcome: 'failed' },+ );+ return;+ }+ const reap = (): void => {+ void terminateAgentTree(child, { graceMs: 1_000 });+ };+ let out = '';+ let bytes = 0;+ let done = false;+ const finish = (result: CodexCatalogProbe): void => {+ if (done) return;+ done = true;+ clearTimeout(timer);+ settle(result);+ };+ const timer = setTimeout(() => {+ reap();+ finish({ outcome: 'failed' });+ }, PROBE_TIMEOUT_MS);+ child.stdout?.on('data', (chunk: Buffer) => {+ bytes += chunk.length;+ if (bytes > PROBE_MAX_BUFFER) {+ reap();+ finish({ outcome: 'failed' });+ return;+ }+ out += chunk.toString('utf8');+ });+ child.on('error', (err: NodeJS.ErrnoException) => {+ finish(err.code === 'ENOENT' ? { outcome: 'not-found' } : { outcome: 'failed' });+ });+ child.on('close', (code) => {+ finish(+ code === 0 ? { outcome: 'ok', models: parseCodexCatalog(out) } : { outcome: 'failed' },+ );+ });+ });+}diff --git a/packages/server/src/acp/model-discovery/context-window-change.test.ts b/packages/server/src/acp/model-discovery/context-window-change.test.tsnew file mode 100644index 000000000..9a802eca9--- /dev/null+++ b/packages/server/src/acp/model-discovery/context-window-change.test.ts@@ -0,0 +1,38 @@+import { describe, expect, test } from 'vitest';+import { contextWindowChangeFor } from './context-window-change.ts';++const base = { agentId: 'codex-acp', archived: false, turnActive: false, hasStartedWork: false };++describe('when a context-window change can take effect', () => {+ test('a fresh Codex thread applies it by restarting', () => {+ expect(contextWindowChangeFor(base)).toEqual({ kind: 'apply' });+ });++ test('a thread that already carries a message needs a new chat', () => {+ expect(contextWindowChangeFor({ ...base, hasStartedWork: true })).toEqual({+ kind: 'needs-new-chat',+ });+ });++ test('a thread mid-turn needs a new chat, even with no message recorded yet', () => {+ expect(contextWindowChangeFor({ ...base, turnActive: true })).toEqual({+ kind: 'needs-new-chat',+ });+ });++ test('an archived thread needs a new chat rather than a silent restart', () => {+ expect(contextWindowChangeFor({ ...base, archived: true })).toEqual({ kind: 'needs-new-chat' });+ });++ test('Claude is unsupported, because its window rides in the model id', () => {+ expect(contextWindowChangeFor({ ...base, agentId: 'claude-acp' })).toEqual({+ kind: 'unsupported',+ });+ });++ test('an agent we know nothing about is unsupported rather than restarted', () => {+ expect(contextWindowChangeFor({ ...base, agentId: 'opencode' })).toEqual({+ kind: 'unsupported',+ });+ });+});diff --git a/packages/server/src/acp/model-discovery/context-window-change.ts b/packages/server/src/acp/model-discovery/context-window-change.tsnew file mode 100644index 000000000..095725910--- /dev/null+++ b/packages/server/src/acp/model-discovery/context-window-change.ts@@ -0,0 +1,18 @@+import { launchContextMechanism } from './launch-context.ts';++export type ContextWindowChange =+ | { readonly kind: 'apply' }+ | { readonly kind: 'needs-new-chat' }+ | { readonly kind: 'unsupported' };++export function contextWindowChangeFor(input: {+ readonly agentId: string;+ readonly archived: boolean;+ readonly turnActive: boolean;+ readonly hasStartedWork: boolean;+}): ContextWindowChange {+ if (launchContextMechanism(input.agentId) !== 'codex-config-env') return { kind: 'unsupported' };+ if (input.archived) return { kind: 'needs-new-chat' };+ if (input.turnActive || input.hasStartedWork) return { kind: 'needs-new-chat' };+ return { kind: 'apply' };+}diff --git a/packages/server/src/acp/model-discovery/launch-context.test.ts b/packages/server/src/acp/model-discovery/launch-context.test.tsnew file mode 100644index 000000000..7a447c0d8--- /dev/null+++ b/packages/server/src/acp/model-discovery/launch-context.test.ts@@ -0,0 +1,47 @@+import { describe, expect, test } from 'vitest';+import type { ResolvedLaunch } from '../launch.ts';+import { CODEX_CONFIG_ENV } from './codex-context.ts';+import { applyLaunchContextWindow, launchContextMechanism } from './launch-context.ts';++const launch = (env: Record<string, string> = {}): ResolvedLaunch =>+ ({ kind: 'npx', args: [], env }) as unknown as ResolvedLaunch;++describe('which harness takes a window at launch', () => {+ test('Codex carries it in its startup config', () => {+ expect(launchContextMechanism('codex-acp')).toBe('codex-config-env');+ });++ test('Claude does not, because its window rides in the model id', () => {+ expect(launchContextMechanism('claude-acp')).toBe('model-variant');+ });++ test('an agent we know nothing about takes none', () => {+ expect(launchContextMechanism('opencode')).toBe('none');+ });+});++describe('applying a chosen window to a launch', () => {+ test('Codex gets the window in CODEX_CONFIG', () => {+ const out = applyLaunchContextWindow(launch({ PATH: '/bin' }), 'codex-acp', 500_000);+ expect(JSON.parse(out.env[CODEX_CONFIG_ENV] as string)).toEqual({+ model_context_window: 500_000,+ });+ });++ test('Claude is returned untouched, since the choice travels as a model id', () => {+ const original = launch({ PATH: '/bin' });+ expect(applyLaunchContextWindow(original, 'claude-acp', 1_000_000)).toBe(original);+ });++ test('an agent with no mechanism is returned untouched', () => {+ const original = launch({ PATH: '/bin' });+ expect(applyLaunchContextWindow(original, 'opencode', 500_000)).toBe(original);+ });++ test('no choice is a no-op for every harness', () => {+ for (const id of ['codex-acp', 'claude-acp', 'opencode']) {+ const original = launch({ PATH: '/bin' });+ expect(applyLaunchContextWindow(original, id, null)).toBe(original);+ }+ });+});diff --git a/packages/server/src/acp/model-discovery/launch-context.ts b/packages/server/src/acp/model-discovery/launch-context.tsnew file mode 100644index 000000000..a4302b515--- /dev/null+++ b/packages/server/src/acp/model-discovery/launch-context.ts@@ -0,0 +1,24 @@+import type { ResolvedLaunch } from '../launch.ts';+import { withCodexContextWindow } from './codex-context.ts';++export type LaunchContextMechanism = 'codex-config-env' | 'model-variant' | 'none';++const LAUNCH_CONTEXT_MECHANISMS: Readonly<Record<string, LaunchContextMechanism>> = {+ 'codex-acp': 'codex-config-env',+ 'claude-acp': 'model-variant',+};++export function launchContextMechanism(agentId: string): LaunchContextMechanism {+ return LAUNCH_CONTEXT_MECHANISMS[agentId] ?? 'none';+}++export function applyLaunchContextWindow(+ launch: ResolvedLaunch,+ agentId: string,+ requestedTokens: number | null,+): ResolvedLaunch {+ if (requestedTokens === null) return launch;+ if (launchContextMechanism(agentId) !== 'codex-config-env') return launch;+ const env = withCodexContextWindow(launch.env, requestedTokens);+ return env === launch.env ? launch : { ...launch, env };+}diff --git a/packages/server/src/acp/model-discovery/types.ts b/packages/server/src/acp/model-discovery/types.tsnew file mode 100644index 000000000..ead45c491--- /dev/null+++ b/packages/server/src/acp/model-discovery/types.ts@@ -0,0 +1,50 @@+type CandidateSource = 'acp-session' | 'native-cli' | 'remembered' | 'agent-default';++type CandidateFreshness =+ | { readonly kind: 'live' }+ | { readonly kind: 'cached'; readonly at: number }+ | { readonly kind: 'stale'; readonly at: number }+ | { readonly kind: 'unknown' };++type CandidateSelectability = 'advertised' | 'candidate' | 'rejected' | 'unavailable';++type ContextOrigin = 'native-catalog' | 'session-usage' | 'model-variant' | 'unknown';++interface ContextWindow {+ readonly effectiveTokens: number;+ readonly origin: ContextOrigin;+}++type SetPhase = 'acp-post-create' | 'launch-only';++export interface ScopeFingerprint {+ readonly harness: string;+ readonly cliVersion: string | null;+ readonly adapterVersion: string | null;+ readonly endpoint: string | null;+ readonly account: string | null;+}++export interface ModelCandidate {+ readonly value: string;+ readonly label: string;+ readonly description: string | null;+ readonly group: string | null;+ readonly source: CandidateSource;+ readonly fingerprint: ScopeFingerprint;+ readonly freshness: CandidateFreshness;+ readonly selectability: CandidateSelectability;+ readonly context: ContextWindow | null;+ readonly contextChoices: readonly number[];+ readonly setPhase: SetPhase;+}++export function sameScope(a: ScopeFingerprint, b: ScopeFingerprint): boolean {+ return (+ a.harness === b.harness &&+ a.cliVersion === b.cliVersion &&+ a.adapterVersion === b.adapterVersion &&+ a.endpoint === b.endpoint &&+ a.account === b.account+ );+}diff --git a/packages/server/src/acp/thread-manager.integration.test.ts b/packages/server/src/acp/thread-manager.integration.test.tsindex 0d0a6ebb3..2c1afadf9 100644--- a/packages/server/src/acp/thread-manager.integration.test.ts+++ b/packages/server/src/acp/thread-manager.integration.test.ts@@ -4330,6 +4330,92 @@ describe('AcpThreadManager agent presence', () => {expect(published).toEqual([]);}, 45_000);+ test('a context window the agent will not start under is refused and leaves the old one in place', async () => {+ const contentDir = tmp();+ const localDir = tmp();+ const agentPath = join(localDir, 'codex-acp.mjs');+ writeFileSync(+ agentPath,+ `+const cfg = process.env.CODEX_CONFIG ?? '';+if (cfg.includes('model_context_window') && !cfg.includes('272000')) process.exit(3);+const write = (msg) => process.stdout.write(JSON.stringify(msg) + '\\n');+let buffer = '';+process.stdin.setEncoding('utf8');+process.stdin.on('data', (chunk) => {+ buffer += chunk;+ let idx = buffer.indexOf('\\n');+ while (idx !== -1) {+ const line = buffer.slice(0, idx);+ buffer = buffer.slice(idx + 1);+ idx = buffer.indexOf('\\n');+ if (line.trim() === '') continue;+ const msg = JSON.parse(line);+ if (msg.method === 'initialize') {+ write({ jsonrpc: '2.0', id: msg.id, result: { protocolVersion: 1, agentCapabilities: {} } });+ } else if (msg.method === 'session/new') {+ write({ jsonrpc: '2.0', id: msg.id, result: { sessionId: 'sess-1' } });+ } else if (msg.id !== undefined) {+ write({ jsonrpc: '2.0', id: msg.id, result: {} });+ }+ }+});+`,+ );+ writeFileSync(+ join(localDir, 'acp-agents.json'),+ JSON.stringify([+ { id: 'codex-acp', name: 'Fake codex-acp', command: 'node', args: [agentPath] },+ ]),+ );+ const manager = makeManager(contentDir, localDir, {+ sessionManager: stubSessionManager(new Map()),+ });++ const info = await manager.createThread({+ agent: { source: 'custom', id: 'codex-acp' },+ settings: { contextWindow: 272_000 },+ });+ await waitUntil(() => manager.getInfo(info.threadId)?.status === 'ready', 15_000, 'ready');+ expect(manager.getInfo(info.threadId)?.contextWindow).toBe(272_000);++ await expect(manager.setContextWindow(info.threadId, 872_000)).rejects.toMatchObject({+ code: 'spawn-failed',+ });+ await expect(manager.retryThread(info.threadId)).resolves.toMatchObject({+ contextWindow: 272_000,+ });++ await manager.closeThread(info.threadId);+ }, 45_000);++ test('a picked window survives a restart, so a resumed conversation keeps it', async () => {+ const contentDir = tmp();+ const localDir = tmp();+ writeResumableAgentEntry(localDir, 'codex-acp', { FAKE_CAPS: 'resume,load' });+ const manager = makeManager(contentDir, localDir);+ await manager.init();+ const info = await manager.createThread({+ agent: { source: 'custom', id: 'codex-acp' },+ settings: { contextWindow: 872_000 },+ });+ await waitUntil(() => manager.getInfo(info.threadId)?.status === 'ready', 15_000, 'ready');+ expect(manager.getInfo(info.threadId)?.contextWindow).toBe(872_000);+ manager.sendPrompt(info.threadId, 'hello there');+ await waitUntil(() => manager.getInfo(info.threadId)?.status === 'ready', 15_000, 'turn ended');+ await manager.closeThread(info.threadId);++ const manager2 = makeManager(contentDir, localDir);+ await manager2.init();+ expect(manager2.getInfo(info.threadId)?.contextWindow ?? null).toBeNull();++ await manager2.resumeThread(info.threadId);+ await waitUntil(() => manager2.getInfo(info.threadId)?.status === 'ready', 15_000, 'resumed');+ expect(manager2.getInfo(info.threadId)?.contextWindow).toBe(872_000);++ await manager2.closeThread(info.threadId);+ }, 45_000);+test('an ACP fs write publishes presence for that doc, under the agent brand icon', async () => {const contentDir = tmp();const localDir = tmp();diff --git a/packages/server/src/acp/thread-manager.ts b/packages/server/src/acp/thread-manager.tsindex 0abfc3503..897dcbd2c 100644--- a/packages/server/src/acp/thread-manager.ts+++ b/packages/server/src/acp/thread-manager.ts@@ -119,6 +119,11 @@ import {runtimeDownloadSupported,runtimeForInterpreter,} from './managed-runtime.ts';+import { contextWindowChangeFor } from './model-discovery/context-window-change.ts';+import {+ applyLaunchContextWindow,+ launchContextMechanism,+} from './model-discovery/launch-context.ts';import type { AcpPermissionStore } from './permissions.ts';import {ACP_AGENT_EDITOR_IDS,@@ -209,7 +214,12 @@ interface ThreadRecord {info: ThreadInfo;docName?: string;agentRef: { source: 'registry' | 'custom'; id: string };- launchSettings?: { config?: Record<string, string | boolean>; modeId?: string };+ confirmedContextWindow?: number | null;+ launchSettings?: {+ config?: Record<string, string | boolean>;+ modeId?: string;+ contextWindow?: number;+ };cwd: string;child: ChildProcess | null;conn: ClientConnection | null;@@ -495,7 +505,11 @@ export class AcpThreadManager {attachments?: readonly AttachmentPart[];docName?: string;titleHint?: string;- settings?: { config?: Record<string, string | boolean>; modeId?: string };+ settings?: {+ config?: Record<string, string | boolean>;+ modeId?: string;+ contextWindow?: number;+ };}): Promise<ThreadInfo> {if (this.destroyed) throw new ThreadOpError('capacity', 'server is shutting down');if (this.liveThreadCount() >= this.maxThreads) {@@ -654,6 +668,12 @@ export class AcpThreadManager {loginShellPath,});+ launch = applyLaunchContextWindow(+ launch,+ record.agentRef.id,+ record.launchSettings?.contextWindow ?? null,+ );+this.emitStatus(record, 'spawning');const child = launch.kind === 'npx' ? spawnAcpAgent(launch) : spawnAcpAgent(launch, record.cwd);record.child = child;@@ -1486,7 +1506,11 @@ export class AcpThreadManager {agent: { source: 'registry' | 'custom'; id: string };prompt?: string;attachments?: readonly AttachmentPart[];- settings?: { config?: Record<string, string | boolean>; modeId?: string };+ settings?: {+ config?: Record<string, string | boolean>;+ modeId?: string;+ contextWindow?: number;+ };},custom: CustomAgentEntry | null,consentBudgetMs: number = CONSENT_TIMEOUT_MS,@@ -1544,6 +1568,8 @@ export class AcpThreadManager {});record.sessionId = session.sessionId;record.info.resumable = resumableFromCapabilities(init);+ record.confirmedContextWindow = appliedContextWindow(record);+ record.info.contextWindow = record.confirmedContextWindow;record.envNotePending = true;this.persistence.queueMetaWrite(record.info.threadId, this.buildMeta(record));if (session.modes !== undefined && session.modes !== null) {@@ -1654,6 +1680,8 @@ export class AcpThreadManager {}const { conn, init } = handshake;t.info.resumable = resumableFromCapabilities(init);+ t.confirmedContextWindow = appliedContextWindow(t);+ t.info.contextWindow = t.confirmedContextWindow;const { servers: mcpServers } = await this.buildMcpServers(t,init,@@ -1742,6 +1770,79 @@ export class AcpThreadManager {}}+ hasStartedWork(threadId: string): boolean {+ const t = this.threads.get(threadId);+ if (t === undefined) return false;+ return t.events.some((event) => event.kind === 'user_message');+ }++ async setContextWindow(threadId: string, tokens: number): Promise<ThreadInfo> {+ if (this.destroyed) throw new ThreadOpError('capacity', 'server is shutting down');+ const t = this.mustGet(threadId);+ if (!Number.isFinite(tokens) || tokens <= 0) {+ throw new ThreadOpError('not-ready', 'a context window must be a positive number of tokens');+ }+ const change = contextWindowChangeFor({+ agentId: t.agentRef.id,+ archived: t.info.archived === true,+ turnActive: t.turnActive,+ hasStartedWork: this.hasStartedWork(threadId),+ });+ if (change.kind === 'unsupported') {+ throw new ThreadOpError('not-ready', 'this agent takes its context window from the model');+ }+ if (change.kind === 'needs-new-chat') {+ throw new ThreadOpError('not-ready', 'start a new chat to change the context window');+ }+ if (t.resumeInFlight) throw new ThreadOpError('not-ready', 'a restart is already in progress');++ const previousWindow = t.launchSettings?.contextWindow;+ const previousConfirmed = t.confirmedContextWindow ?? null;+ t.launchSettings = { ...t.launchSettings, contextWindow: Math.floor(tokens) };+ t.resumeInFlight = true;+ let applied = false;+ try {+ const { custom } = await this.resolveAgentInfo(t.agentRef);+ await this.teardownFailedAgent(t);+ t.stderrTail = [];+ t.cancelRequested = false;+ t.turnActive = false;+ this.emitStatus(t, 'spawning');+ await this.startThread(+ t,+ { agent: t.agentRef, settings: t.launchSettings },+ custom,+ BLOCKING_CONSENT_TIMEOUT_MS,+ );+ if (t.closed) {+ throw new ThreadOpError('spawn-failed', 'thread closed during the context window change');+ }+ const settled = this.getInfo(threadId)?.status;+ if (settled === 'ready' || settled === 'running') {+ applied = true;+ return { ...t.info };+ }+ throw new ThreadOpError(+ 'spawn-failed',+ lastFailureMessage(t) ?? 'the agent failed to start with that context window',+ );+ } catch (err) {+ if (err instanceof ThreadOpError) throw err;+ const detail = err instanceof Error ? err.message : String(err);+ this.emitStatus(t, 'error', detail, { reason: 'connect', agentMessage: detail });+ throw new ThreadOpError('spawn-failed', detail);+ } finally {+ if (!applied && this.threads.has(threadId)) {+ t.launchSettings = { ...t.launchSettings, contextWindow: previousWindow };+ t.confirmedContextWindow = previousConfirmed;+ t.info.contextWindow =+ this.getInfo(threadId)?.status === 'ready' ? previousConfirmed : null;+ this.emitInfo(t);+ }+ t.resumeInFlight = false;+ }+ }+async retryThread(threadId: string): Promise<ThreadInfo> {if (this.destroyed) throw new ThreadOpError('capacity', 'server is shutting down');const t = this.mustGet(threadId);@@ -2868,6 +2969,7 @@ export class AcpThreadManager {t.lastInit = null;t.terminals = null;t.sessionId = null;+ t.info.contextWindow = null;try {conn?.close();} catch {}@@ -2912,6 +3014,7 @@ export class AcpThreadManager {cwd: t.cwd,agentRef: t.agentRef,docName: t.docName,+ contextWindow: t.confirmedContextWindow ?? null,};}@@ -3042,8 +3145,11 @@ export async function confineToContentDir(function rehydratedRecord(meta: PersistedThreadMeta): ThreadRecord {const status = meta.info.status === 'error' ? 'error' : 'exited';return {+ confirmedContextWindow: meta.contextWindow ?? null,+ launchSettings: meta.contextWindow == null ? undefined : { contextWindow: meta.contextWindow },info: {...meta.info,+ contextWindow: null,status,archived: true,resumable: meta.info.resumable === false ? false : meta.sessionId !== null,@@ -3140,6 +3246,11 @@ function agentErrorData(err: unknown): string | undefined {}}+function appliedContextWindow(record: ThreadRecord): number | null {+ if (launchContextMechanism(record.agentRef.id) !== 'codex-config-env') return null;+ return record.launchSettings?.contextWindow ?? null;+}+function lastFailureMessage(t: ThreadRecord): string | undefined {for (let i = t.events.length - 1; i >= 0; i -= 1) {const event = t.events[i];diff --git a/packages/server/src/acp/thread-persistence.ts b/packages/server/src/acp/thread-persistence.tsindex 13bcaafe9..280d3f649 100644--- a/packages/server/src/acp/thread-persistence.ts+++ b/packages/server/src/acp/thread-persistence.ts@@ -23,6 +23,7 @@ export interface PersistedThreadMeta {cwd: string;agentRef: { source: 'registry' | 'custom'; id: string };docName?: string;+ contextWindow?: number | null;}export interface ResolvedEventLog {@@ -193,6 +194,16 @@ export class ThreadPersistenceStore {);parsed.sessionId = null;}+ const window = parsed.contextWindow;+ if (window !== undefined && window !== null) {+ if (typeof window !== 'number' || !Number.isFinite(window) || window <= 0) {+ this.log.warn(+ { path, invalidContextWindow: window },+ '[acp-persist] thread meta has an unusable context window; relaunching on the agent default',+ );+ parsed.contextWindow = null;+ }+ }const meta = parsed as PersistedThreadMeta;const threadId = meta.info.threadId;if (seen.has(threadId)) continue;diff --git a/packages/server/src/acp/thread-socket.test.ts b/packages/server/src/acp/thread-socket.test.tsindex 636511328..d6c02a0b6 100644--- a/packages/server/src/acp/thread-socket.test.ts+++ b/packages/server/src/acp/thread-socket.test.ts@@ -297,6 +297,56 @@ describe('/collab/thread socket — history ops', () => {socket.close();}, 45_000);+ test('a refused set_context_window comes back as an error frame, not an unhandled rejection', async () => {+ const localDir = tmp();+ writeFixtureAgent(localDir, '');+ const manager = makeManager(tmp(), localDir);+ await manager.init();+ const socket = attachFakeSocket(manager);++ socket.emit(+ JSON.stringify({ op: 'create', reqId: 'c1', agent: { source: 'custom', id: 'fixture' } }),+ );+ const created = await socket.awaitFrame('created');+ const threadId = created.info.threadId;+ await waitStatus(manager, threadId, 'ready');++ const rejections: unknown[] = [];+ const onRejection = (err: unknown) => rejections.push(err);+ process.on('unhandledRejection', onRejection);+ try {+ socket.emit(+ JSON.stringify({ op: 'set_context_window', threadId, reqId: 'cw1', tokens: 872_000 }),+ );+ const err = await socket.awaitFrame('error');+ expect(err.code).toBe('not-ready');+ expect(err.reqId).toBe('cw1');+ await new Promise((resolve) => setImmediate(resolve));+ expect(rejections).toEqual([]);+ } finally {+ process.off('unhandledRejection', onRejection);+ }+ socket.close();+ }, 45_000);++ test('a thread whose agent takes no launch window reports no context window', async () => {+ const localDir = tmp();+ writeFixtureAgent(localDir, '');+ const manager = makeManager(tmp(), localDir);+ await manager.init();+ const socket = attachFakeSocket(manager);++ socket.emit(+ JSON.stringify({ op: 'create', reqId: 'c1', agent: { source: 'custom', id: 'fixture' } }),+ );+ const created = await socket.awaitFrame('created');+ const threadId = created.info.threadId;+ await waitStatus(manager, threadId, 'ready');++ expect(manager.getInfo(threadId)?.contextWindow ?? null).toBeNull();+ socket.close();+ }, 45_000);+test('authenticate on a healthy thread answers the reqId with not-ready', async () => {const localDir = tmp();writeFixtureAgent(localDir, '');diff --git a/packages/server/src/acp/thread-socket.ts b/packages/server/src/acp/thread-socket.tsindex 4ec5c3c84..3c8b0b11c 100644--- a/packages/server/src/acp/thread-socket.ts+++ b/packages/server/src/acp/thread-socket.ts@@ -163,6 +163,11 @@ export function attachAcpThreadSocket(manager.setConfigOption(frame.threadId, frame.configId, frame.value);return;}+ case 'set_context_window': {+ const info = await manager.setContextWindow(frame.threadId, frame.tokens);+ send({ op: 'context_window_set', reqId: frame.reqId, info });+ return;+ }case 'close': {const sink = subscriptions.get(frame.threadId);if (sink !== undefined) {diff --git a/packages/server/src/http/config-system-routes.ts b/packages/server/src/http/config-system-routes.tsindex 4bc12b0c5..0bf2ec157 100644--- a/packages/server/src/http/config-system-routes.ts+++ b/packages/server/src/http/config-system-routes.ts@@ -24,6 +24,10 @@ import {ACP_AGENT_HARNESS_CLIS,type AcpHarnessAvailability,} from '../acp/harness-availability.ts';+import { mergedEnv, withLoginShellPathEnv } from '../acp/launch.ts';+import { getSharedLoginShellPathProvider } from '../acp/login-shell-path.ts';+import { codexCandidates } from '../acp/model-discovery/candidates.ts';+import { probeCodexCatalog } from '../acp/model-discovery/codex-probe.ts';import {type AcpRegistry,type CustomAgentEntry,@@ -189,6 +193,87 @@ export function createConfigSystemRoutes(deps: ConfigSystemRouteDeps): ConfigSysmaxThreads: z.number(),});+ const AcpModelsSuccessSchema = z.object({+ agentId: z.string(),+ reason: z.string().nullable(),+ candidates: z.array(+ z.object({+ value: z.string(),+ label: z.string(),+ description: z.string().nullable(),+ group: z.string().nullable(),+ contextChoices: z.array(z.number()),+ context: z.object({ effectiveTokens: z.number(), origin: z.string() }).nullable(),+ selectability: z.string(),+ setPhase: z.string(),+ }),+ ),+ });++ const handleAcpModels = withValidation(+ EmptyRequestSchema,+ async (req, res) => {+ const agentId = new URL(req.url ?? '', 'http://localhost').searchParams.get('agent') ?? '';+ const empty = (reason: string) =>+ successResponse(res, 200, AcpModelsSuccessSchema, { agentId, candidates: [], reason });+ if (agentId === '') {+ errorResponse(res, 400, 'urn:ok:error:invalid-request', 'An agent id is required.', {+ handler: 'acp-models',+ });+ return;+ }+ if (agentId !== 'codex-acp') {+ empty('unsupported');+ return;+ }+ const availability = await acpHarnessAvailability();+ if (availability.codex?.availability !== 'present') {+ empty('unavailable');+ return;+ }+ const spawnEnv = mergedEnv();+ let probe = await probeCodexCatalog('codex', spawnEnv);+ if (probe.outcome === 'not-found') {+ const loginShellPath = await getSharedLoginShellPathProvider(log)();+ if (loginShellPath !== null) {+ probe = await probeCodexCatalog('codex', withLoginShellPathEnv(spawnEnv, loginShellPath));+ }+ }+ if (probe.outcome !== 'ok') {+ log.warn({ agentId, outcome: probe.outcome }, '[acp-models] codex catalog probe failed');+ empty('unavailable');+ return;+ }+ const catalog = probe.models;+ if (catalog.length === 0) {+ empty('unavailable');+ return;+ }+ const fingerprint = {+ harness: 'codex',+ cliVersion: null,+ adapterVersion: null,+ endpoint: null,+ account: null,+ };+ successResponse(res, 200, AcpModelsSuccessSchema, {+ agentId,+ reason: null,+ candidates: codexCandidates(catalog, fingerprint, Date.now()).map((c) => ({+ value: c.value,+ label: c.label,+ description: c.description,+ group: c.group,+ contextChoices: [...c.contextChoices],+ context: c.context,+ selectability: c.selectability,+ setPhase: c.setPhase,+ })),+ });+ },+ { handler: 'acp-models' },+ );+const handleAcpCatalog = withValidation(EmptyRequestSchema,async (_req, res) => {@@ -651,6 +736,7 @@ export function createConfigSystemRoutes(deps: ConfigSystemRouteDeps): ConfigSys'/api/workspace': handleWorkspace,'/api/semantic-status': handleSemanticStatus,'/api/acp/catalog': handleAcpCatalog,+ '/api/acp/models': handleAcpModels,'/api/installed-agents': handleInstalledAgentsRoute,'/api/__embed-detect': handleEmbedDetect,'/api/rescue': handleRescueList,