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
2 changes: 1 addition & 1 deletion src/ucode/agents/pi.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def _refresh_forever(state: dict, stop_event: threading.Event) -> None:
def build_runtime_env(token: str) -> dict[str, str]:
env = os.environ.copy()
env["OAUTH_TOKEN"] = token
env["HOME"] = str(PI_UCODE_HOME)
env["PI_CODING_AGENT_DIR"] = str(PI_CONFIG_DIR)
return env


Expand Down
2 changes: 1 addition & 1 deletion tests/test_agent_pi.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_sets_oauth_token(self):

def test_sets_ucode_home(self):
env = pi.build_runtime_env("tok")
assert env["HOME"] == str(pi.PI_UCODE_HOME)
assert env["PI_CODING_AGENT_DIR"] == str(pi.PI_CONFIG_DIR)


class TestPiValidateCmd:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,10 @@ def test_launch_pi_per_model(self, tmp_path, monkeypatch, e2e_state, e2e_workspa
config_path = pi_dir / "models.json"
backup_path = tmp_path / "pi-models.backup.json"
monkeypatch.setattr(pi, "PI_UCODE_HOME", pi_home)
monkeypatch.setattr(pi, "PI_CONFIG_DIR", pi_dir)
monkeypatch.setattr(pi, "PI_CONFIG_PATH", config_path)
monkeypatch.setattr(pi, "PI_SETTINGS_PATH", pi_dir / "settings.json")
monkeypatch.setattr(pi, "PI_SETTINGS_BACKUP_PATH", tmp_path / "pi-settings.backup.json")
monkeypatch.setattr(pi, "PI_BACKUP_PATH", backup_path)

failures = []
Expand Down
3 changes: 3 additions & 0 deletions tests/test_e2e_user_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,10 @@ def test_user_agent_arrives_at_gateway(self, tmp_path, monkeypatch, capture_serv

monkeypatch.setattr(config_io_mod, "APP_DIR", tmp_path)
monkeypatch.setattr(pi, "PI_UCODE_HOME", pi_home)
monkeypatch.setattr(pi, "PI_CONFIG_DIR", pi_dir)
monkeypatch.setattr(pi, "PI_CONFIG_PATH", config_path)
monkeypatch.setattr(pi, "PI_SETTINGS_PATH", pi_dir / "settings.json")
monkeypatch.setattr(pi, "PI_SETTINGS_BACKUP_PATH", tmp_path / "pi-settings.backup.json")
monkeypatch.setattr(pi, "PI_BACKUP_PATH", tmp_path / "pi.backup.json")

state = {
Expand Down