Skip to content

fix: set HOME for Copilot ACP subprocesses#11285

Closed
MestreY0d4-Uninter wants to merge 1 commit into
NousResearch:mainfrom
MestreY0d4-Uninter:fix/copilot-acp-home-env-clean
Closed

fix: set HOME for Copilot ACP subprocesses#11285
MestreY0d4-Uninter wants to merge 1 commit into
NousResearch:mainfrom
MestreY0d4-Uninter:fix/copilot-acp-home-env-clean

Conversation

@MestreY0d4-Uninter

Copy link
Copy Markdown
Contributor

Summary

  • pass an explicit HOME env var to Copilot ACP subprocesses
  • prefer Hermes profile subprocess home when available
  • fall back through ambient HOME, expanduser("~"), pwd.getpwuid(...), then /home/openclaw
  • add regression tests for both profile-home preference and clean-HOME fallback

Why

Delegated ACP child runs can fail when the ambient environment is missing HOME, which breaks startup paths that rely on Path.home() / expanduser().

Test Plan

  • uv run pytest -q -o addopts='' tests/agent/test_copilot_acp_client.py tests/agent/test_auxiliary_client.py::test_resolve_provider_client_supports_copilot_acp_external_process tests/run_agent/test_run_agent.py::test_aiagent_uses_copilot_acp_client

Notes

@MestreY0d4-Uninter

Copy link
Copy Markdown
Contributor Author

Refresh concluído em branch limpa a partir de origin/main, com cherry-pick do commit relevante e push com --force-with-lease. Validação: python -m py_compile agent/copilot_acp_client.py tests/agent/test_copilot_acp_client.py; uv run --frozen --with pytest pytest -q -o addopts='' tests/agent/test_copilot_acp_client.py.

@MestreY0d4-Uninter MestreY0d4-Uninter force-pushed the fix/copilot-acp-home-env-clean branch from 613b489 to 06cb98b Compare April 19, 2026 16:05
@MestreY0d4-Uninter

Copy link
Copy Markdown
Contributor Author

Audit completed (2026-04-19)

  • Branch refreshed from current origin/main
  • Focused tests: PASSING
  • Impact: High (fixes HOME env for all Copilot ACP subprocesses)
  • Risk: Low (98 lines, well-tested)

Recommendation: MERGE — critical bug fix for Copilot ACP subprocesses.


Part of batch audit: 23 PRs audited, 2 closed (absorbed), 21 refreshed

@MestreY0d4-Uninter

Copy link
Copy Markdown
Contributor Author

🔔 Ready for maintainer review

Esta PR foi validada como parte da auditoria completa de 2026-04-19.

Status:

  • ✅ Refreshed from origin/main (SHA: 6af04474)
  • ✅ Focused tests passing
  • ✅ Comentários de validação adicionados
  • ✅ Baixo risco de merge

Ação necessária: Review e merge pelos mantenedores.


Audit batch: 7 PRs de alto impacto validadas e prontas para merge

Pass an explicit HOME into Copilot ACP child processes so delegated ACP runs do not fail when the ambient environment is missing HOME.

Prefer the per-profile subprocess home when available, then fall back to HOME, expanduser('~'), pwd.getpwuid(...), and /home/openclaw. Add regression tests for both profile-home preference and clean HOME fallback.

Refs NousResearch#11068.
@MestreY0d4-Uninter MestreY0d4-Uninter force-pushed the fix/copilot-acp-home-env-clean branch from 06cb98b to d188a08 Compare April 24, 2026 01:58
@MestreY0d4-Uninter MestreY0d4-Uninter marked this pull request as ready for review April 24, 2026 01:58
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder provider/copilot GitHub Copilot (ACP + Chat) comp/acp Agent Communication Protocol adapter labels Apr 24, 2026
@MestreY0d4-Uninter

Copy link
Copy Markdown
Contributor Author

Audit/update 2026-04-25:

  • No branch mutation in this audit.
  • Focused local validation: 7 passed in 0.17s (tests/agent/test_copilot_acp_client.py).
  • Recommendation: Copilot ACP HOME env fix; focused tests passed, no attribution blocker detected.

This was part of the open-PR cleanup pass against current upstream/main.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for this fix, @MestreY0d4-Uninter! Closing as the changes are already on main.

Automated hermes-sweeper review.

  • Commit 7d2f93a97 (fix: set HOME for Copilot ACP subprocesses) is a confirmed ancestor of main (git merge-base --is-ancestor exits 0).
  • _resolve_home_dir() and _build_subprocess_env() are present in agent/copilot_acp_client.py (lines 49 and 84) and wired into the subprocess launch at line 426.
  • The regression tests from this PR (# HOME env propagation tests) are present in tests/agent/test_copilot_acp_client.py starting at line 149.

No further action needed — the fix shipped.

@teknium1 teknium1 closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists provider/copilot GitHub Copilot (ACP + Chat) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants