Merges selfManagedAgents into agents__unsafe_dev_only at the component level.
No core changes, no validation, no license key checks.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SDK clients store defaultHeaders and fetch in a private _options field.
Extract the access pattern into getSdkClientOptions() with runtime
validation and a narrow return type, eliminating as-any from all three
adapter getLanguageModel() implementations.
Address PR review feedback: replace dynamic await import() with static
top-level imports using vi.hoisted() for mock declarations, and remove
all `as any` type casts since the SDK constructor types already accept
the options we pass.
Each test mocks the AI SDK provider factory and asserts that all options
from the SDK client instance are forwarded. Compile-time exhaustiveness
guards ensure the tests break if the AI SDK provider types add new
options that need to be handled.
Pass defaultHeaders from SDK client instances through to the AI SDK
providers. This is critical for Azure OpenAI (api-key header) and any
custom proxy setups. Also forward organization and project for OpenAI.
Service adapters (OpenAIAdapter, AnthropicAdapter, GroqAdapter) accept
custom SDK instances with provider-specific configuration (e.g. Azure
OpenAI with custom baseURL/apiKey/headers), but CopilotRuntime discards
those instances and reconstructs a plain "provider/model" string for
BuiltInAgent. The agent's resolveModel() then creates a fresh provider
using only environment variables, losing all custom configuration.
Add getLanguageModel() to CopilotServiceAdapter so adapters can produce
a pre-configured Vercel AI SDK LanguageModel. CopilotRuntime now prefers
this over the string format when creating BuiltInAgent.
FixesCopilotKit/CopilotKit#2903
- Replace husky with lefthook for git hooks management
- Pre-commit runs lint --fix, format, test, and check:packages in parallel
with auto-staging of fixes via stage_fixed
- Commit-msg runs commitlint
- Add dependsOn ^build to test target in nx.json so dependencies are
built before tests run
- Upgrade @analogjs/vite-plugin-angular and @analogjs/vitest-angular
from ^1.20.2 to ^2.2.3 for vite 7 compatibility
- Add pnpm packageExtensions to declare missing vite peer dependency
on @analogjs/vite-plugin-angular
- Fix lint issues: let -> const in agent and react packages
- Disable nx TUI in pre-commit hooks via NX_TUI env var
Verify that the runtimeConnectionStatus === "connected" guard in
useCopilotChatInternal prevents duplicate connectAgent calls during
runtime initialization.
Relates to #3169
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Guard the connectAgent call in useCopilotChatInternal with a
runtimeConnectionStatus === "connected" check so provisional agent
instances created while the runtime is still connecting don't each
trigger their own request.
Fixes#3169
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>