Repository navigation
Conversation
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5d287fb to
c51b0b4
Compare
…coding-agent CLIs A .cmd dispatcher forwards through cmd.exe (and often PowerShell), and an empty-string argument does not survive that hop: the CLI reads the next flag as the empty argument's value. For the qoder CN adapter that was fatal -- '--setting-sources ""' became '--setting-sources --max-turns' and every turn died with 'Invalid setting source: "--max-turns"' on the official installer layout, where qodercn resolves to the .cmd dispatcher. whichFromPath now scans the whole PATH for an .exe before falling back to any .cmd/.bat, and the Qoder CN profile tries the real qoderclicn executable before the qodercn dispatcher (they live in different directories, so PATH order alone cannot prefer the executable). Fixes lidge-jun#7518
Ingwannu
left a comment
There was a problem hiding this comment.
This overlaps the already-open fix #7527 for #7518; please compare against its current head 89b25a7ba1 before continuing an independent resolver change. That PR prefers a native executable across a profile's candidate names, preserves PATH directory precedence, and refuses an unverified batch-only forwarding chain. It also has real Windows native-argv controls.
Two changes are needed in this draft at 4db7da31402c1bf380ddb49fff85dbfd9c71cd66:
tests/adapters/coding-agent-binary-resolution.test.tsis new, but neither the test-layout map nor the expected-layout fixture is changed. Register it in both current owners as required by AGENTS.md, or reuse the canonical fix's existing tests if this contribution is superseded. The changed source area's structure contract also needs to be reviewed/updated in the same patch.whichFromPathnow lets a later PATH directory's executable override an earlier directory's same-name wrapper. That changes command-selection semantics for every coding-agent profile, beyond preferring.exebeside its shim. Explain/obtain agreement on that policy difference from #7527; fixture success for the new preference does not establish compatibility with deliberately selected earlier wrappers. A dispatcher-only install still runs without inspecting whether it drops the required empty arguments, so the original failure class also remains for that supported fallback.
Please keep this Draft and converge the scope/ownership with #7527 rather than landing two competing resolver contracts. I have not run native Windows tests or certified a live Qoder installation. This review does not authorize such a run or take over your branch.
|
Triage note (2026-10-24, against Superseded: by #7527 / Still needed on dev: no — #7527, commit Exact-head CI at triage time: A maintainer will decide on closing this; no action needed from you. |
|
Closing as superseded by #7527 ( |
Fixes #7518.
What
whichFromPath(Windows) now scans the entire PATH for a real.exebefore falling back to any.cmd/.bat. Previously the first match won per directory with.cmdtried first, so a dispatcher shim anywhere ahead of the executable routed the spawn throughcmd.exe /d /s /c— and an empty-string argument does not survive that hop (the shim body forwards viapowershell.exe -- %*, where it is lost again). The CLI then reads the next flag as the empty argument's value. This is the resolution-level fix the issue prefers: it fixes the whole class, not just qoder, and keeps argument boundaries intact with nocmd.exehop at all.qoderclicn(the real executable) beforeqodercn(the installer's.cmddispatcher). They live in different directories (entry\qodercn.cmdvsbin\qoderclicn\qoderclicn.exe), so PATH-wide.exepreference alone cannot reach it — the profile has to name it first. The issue's control experiment B shows re-quoting alone cannot fix this, so both changes are needed.Why both
With the old resolution, the qoder adapter's deliberate
--setting-sources ""(and--tools "") were lost and everyqoder-cnturn aborted withInvalid setting source: "--max-turns"before contacting any model.Tests
New
tests/adapters/coding-agent-binary-resolution.test.ts(real temp dirs on PATH, Windows-only, skipped elsewhere): same-directory.exebeats.cmd; an.exefurther down the PATH beats an earlier.cmd; a lone.cmdand a lone.batstill resolve. Plus a profile-order assertion. The existing qoder suite's isolation test now expects["qoderclicn", "qodercn"]—qoder-adapter.test.ts116/116,qoder-spawn-readmission3/3,qoder-live-modelsall green locally.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
.exefiles across PATH before resolving.cmd,.bat, or extensionless entries. Script-based commands remain available when no.exeis found.qoderclicnbeforeqodercn, improving command selection when launching the adapter.