co-mono/packages/web-ui/src
Ahmed Kamal 1167e84453
Fix expired OAuth tokens in long-running agent loops (#223)
Add getApiKey hook to AgentLoopConfig that resolves API keys dynamically
before each LLM call. This allows short-lived OAuth tokens (e.g. GitHub
Copilot, Anthropic OAuth) to be refreshed between turns when tool
execution takes a long time.

Previously, the API key was resolved once when ProviderTransport.run()
was called and passed as a static string to the agent loop. If the loop
ran for longer than the token lifetime (e.g. 30 minutes for Copilot),
subsequent LLM calls would fail with expired token errors.

Changes:
- Add getApiKey hook to AgentLoopConfig (packages/ai)
- Call getApiKey before each LLM call in streamAssistantResponse
- Update ProviderTransport to pass getApiKey instead of static apiKey
- Update web-ui ProviderTransport with same pattern
2025-12-19 01:36:25 +01:00
..
agent Fix expired OAuth tokens in long-running agent loops (#223) 2025-12-19 01:36:25 +01:00
components Add totalTokens field to Usage type 2025-12-06 22:46:02 +01:00
dialogs Fix Lit dependency duplication and update mini-lit to 0.2.0 2025-11-12 16:03:43 +01:00
prompts Updates to prompts 2025-10-17 22:44:03 +02:00
storage Add totalTokens field to Usage type 2025-12-06 22:46:02 +01:00
tools Fix Lit dependency duplication and update mini-lit to 0.2.0 2025-11-12 16:03:43 +01:00
utils Add totalTokens field to Usage type 2025-12-06 22:46:02 +01:00
app.css Custom provider WIP 2025-11-10 21:47:21 +01:00
ChatPanel.ts Fix Lit dependency duplication and update mini-lit to 0.2.0 2025-11-12 16:03:43 +01:00
index.ts Custom provider WIP 2025-11-10 21:47:21 +01:00