Repository navigation
fix(runtime-host): preserve settled hosted outcomes - #2671
Merged
Astro-Han merged 1 commit intoAug 11, 2026
Merged
Conversation
Generated-by: OpenAI Codex
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.
Summary
Preserve Runtime Host canonical
completedandfailedoutcomes once hosted execution reaches a terminal snapshot.The server now derives the returned status and failure reason from that terminal snapshot instead of a later abort signal. The client no longer re-cancels an already settled response or performs post-settlement diagnostics and runtime-resource label inspection. Settled environments are released to the enclosing Trial environment; cancelled and indeterminate paths still settle the owned Host before returning.
Fixes #2662
Verification
node --test --test-concurrency=1 dist/__tests__/hosted-execution-client.test.js dist/__tests__/hosted-execution-runner.test.js— 8 passednode --test --test-concurrency=1 dist/__tests__/owned-candidate.test.js— 4 passednode --test --test-name-pattern="hosted execution settles while its tracked environment resource remains verifiable" dist/__tests__/execution-composition.test.js— passednode --test --test-name-pattern="elects one owner, serves status and diagnostics, and releases ownership after true-idle shutdown" dist/__tests__/host-kernel.test.js— passednpm --workspace @maka/runtime-host run typecheck— passednpx biome check packages/runtime-host/src/client/hosted-execution.ts packages/runtime-host/src/server/hosted-execution-runner.ts packages/runtime-host/src/__tests__/hosted-execution-client.test.ts packages/runtime-host/src/__tests__/hosted-execution-runner.test.ts— passedChecklist
Does this PR entail a change in behavior?
AI disclosure: OpenAI Codex materially assisted with the implementation, tests, and PR draft. The human contributor reviewed the scope and owns the merge decision.
Review and merge path
Fast-path rationale: this is a low-impact, easily reversible correction to the internal Runtime Host/Eval handoff. It restores the existing terminal-outcome invariant without changing a public API, protocol schema, CLI, user workflow, or another protected area. The required checks pass.
AI-assisted review: OpenAI Codex performed an adversarial review of terminal-outcome monotonicity, cancellation/drain semantics, Runtime Host lifecycle handoff, test quality, and possible simplifications. It found no blocking correctness issue; the human contributor reviewed the final diff and commit message and owns the merge decision.