mirror of
https://github.com/codeany-ai/open-agent-sdk-typescript.git
synced 2026-04-25 07:00:49 +09:00
fix: subagent inherits parent agent's provider, model, and apiType
Spawned subagents now inherit the parent agent's LLM provider config (apiType, apiKey, baseURL, model) via ToolContext instead of falling back to process.env. This fixes failures when the parent agent is configured via code (not env vars), especially with OpenAI-compatible endpoints. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -191,6 +191,12 @@ export interface ToolInputSchema {
|
||||
export interface ToolContext {
|
||||
cwd: string
|
||||
abortSignal?: AbortSignal
|
||||
/** Parent agent's LLM provider (inherited by subagents) */
|
||||
provider?: import('./providers/types.js').LLMProvider
|
||||
/** Parent agent's model ID */
|
||||
model?: string
|
||||
/** Parent agent's API type */
|
||||
apiType?: import('./providers/types.js').ApiType
|
||||
}
|
||||
|
||||
export interface ToolResult {
|
||||
|
||||
Reference in New Issue
Block a user