Repository navigation
fix(acp): retry npx cache warm online and surface npm stderr - #6831
peterzhang987723 wants to merge 1 commit into
Conversation
Signed-off-by: Shoufa Zhang <peterzhang987723@users.noreply.github.com>
|
@DevinVinson Could you confirm the scope and add the ready-for-dev label to #6809 if agreed? Branch head 1b4f253 retries _warm_npx_cache online when --prefer-offline fails, surfaces npm stderr with the cache path, and propagates cache-warm failures on ACP startup. |
|
@DevinVinson Following up on #6809: |
|
Thanks for flagging that @peterzhang987723 . I just manually set the label to ready-for-dev and if it gets flipped again I'll fix it. |
|
Thanks @DevinVinson! Marked this PR ready for review and |
HUMAN:
Fixes #6809 by adding an online fallback to
_warm_npx_cachewhen--prefer-offlinefails, capturingnpmstderr, and propagating cache-warm errors to ACP startup.AGENT:
Why
When the local npm cache (
_npx) already holds an outdated package metadata index,npm exec --prefer-offline --yes <package>@<version>inside_warm_npx_cachefails withETARGETand never falls back to online resolution. In addition, stderr fromnpmwas discarded (DEVNULL), and failures were downgraded to a warning before_start_acp_serverlaunchednpx --prefer-offlineagain, surfacing a misleadingConnection closederror.Summary
_warm_npx_cacheonce without--prefer-offlinewhen the offline warm pass fails so stale npm metadata caches are refreshed.npmstderrand include the package spec,npm_config_cachepath, exit code, and trailingstderrlines in warnings and raisedRuntimeErrors.RuntimeErrorfrom_warm_npx_cachein_start_acp_serverinstead of continuing to launch a brokennpx --prefer-offlinesubprocess.Issue Number
Fixes #6809
How to Test
Observed results on branch HEAD
1b4f253:tests/sdk/agent/test_acp_agent.py: 502 passed (covers mocked npm offline/online fallback, stderr surfacing, andACPAgentstartup propagation; live npm registry downloads were not executed offline).ruff checkandruff format --check: passed.Type
Jev-Fast-Audit
⚡ Jev fast audit · estimates · 0.24s · commit 1b4f253⚠️ reduced context — partial coverage; 6/6 hunks, 2/2 files (missing context: 8).
Strongest signal: No primary concern selected.
Evidence: No primary concern to locate.
Coverage:
All estimates and evidence