core-agent-ide/docs
Curtis 'Fjord' Hawthorne b560494c9f
Persist js_repl codex helpers across cells (#14503)
## Summary

This changes `js_repl` so saved references to `codex.tool(...)` and
`codex.emitImage(...)` keep working across cells.

Previously, those helpers were recreated per exec and captured that
exec's `message.id`. If a persisted object or saved closure reused an
old helper in a later cell, the nested tool/image call could fail with
`js_repl exec context not found`.

This patch:
- keeps stable `codex.tool` and `codex.emitImage` helper identities in
the kernel
- resolves the current exec dynamically at call time using
`AsyncLocalStorage`
- adds regression coverage for persisted helper references across cells
- updates the js_repl docs and project-doc instructions to describe the
new behavior and its limits

## Why

We already support persistent top-level bindings across `js_repl` cells,
so persisted objects should be able to reuse `codex` helpers in later
active cells. The bug was that helper identity was exec-scoped, not
kernel-scoped.

Using `AsyncLocalStorage` fixes the cross-cell reuse case without
falling back to a single global active exec that could accidentally
attribute stale background callbacks to the wrong cell.
2026-03-12 15:41:54 -07:00
..
agents_md.md Rename hierarchical_agents to child_agents_md (#9215) 2026-01-14 19:14:24 +00:00
authentication.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
CLA.md chore: subject docs/*.md to Prettier checks (#4645) 2025-10-03 11:35:48 -07:00
config.md Add realtime start instructions config override (#14270) 2026-03-11 12:33:09 -07:00
contributing.md [Codex][CLI] Gate image inputs by model modalities (#10271) 2026-02-02 18:56:39 -08:00
example-config.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
exec.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
execpolicy.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
exit-confirmation-prompt-design.md feat(tui): retire the tui2 experiment (#9640) 2026-01-22 01:02:29 +00:00
getting-started.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
install.md feat: discourage the use of the --all-features flag (#12429) 2026-02-20 23:02:24 -08:00
js_repl.md Persist js_repl codex helpers across cells (#14503) 2026-03-12 15:41:54 -07:00
license.md chore: subject docs/*.md to Prettier checks (#4645) 2025-10-03 11:35:48 -07:00
open-source-fund.md chore: subject docs/*.md to Prettier checks (#4645) 2025-10-03 11:35:48 -07:00
prompts.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
sandbox.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
skills.md Point skills docs to developer documentation site (#8407) 2025-12-21 16:18:58 -08:00
slash_commands.md Replaced user documentation with links to developers docs site (#8662) 2026-01-02 13:01:53 -07:00
tui-alternate-screen.md fix: add tui.alternate_screen config and --no-alt-screen CLI flag for Zellij scrollback (#8555) 2026-01-09 18:38:26 +00:00
tui-chat-composer.md tui: preserve kill buffer across submit and slash-command clears (#12006) 2026-03-03 02:06:08 +00:00
tui-request-user-input.md tui: make Esc clear request_user_input notes while notes are shown (#10569) 2026-02-03 16:17:06 -08:00
tui-stream-chunking-review.md feat(tui): pace catch-up stream chunking with hysteresis (#10461) 2026-02-03 15:01:51 -08:00
tui-stream-chunking-tuning.md feat(tui): pace catch-up stream chunking with hysteresis (#10461) 2026-02-03 15:01:51 -08:00
tui-stream-chunking-validation.md feat(core): add configurable log_dir (#10678) 2026-02-05 01:23:30 +00:00