Files
codex/codex-rs/core/src
Ivan Murashko 0237459f71 Handle concatenation nodes in bash command parser for exec policy (#8395)
The bash command parser in exec_policy was failing to parse commands
with concatenated flag-value patterns like `-g"*.py"` (no space between
flag and quoted value). This caused policy rules like
`prefix_rule(pattern=["rg"])` to not match commands such as `rg -n "foo"
-g"*.py"`.

When tree-sitter-bash parses `-g"*.py"`, it creates a "concatenation"
node containing a word (`-g`) and a string (`"*.py"`). The parser
previously rejected any node type not in the ALLOWED_KINDS list, causing
the entire command parsing to fail and fall back to matching against the
wrapped `bash -lc` command instead of the inner command.

This change:
- Adds "concatenation" to ALLOWED_KINDS in
try_parse_word_only_commands_sequence
- Adds handling for concatenation nodes in parse_plain_command_from_node
that recursively extracts and joins word/string/raw_string children
- Adds test cases for concatenated flag patterns with double and single
quotes

Fixes #8394
2025-12-22 19:59:27 +00:00
..
2025-12-22 09:59:32 -08:00
2025-12-22 09:59:32 -08:00
2025-12-22 09:59:32 -08:00
2025-12-12 18:59:39 +00:00
2025-12-22 09:59:32 -08:00
2025-12-12 17:07:17 -08:00
2025-11-28 11:34:57 +00:00
2025-12-11 14:06:07 -08:00
2025-12-22 00:20:53 +00:00