Skip to content

test(electron): provider-switch-context reads only complete log lines - #1517

Merged
currentbits merged 1 commit into
mainfrom
fix/provider-switch-test-partial-line
Oct 6, 2026
Merged

currentbits merged 1 commit into
mainfrom
fix/provider-switch-test-partial-line

Conversation

@currentbits

Copy link
Copy Markdown
Owner

provider-switch-context.test.js (from #1494) failed intermittently under full-suite load: it failed on three separate verification runs and passed alone.

Cause: readPrompts JSON-parsed every line of a JSONL log that the fake agent subprocess was still appending to. waitFor polls readPrompts, so a half-written last line threw SyntaxError inside the predicate.

Fix: parse only newline-terminated lines (split("\n").slice(0, -1)). Each record is one JSON.stringify'd string plus \n, so the dropped tail is either empty or partial. The test passes 10 of 10 alone; test-only change.

🤖 Generated with Claude Code

readPrompts JSON-parsed every line of a log the fake agent was still
appending to; waitFor polls it, so under full-suite load a half-written
last line threw and failed the test (seen on three verification runs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T16:48:01.812765Z 7b6376c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@currentbits
currentbits merged commit d3e4079 into main Oct 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant