test(cli): stop the registry plan check depending on the developer's machine - #2019
Conversation
…machine The test built a fixture with its own HOME and PATH, then asserted that the whole install plan contained no path with "/plugins/" in it. Agent detection does not stay inside HOME and PATH: cbm_find_cli also looks in /usr/local/bin and, on macOS, /opt/homebrew/bin. A developer with OpenCode installed there has it detected inside the fixture, and OpenCode ships a real plugin file, so the plan legitimately carried a "/plugins/" path and the assertion failed. On a machine without OpenCode the same assertion passed, which is why CI never saw it. Name the two directories the check actually meant — the fixture's Qoder and Pi directories, neither of which has a plugin directory, so a planned path under one would be invented. The check now tests the same thing regardless of what the developer has installed. No production behaviour changed. Searching well-known install directories is deliberate, so that install finds an agent whose command is not on the current PATH. Fixes the failure at tests/test_cli.c:6859. Local cli suite: 293 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Joshua Richter <jrichter5781@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Approved. I verified the mechanism rather than taking it: This is the more valuable half of the fix, and worth stating plainly: the assertion's verdict depended on what the developer happened to have installed. A machine with OpenCode in That is the second finding of this shape we have seen in as many days. #2003 (filed by another contributor) is the same class from the other direction: And you fixed it the right way round. The tempting repair is to harden the fixture — sandbox Your one red is ours
Merging once the remaining checks report. Thank you — this is the sort of fix that pays for itself the next time someone trusts a green. |
|
Merged as This is the second machine-dependent assertion you have caught this week, and the fix is the right way round again: the test now names the two fixture directories it actually cares about instead of searching the whole plan for Small note for the record, not a change request: the retained |
The problem
cli_agent_client_registry_routes_plan_install_and_uninstallbuilds a fixture with its ownHOMEandPATH, then asserts the whole install plan contains no path with/plugins/in it.Agent detection does not stay inside
HOMEandPATH.cbm_find_clialso looks in/usr/local/binand, on macOS,/opt/homebrew/bin. A developer with OpenCode installed there has it detected inside the fixture, and OpenCode ships a real plugin file — so the plan legitimately carries a/plugins/path and the assertion fails. On a machine without OpenCode the same assertion passes, which is why CI has never seen it.The change
Name the two directories the check actually meant — the fixture's Qoder and Pi directories, neither of which has a plugin directory, so a planned path under one would be invented:
The check now tests the same thing regardless of what the developer has installed.
One file,
tests/test_cli.c, 12 insertions and 1 deletion. No production behaviour changes. Searching well-known install directories is deliberate, so that install finds an agent whose command is not on the currentPATH— that is not what this touches.Evidence
Run on a machine that has OpenCode installed, so the trigger condition is present.
Before, at
c38aa35c:After, on this branch:
OpenCode is detected in the fixture in both runs, so the condition that provokes the failure is present either way. The assertion fires in the first and not in the second.
One thing worth stating plainly
The
clisuite has other failures on this machine that this change does not address and does not claim to. They vary between runs — the agent-client install and uninstall assertions cannot drain a cohort while a permanent daemon is running, so the set differs each time.origin/mainitself reports 536 passed / 6 failed here, and three of those six print the sameDetected agents: OpenCodeline, attests/test_cli.c:9390and:9491alongside the one fixed here.So this fixes one instance of a wider pattern rather than the whole pattern. I did not extend it to the other two, because the right fix for each depends on what its own assertion means and I did not want to guess that on your behalf. Happy to follow up on those if the approach here is the one you want.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ERsNp8UNLaixL4uUz7hRTX