code_mode: Move exec params from runtime declarations to @pragma#14511
Merged
code_mode: Move exec params from runtime declarations to @pragma#14511
Conversation
pakrym-oai
reviewed
Mar 12, 2026
| initial_yield_timer: null, | ||
| initial_yield_triggered: false, | ||
| max_output_tokens_per_exec_call: DEFAULT_MAX_OUTPUT_TOKENS_PER_EXEC_CALL, | ||
| max_output_tokens_per_exec_call: maxOutputTokensPerExecCall, |
Collaborator
There was a problem hiding this comment.
does JS need to know about this value?
Contributor
Author
There was a problem hiding this comment.
Currently disconnecting is managed in the cjs level so I think when we implement this I would expect it to be done in the top level js context.
be92973 to
924f7a8
Compare
0244d0c to
03494d1
Compare
e735f1f to
ebd7bbd
Compare
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.
This change moves code_mode exec session settings out of the runtime API and into an optional first-line pragma, so instead of calling runtime helpers like set_yield_time() or set_max_output_tokens_per_exec_call(), the model can write // @exec: {"yield_time_ms": ..., "max_output_tokens": ...} at the top of the freeform exec source. Rust now parses that pragma before building the source, validates it, and passes the values directly in the exec start message to the code-mode broker, which applies them at session start without any worker-runtime mutation path. The @openai/code_mode module no longer exposes those setter functions, the docs and grammar were updated to describe the pragma form, and the existing code_mode tests were converted to use pragma-based configuration instead.