fix(code-execution): separate script execution from bounded observation - #155
Draft
Meganeuridae wants to merge 1 commit into
Draft
Meganeuridae wants to merge 1 commit into
Meganeuridae wants to merge 1 commit into
Conversation
Reserve interpreter startup, isolate late replies, serialize wake delivery, retain execution results, and support ending an observation with completion wake armed. Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
A Python
awaitcurrently holds the model-facing tool call open until the whole script exits. The runner also accepts overlapping cold starts, and an outstanding tool response from a killed interpreter can satisfy a replacement interpreter's reused call ID. Background wake requests can exceed the configured rate/cap when concurrent and falsely acknowledge a context delivery failure.Changes
script_idafter 10 seconds by default (wait_ms, maximum 60 seconds);action=waitretrieves or rejoins the same run. Persistent Python state stays serial and busy responses identify the active run.on_timeout=end_turnarms completion delivery before returning an end-turn result. An active observer consumes completion directly; otherwise a yielded execution sends a bounded completion notice and wake. The five most recently settled results remain retrievable per owner.releaseCodeExecutionWait(agentName, scriptId?)for the host's admin-only command. This resolves observations through the normal tool-result boundary without killing Python. It is not an agent tool and is not exposed on the generic framework socket API.The agent-facing description and
docs/code-execution-lifecycle.mddescribe the exact behavior and the further design work. A breaking-change fragment calls out the new foreground return contract.Tests
8b612f5: build passes;npm test: 786 pass / 0 fail / 4 skipped (790 total).npm test: 802 pass / 0 fail / 4 skipped (806 total).Not verified / limits
No live provider, resident deployment, host restart recovery, or cross-platform run was performed. Scripts/results remain process-local. Cancelling Python does not cancel an already dispatched inner tool. Completion notices use the existing scheduler; consuming a notice mid-turn can still leave a follow-up wake queued. Durable outcomes, paged journals, and delivery receipts are explicitly deferred in the design note.
Companion PRs
Companion: anima-research/connectome-host#130. It adds admin-only
/release-wait [script_id]and recipe validation. Publish/install a framework release containing this primitive before expecting that command to work; the companion fails explicitly on older framework versions. No merge, package publication, dependency rollout, or deployment is included here.Generated with OpenAI Codex.