Skip to content

fix: race in js repl#11922

Merged
jif-oai merged 3 commits intomainfrom
jif/js-repl-race
Feb 17, 2026
Merged

fix: race in js repl#11922
jif-oai merged 3 commits intomainfrom
jif/js-repl-race

Conversation

@jif-oai
Copy link
Collaborator

@jif-oai jif-oai commented Feb 16, 2026

js_repl_reset previously raced with in-flight/new js_repl executions because reset() could clear exec_tool_calls without synchronizing with execute(). In that window, a running exec could lose its per-exec tool-call context, and subsequent kernel RunTool messages would fail with js_repl exec context not found. The fix serializes reset and execute on the same exec_lock, so reset cannot run concurrently with exec setup/teardown. We also keep the timeout path safe by performing reset steps inline while execute() already holds the lock, avoiding re-entrant lock acquisition. A regression test now verifies that reset waits for the exec lock and does not clear tool-call state early.

@jif-oai
Copy link
Collaborator Author

jif-oai commented Feb 16, 2026

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jif-oai jif-oai merged commit 77f74a5 into main Feb 17, 2026
33 checks passed
@jif-oai jif-oai deleted the jif/js-repl-race branch February 17, 2026 11:06
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 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.

2 participants