You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(agents): drive inline agent sessions via run_agent_session, not the phantom create_agent_session
ClaudeSDKClient (claude_agent_sdk) has no `create_agent_session` method, so
every inline call site raised
`'ClaudeSDKClient' object has no attribute 'create_agent_session'` at runtime.
The shared generator boilerplate (agents/_generator_base) was fixed in #339;
this covers the remaining inline call sites it called out as a follow-up:
- documentation_generator.run_documentation_generator_session
- migration_assistant.run_migration_assistant
- test_generator.run_test_generator_session (writer + coverage-improvement)
- agent_subprocess.run_agent_session (isolated-subprocess wrapper)
Each now drives the session through run_agent_session() (agents/session.py)
inside `async with client` — the same API the planner/coder/qa phases use —
and treats a returned status == "error" as failure. The agent role prompt is
delivered as the leading message since the SDK client only carries the generic
base system prompt. agent_subprocess imports the helper under an alias so it
does not shadow its own run_agent_session() wrapper.
Add tests/test_inline_generator_sessions.py (mirrors
tests/test_fixture_generator_session.py: a fake async-context-manager client
with no create_agent_session attribute, agents.session.run_agent_session
patched as an AsyncMock, asserting it is awaited and the client is entered).
Update the existing migration/test-generation suites that mocked the phantom
method to drive the shared session helper instead.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Oleg Miagkov <mrobenner@gmail.com>
0 commit comments