Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions acp_adapter/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ def _make_agent(
"api_mode": api_mode or runtime.get("api_mode"),
"base_url": base_url or runtime.get("base_url"),
"api_key": runtime.get("api_key"),
"credential_pool": runtime.get("credential_pool"),
"command": runtime.get("command"),
"args": list(runtime.get("args") or []),
}
Expand Down
8 changes: 5 additions & 3 deletions tests/acp/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def test_get_session(self, manager):
def test_get_nonexistent_session_returns_none(self, manager):
assert manager.get_session("does-not-exist") is None

def test_make_agent_stamps_session_cwd_for_codex_runtime(self, monkeypatch):
def test_make_agent_stamps_cwd_and_forwards_runtime_credential_pool(self, monkeypatch):
sentinel_pool = object()

class FakeAgent:
model = "fake-model"

Expand Down Expand Up @@ -113,15 +115,15 @@ def __init__(self, **kwargs):
"api_mode": "codex_app_server",
"base_url": "https://example.invalid",
"api_key": "test-key",
"credential_pool": sentinel_pool,
},
)
monkeypatch.setattr("acp_adapter.session._register_task_cwd", lambda task_id, cwd: None)

state = SessionManager(db=None).create_session(cwd="/tmp/project")

assert state.agent.session_cwd == "/tmp/project"


assert state.agent.kwargs["credential_pool"] is sentinel_pool


# ---------------------------------------------------------------------------
Expand Down