Skip to content

Add js_repl kernel crash diagnostics#11666

Merged
fjord-oai merged 1 commit intomainfrom
fjord/js_repl_seq---4hqgloumyo34bp
Feb 13, 2026
Merged

Add js_repl kernel crash diagnostics#11666
fjord-oai merged 1 commit intomainfrom
fjord/js_repl_seq---4hqgloumyo34bp

Conversation

@fjord-oai
Copy link
Contributor

@fjord-oai fjord-oai commented Feb 13, 2026

Summary

This PR improves js_repl crash diagnostics so kernel failures are debuggable without weakening timeout/reset guarantees.

What Changed

  • Added bounded kernel stderr capture and truncation logic (line + byte caps).
  • Added structured kernel snapshots (pid, exit status, stderr tail) for failure paths.
  • Enriched model-visible kernel-failure errors with a structured diagnostics payload:
    • js_repl diagnostics: {...}
    • Included only for likely kernel-failure write/EOF cases.
  • Improved logging around kernel write failures, unexpected exits, and kill/wait paths.
  • Added/updated unit tests for:
    • UTF-8-safe truncation
    • stderr tail bounds
    • structured diagnostics shape/truncation
    • conditional diagnostics emission
    • timeout kill behavior
    • forced kernel-failure diagnostics

Why

Before this, failures like broken pipe / unexpected kernel exit often surfaced as generic errors with little context. This change preserves existing behavior but adds actionable diagnostics while keeping output bounded.

Scope

  • Code changes are limited to:
    • /Users/fjord/code/codex-jsrepl-seq/codex-rs/core/src/tools/js_repl/mod.rs

Validation

  • cargo clippy -p codex-core --all-targets -- -D warnings
  • Targeted codex-core js_repl unit tests (including new diagnostics/timeout coverage)
  • Tried starting a long running js_repl command (sleep for 10 minutes), verified error output was as expected after killing the node process.

git stack

Copy link
Contributor

@aaronl-openai aaronl-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@fjord-oai fjord-oai force-pushed the fjord/js_repl_seq---4hqgloumyo34bp branch 2 times, most recently from dba70d4 to e0d65fd Compare February 13, 2026 04:40
git-stack-id: fjord/js_repl_seq---4hqgloumyo34bp
git-stack-title: Add js_repl kernel crash diagnostics
@fjord-oai fjord-oai force-pushed the fjord/js_repl_seq---4hqgloumyo34bp branch from e0d65fd to 6159258 Compare February 13, 2026 16:56
@fjord-oai fjord-oai merged commit a02342c into main Feb 13, 2026
61 of 67 checks passed
@fjord-oai fjord-oai deleted the fjord/js_repl_seq---4hqgloumyo34bp branch February 13, 2026 19:57
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants