Add js_repl host helpers and exec end events#10672
Merged
Conversation
This was referenced Feb 4, 2026
8bb2e54 to
67d6633
Compare
67d6633 to
8dd500e
Compare
8dd500e to
676bc7d
Compare
676bc7d to
c4f3cd8
Compare
c4f3cd8 to
333601f
Compare
333601f to
ff24d97
Compare
ff24d97 to
608b2c1
Compare
608b2c1 to
0b33c6c
Compare
25fa388 to
abf0581
Compare
abf0581 to
88dc0cd
Compare
fjord-oai
added a commit
that referenced
this pull request
Feb 11, 2026
## Summary This PR adds an **experimental, feature-gated `js_repl` core runtime** so models can execute JavaScript in a persistent REPL context across tool calls. The implementation integrates with existing feature gating, tool registration, prompt composition, config/schema docs, and tests. ## What changed - Added new experimental feature flag: `features.js_repl`. - Added freeform `js_repl` tool and companion `js_repl_reset` tool. - Gated tool availability behind `Feature::JsRepl`. - Added conditional prompt-section injection for JS REPL instructions via marker-based prompt processing. - Implemented JS REPL handlers, including freeform parsing and pragma support (timeout/reset controls). - Added runtime resolution order for Node: 1. `CODEX_JS_REPL_NODE_PATH` 2. `js_repl_node_path` in config 3. `PATH` - Added JS runtime assets/version files and updated docs/schema. ## Why This enables richer agent workflows that require incremental JavaScript execution with preserved state, while keeping rollout safe behind an explicit feature flag. ## Testing Coverage includes: - Feature-flag gating behavior for tool exposure. - Freeform parser/pragma handling edge cases. - Runtime behavior (state persistence across calls and top-level `await` support). ## Usage ```toml [features] js_repl = true ``` Optional runtime override: - `CODEX_JS_REPL_NODE_PATH`, or - `js_repl_node_path` in config. #### [git stack](https://github.com/magus/git-stack-cli) - 👉 `1` #10674 - ⏳ `2` #10672 - ⏳ `3` #10671 - ⏳ `4` #10673 - ⏳ `5` #10670
bdf7103 to
6c052c3
Compare
6c052c3 to
99351f8
Compare
owenlin0
reviewed
Feb 12, 2026
owenlin0
reviewed
Feb 12, 2026
f2798d4 to
0ca07e6
Compare
git-stack-id: fjord/js_repl_seq---4hn_dcnepr036e git-stack-title: Add js_repl host helpers and exec end events
0ca07e6 to
3aa7980
Compare
owenlin0
approved these changes
Feb 12, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
This PR adds host-integrated helper APIs for
js_repland updates model guidance so the agent can use them reliably.What’s included
codex.tool(name, args?)in the JS kernel sojs_replcan call normal Codex tools.codex.statecodex.tmpDirjs_repltool calls through the standard tool router path.js_replexecution completion/end event behavior with existing tool logging patterns.project_doc) to document:codex.tool(...)view_image(codex.tmpDir+codex.tool("view_image", ...))console.log/codex.tool, avoid directprocess.std*)Why
codex.tool(...)js_replbehavior more consistent with existing tool execution and event/logging patterns.js_replsafely and effectively.Testing
codex.toolcalls fromjs_repl(including shell/MCP paths)view_imagejs_replguidancegit stack
1Add feature-gated freeform js_repl core runtime #106742Add js_repl host helpers and exec end events #106723Add js_repl_tools_only model and routing restrictions #106714Add feature-gated js_repl polling flow #106735Add optional js_repl isolation and vendored Node runtime #10670