Repository navigation
One JSON-lines process helper for the provider adapters (#1447 pass D) - #1451
Merged
currentbits merged 9 commits intoOct 4, 2026
Merged
Conversation
…o it
One spawn + NDJSON line buffer + finish guard + SIGKILL escalation for the
stream-json adapters, instead of a copy per provider. Cursor keeps its exact
onExit payload ({ code, stderr, fullStdout, gotJson }). Also moves the
runCursor JSDoc back above runCursor (it had drifted onto linkOrSkip).
Refs #1447
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Same onExit payload ({ code, stderr, fullStdout, gotJson }), kill timing and
stderr tail as the removed copy.
Refs #1447
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Same onExit payload ({ code, stderr, fullStdout, gotJson }), kill timing and
stderr tail as the removed copy.
Refs #1447
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ageEvent
Codex keeps its narrower onExit payload ({ code, stderr }) and does not
buffer fullStdout. isAgentMessageEvent had no callers in src/, electron/ or
test/.
Refs #1447
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The result-event stdin close moves into an onEvent wrapper; writeLine still
refuses once the process has finished (isFinished). onExit keeps
{ code, stderr, gotResult } and no fullStdout is buffered, which matters for
keepAlive processes that outlive many turns.
Refs #1447
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Kimi's extras stay in kimi.js: the effort-flip restore is prepended to the stdout/stderr data listeners (so it still runs before parsing) and runs again on exit; the stderr thinking parser is a second stderr listener and its last partial line is flushed before onExit, as before. Refs #1447 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mi/muse isLive*Thread, rmWithoutFollowing and reclaim*Homes were four identical copies (plus isLiveOverlayThread in remote-overlay.js). They now live in electron/overlayHomes.js; grok's session copy-back runs as a beforeRemove hook inside the same try, so a failing copy still skips that overlay. Refs #1447 Co-Authored-By: Claude Opus 5.5 <[email protected]>
ask.extractMuseText and commitmsg.extractMuseMessage were byte-identical; both now call muse.extractStdoutText. The codex extractors stay separate (commitmsg filters by item/msg type, ask takes any item text). The argv builders stay separate too: they differ only in claude --max-turns 1 today, and sharing them would let ask-mode flag changes leak into commit-message generation. Refs #1447 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ines The JSON-lines adapters no longer spawn themselves; agent.js does, and it stays under the cross-spawn and agentSpawnOptions checks. The adapters are now asserted to go through runJsonLines with no child_process spawn or detached: true of their own. Drops kimi's orphaned cross-spawn comment. Refs #1447 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pass D of #1447. Six provider adapters each carried their own copy of the same child-process plumbing: spawn the CLI, split stdout into lines, parse each line as JSON defensively, keep a stderr tail, run a one-shot finish that flushes the last partial line and clears the SIGKILL timer, then call onExit. That now lives in
runJsonLinesinelectron/agent.js.Changes
runJsonLinesadded toelectron/agent.js. cursor, muse, opencode, codex, claude and kimi run on it. Each adapter maps the shared{ code, stderr, fullStdout, gotJson }to its own onExit payload.electron/overlayHomes.js: the four near-identicalreclaim*Homesfunctions (cursor, grok, kimi, muse) share one implementation. Grok's session copy-back is kept as a hook.isAgentMessageEventexport.electron/test/json-lines-child.test.jscovers the helper: partial last line, non-JSON lines, finish only once, kill escalation.which-platform.test.jspoints its cross-spawn/detach guards at the helper.Behaviour checked against main: each adapter still keeps the 64 KB stderr tail.
fullStdoutis only collected where it was before (keepStdout: truefor cursor, muse, opencode and kimi). Kill escalation via killTree/SIGKILL_AFTER_MS is unchanged. Interactive Claude still gets a piped stdin, and codex exec still ignores stdin.Diff: 14 files, +545 / −1,194.
Verification: full electron suite in a CI-like env 4109/4109;
npm run typecheckclean.🤖 Generated with Claude Code