feat: research agent
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import tomllib
|
||||
|
||||
from agentci.adapters.codex import CodexClient, _session_id
|
||||
|
||||
|
||||
@@ -21,8 +23,33 @@ def test_turns_skip_interactive_git_trust_check(tmp_path) -> None:
|
||||
codex_home=tmp_path / "codex",
|
||||
schemas_dir=tmp_path / "schemas",
|
||||
timeout_seconds=60,
|
||||
research_model="gpt-5.6-luna",
|
||||
research_reasoning="high",
|
||||
context7_api_key=None,
|
||||
)
|
||||
|
||||
args = client._turn_args("model", "medium", "agentci-read", "plan.json")
|
||||
|
||||
assert "--skip-git-repo-check" in args
|
||||
|
||||
|
||||
def test_configures_research_agent_and_optional_context7_key(tmp_path) -> None:
|
||||
client = CodexClient(
|
||||
codex_home=tmp_path / "codex",
|
||||
schemas_dir=tmp_path / "schemas",
|
||||
timeout_seconds=60,
|
||||
research_model="research-model",
|
||||
research_reasoning="high",
|
||||
context7_api_key="ctx7-secret",
|
||||
)
|
||||
|
||||
agent = (tmp_path / "codex" / "agents" / "research.toml").read_text()
|
||||
parsed = tomllib.loads(agent)
|
||||
assert 'name = "research"' in agent
|
||||
assert parsed["model"] == "research-model"
|
||||
assert parsed["model_reasoning_effort"] == "high"
|
||||
assert parsed["web_search"] == "live"
|
||||
assert 'url = "https://mcp.context7.com/mcp"' in agent
|
||||
assert 'url = "https://mcp.grep.app"' in agent
|
||||
assert "ctx7-secret" not in agent
|
||||
assert client._environment()["CONTEXT7_API_KEY"] == "ctx7-secret"
|
||||
|
||||
Reference in New Issue
Block a user