feat! Claude Code as a CLI agent now supported. Mix and match: spawn claude code from within claude code, or claude code from within codex.

Stay in codex, plan review and fix complicated bugs, then ask it to spawn claude code and implement the plan.

This uses your current subscription instead of API tokens.
This commit is contained in:
Fahad
2025-10-08 11:12:44 +04:00
parent 23c9b35d52
commit 9ffca53ce5
15 changed files with 441 additions and 12 deletions

View File

@@ -40,3 +40,41 @@ async def test_clink_gemini_single_digit_sum():
if status == "continuation_available":
offer = payload.get("continuation_offer") or {}
assert offer.get("continuation_id"), "Expected continuation metadata when status indicates availability"
@pytest.mark.integration
@pytest.mark.asyncio
async def test_clink_claude_single_digit_sum():
if shutil.which("claude") is None:
pytest.skip("claude CLI is not installed or on PATH")
tool = CLinkTool()
prompt = "Respond with a single digit equal to the sum of 2 + 2. Output only that digit."
results = await tool.execute(
{
"prompt": prompt,
"cli_name": "claude",
"role": "default",
"files": [],
"images": [],
}
)
assert results, "clink tool returned no outputs"
payload = json.loads(results[0].text)
status = payload["status"]
if status == "error":
metadata = payload.get("metadata") or {}
reason = payload.get("content") or metadata.get("message") or "Claude CLI reported an error"
pytest.skip(f"Skipping Claude integration test: {reason}")
assert status in {"success", "continuation_available"}
content = payload.get("content", "").strip()
assert content == "4"
if status == "continuation_available":
offer = payload.get("continuation_offer") or {}
assert offer.get("continuation_id"), "Expected continuation metadata when status indicates availability"