feat: goose2 context window usage in chat input (#8613)

Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
Taylor Ho
2026-04-19 18:53:44 -10:00
committed by GitHub
parent 765213561e
commit a7d78ee59e
22 changed files with 1035 additions and 73 deletions
+13 -1
View File
@@ -132,11 +132,23 @@ export async function cancelSession(sessionId: string): Promise<void> {
export async function newSession(
workingDir: string,
providerId?: string,
): Promise<NewSessionResponse> {
const tClient = performance.now();
const client = await getClient();
const request: Parameters<typeof client.newSession>[0] & {
meta?: Record<string, string>;
} = {
cwd: workingDir,
mcpServers: [],
};
if (providerId) {
request.meta = { provider: providerId };
}
const tCall = performance.now();
const response = await client.newSession({ cwd: workingDir, mcpServers: [] });
const response = await client.newSession(request);
const sid = response.sessionId.slice(0, 8);
perfLog(
`[perf:api] ${sid} newSession getClient=${(tCall - tClient).toFixed(1)}ms wire=${(performance.now() - tCall).toFixed(1)}ms`,