29 lines
777 B
Python
29 lines
777 B
Python
from agentci.adapters.codex import CodexClient, _session_id
|
|
|
|
|
|
def test_extracts_thread_id_from_jsonl() -> None:
|
|
output = '\n'.join(
|
|
[
|
|
'{"type":"turn.started"}',
|
|
'{"type":"thread.started","thread_id":"abc-123"}',
|
|
"not json",
|
|
]
|
|
)
|
|
assert _session_id(output) == "abc-123"
|
|
|
|
|
|
def test_missing_thread_id_returns_none() -> None:
|
|
assert _session_id('{"type":"turn.completed"}') is None
|
|
|
|
|
|
def test_turns_skip_interactive_git_trust_check(tmp_path) -> None:
|
|
client = CodexClient(
|
|
codex_home=tmp_path / "codex",
|
|
schemas_dir=tmp_path / "schemas",
|
|
timeout_seconds=60,
|
|
)
|
|
|
|
args = client._turn_args("model", "medium", "agentci-read", "plan.json")
|
|
|
|
assert "--skip-git-repo-check" in args
|