feat(copilot+canvas rendering): add context window tracking to copilot and selectively render canvas components (#1622)

* Copilot context window

* Fix pill

* Speed up canvas

* Fix react hook bug

* Context pill div
This commit is contained in:
Siddharth Ganesan
2025-10-13 19:56:02 -07:00
committed by GitHub
parent 3dd36a8a35
commit 6f3df271fd
12 changed files with 2071 additions and 1961 deletions

View File

@@ -463,6 +463,8 @@ export async function POST(req: NextRequest) {
logger.debug(`[${tracker.requestId}] Sent initial chatId event to client`)
}
// Note: context_usage events are forwarded from sim-agent (which has accurate token counts)
// Start title generation in parallel if needed
if (actualChatId && !currentChat?.title && conversationHistory.length === 0) {
generateChatTitle(message)
@@ -594,6 +596,7 @@ export async function POST(req: NextRequest) {
lastSafeDoneResponseId = responseIdFromDone
}
}
// Note: context_usage events are forwarded from sim-agent
break
case 'error':