-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(core): expand QWEN_PROJECT_DIR in command hooks #10393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4300fa6
e69998f
7793f6f
a133fd5
4645a24
b48d078
c85f01c
ae9bf74
d677a85
8100111
4596896
c7a7804
d468ac8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,14 @@ Command hooks execute commands via child processes. Input JSON is passed through | |
| } | ||
| ``` | ||
|
|
||
| `$QWEN_PROJECT_DIR` (and the `$GEMINI_PROJECT_DIR` / `$CLAUDE_PROJECT_DIR` | ||
| compatibility forms) is expanded before the command reaches the shell, not by | ||
| the shell itself. Outside quotes the expanded path is auto-quoted for you | ||
| (including any literal path suffix immediately after it, e.g. on Windows | ||
| `cmd.exe`); inside `"..."` the raw path is spliced into your existing quotes. | ||
| Inside bash `'...'`, nothing expands — that's standard bash single-quote | ||
| semantics, so the placeholder is left exactly as written. | ||
|
Comment on lines
+87
to
+88
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The docs justify leaving a single-quoted placeholder untouched by quoting bash semantics ("nothing expands inside Witness: Add one sentence in this paragraph documenting the PowerShell behavior (inside PowerShell — qwen3.8-max via Qwen Code /review (v0.22.3) |
||
|
|
||
| ### HTTP Hooks | ||
|
|
||
| HTTP hooks send hook input as POST requests to specified URLs. They support URL whitelists, DNS-level SSRF protection, environment variable interpolation, and other security features. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] The new paragraph reads "(including any literal path suffix immediately after it, e.g. on Windows
cmd.exe)" as a general guarantee, but suffix absorption into the quoted region is implemented only in the cmd branch — the bash and PowerShell unquoted branches quote only the cwd and leave the suffix outside the quotes. A hook author writing"$QWEN_PROJECT_DIR/my scripts/check.sh"with cwd/tmp/my dirgets'/tmp/my dir'/my scripts/check.sh, which word-splits into/tmp/my dir/my+scripts/check.shand fails with a confusing not-found — the documented suffix-quoting never happens outside cmd.exe (and even cmd stops absorbing at a space in the suffix).Witness:
— qwen3.8-max via Qwen Code /review (v0.22.3)