fix: GAP-06–10 parser, invoke Null, exec capture, SSE headers

Recover ## bodies after bad *…* terminators; bracket-aware call args;
invoke Null is 500 not fake ok; sys.exec capture={code,stdout,stderr};
proxy stream sets anti-buffer headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-09 13:58:02 +08:00
1 parent 68c4f8c822
commit 1637acce6e
14 files changed
+389 -45

No files matched your search

+31 -6
View File
@@ -924,9 +924,12 @@ fn split_first_token(s: &str) -> (&str, &str) {
}
fn find_next_arg_boundary(after_eq: &str) -> usize {
// Look for ` <ident>=` pattern not inside backticks or quoted strings.
// Look for ` <ident>=` pattern not inside backticks, quoted strings, or
// JSON-ish `[…]` / `{…}` (GAP-07: `text=["a"] other=…`).
let mut in_bt = false;
let mut in_str = false;
let mut bracket_depth: i32 = 0;
let mut brace_depth: i32 = 0;
let mut chars = after_eq.char_indices().peekable();
while let Some((i, c)) = chars.next() {
if in_str {
@@ -945,12 +948,34 @@ fn find_next_arg_boundary(after_eq: &str) -> usize {
}
continue;
}
if c == '`' {
in_bt = true;
continue;
match c {
'`' => {
in_bt = true;
continue;
}
'"' => {
in_str = true;
continue;
}
'[' => {
bracket_depth += 1;
continue;
}
']' => {
bracket_depth = bracket_depth.saturating_sub(1);
continue;
}
'{' => {
brace_depth += 1;
continue;
}
'}' => {
brace_depth = brace_depth.saturating_sub(1);
continue;
}
_ => {}
}
if c == '"' {
in_str = true;
if bracket_depth > 0 || brace_depth > 0 {
continue;
}
if c.is_whitespace() {