Skip to content

Strictly parse complete Copilot JSON event streams - #51

Merged
cinderzhan merged 1 commit into
mainfrom
fix/strict-copilot-json-event-stream
Oct 13, 2026
Merged

cinderzhan merged 1 commit into
mainfrom
fix/strict-copilot-json-event-stream

Conversation

@cinderzhan

Copy link
Copy Markdown
Collaborator

#45 repeatedly fails on a large Copilot stdout line at a stable JSON offset. The current parser assumes exactly one event per newline, although a stream can contain adjacent complete JSON objects.

Consume the entire event stream with a string/escape/bracket-aware scanner, then strictly JSON.parse every extracted object. Accept whitespace and adjacent complete objects; reject all garbage, mismatched or incomplete structures. Keep final-model, tool/MCP restrictions, unique final answer and successful result checks. Syntax diagnostics expose only structural types and character positions/codes, and no longer misclassify words inside JSON source evidence as rate limiting.

Validation: catalog validation and 100 tests pass, including NDJSON/adjacent objects, escaped quotes and braces in strings, trailing garbage, incomplete structures and forbidden tool events. Real PR #45 will be rechecked after merge; this does not bypass its safety judgments.

@github-actions github-actions Bot added the feature 非工作台 YAML 投稿,需要维护者评估 label Oct 13, 2026
@cinderzhan
cinderzhan merged commit 5329a3f into main Oct 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature 非工作台 YAML 投稿,需要维护者评估

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant