feat: Add E2E tests for the coding-agent adapters (claude_sdk, codex) - #635
Open
AlexanderZ-Band wants to merge 2 commits into
Open
AlexanderZ-Band wants to merge 2 commits into
AlexanderZ-Band wants to merge 2 commits into
Conversation
Restores test_codex.py's regression-guard smoke (deleted in fc62742) and adds a new claude_sdk manual-approval smoke, both proving the coding-agent adapters' live-only behavior end-to-end. Fixes two real bugs the new claude_sdk smoke uncovered: - _pre_tool_use_continue_hook returned {"continue_": True}, which carries no permission decision, so native tool calls (Bash/Write/Edit) never actually reached can_use_tool under the adapter's default permission_mode -- manual approval silently never gated them. Fixed to return hookSpecificOutput.permissionDecision="ask", the SDK's real delegation mechanism. - Even with that fixed, approval_mode="manual" deadlocked: Band's runtime processes one room-message cycle at a time, but on_message blocked synchronously inside that cycle waiting on a chat reply only a later cycle could deliver. on_message now runs a turn as a detached task and only awaits its early release (mirroring OpencodeAdapter's release_turn_wait/turn_future split), so a manual approval can free the room to dispatch the reply that resolves it. Also fixes _build_claude_sdk's cwd hermeticity (no explicit cwd meant every matrix cell ran Claude Code against this repo's own checkout) and extracts the adapter's approval prompt/resolution strings into named constants so the new smoke anchors on them instead of duplicating the wording. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PycgygL3XZiSheL4CpquPM
AlexanderZ-Band
commented
Sep 14, 2026
AlexanderZ-Band
left a comment
Collaborator
Author
There was a problem hiding this comment.
Two lifecycle defects found: E2E workspaces leak, and an old detached turn can release a replacement turn after cleanup/rejoin.
AlexanderZ-Band
requested review from
amit-gazal-band,
bandzalkin and
nir-singher-band
and removed request for
amit-gazal-band,
bandzalkin and
nir-singher-band
September 15, 2026 11:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_codex.py: regression-guard smoke restored (deleted infc62742c).test_claude_sdk.py: new smoke proving Band's chat-based approval relay gates a real Claude Code native tool call end-to-end._build_claude_sdk: per-cell disposablecwd(matrix cells previously ran Claude Code against this repo's own checkout).claude_sdk.py: approval prompt/resolution strings extracted into named constants (APPROVAL_REQUESTED_TEMPLATE,APPROVAL_RESOLVED_TEMPLATE), mirroringopencode/approvals.py._pre_tool_use_continue_hook: returnshookSpecificOutput.permissionDecision="ask"instead of{"continue_": True}, which carried no permission decision — native tool calls (Bash/Write/Edit) were never reachingcan_use_toolunder the adapter's defaultpermission_mode.on_message: a turn now runs as a detached task and only awaits its early release (mirrorsOpencodeAdapter'srelease_turn_wait/turn_futuresplit). Band's runtime processes one room-message cycle at a time; a manual approval must release that cycle so the room can dispatch the reply that resolves it.Test plan
ruff check ./ruff format --check ./pyrefly checkuv run pytest tests/ --ignore=tests/integration/ --ignore=tests/e2e/ -v— 5592 passedE2E_TESTS_ENABLED=true BAND_E2E_LANE=core uv run pytest tests/e2e/baseline/smoke/adapters/test_claude_sdk.py -v -s --no-covE2E_TESTS_ENABLED=true BAND_E2E_LANE=backends uv run pytest tests/e2e/baseline/smoke/adapters/test_codex.py -v -s --no-covtests/e2e/baseline/guards/test_adapter_registry.py— 8 passedCloses INT-1448.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PycgygL3XZiSheL4CpquPM