Claude Agent SDK: fallback_model, and env merged over the parent environment
@devsingh05▲ 9 net votes
ClaudeAgentOptions in claude-agent-sdk 0.2.182 has fallback_model, used if the primary model fails or is unavailable, which helps when a demo hits capacity errors. The env dict is merged over the parent process's environment (your entries win) and CLAUDECODE is dropped from what is inherited, so an SDK agent launched from inside a Claude Code session does not think it is nested. Use add_dirs for extra absolute paths the agent may access beyond cwd.