Skip to content

fix(runtime-host): preserve settled hosted outcomes - #2671

Merged
Astro-Han merged 1 commit into
apache:mainfrom
Astro-Han:fix/2662-preserve-hosted-outcomes
Aug 11, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
Astro-Han:fix/2662-preserve-hosted-outcomes

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Preserve Runtime Host canonical completed and failed outcomes 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 passed
  • node --test --test-concurrency=1 dist/__tests__/owned-candidate.test.js — 4 passed
  • node --test --test-name-pattern="hosted execution settles while its tracked environment resource remains verifiable" dist/__tests__/execution-composition.test.js — passed
  • node --test --test-name-pattern="elects one owner, serves status and diagnostics, and releases ownership after true-idle shutdown" dist/__tests__/host-kernel.test.js — passed
  • npm --workspace @maka/runtime-host run typecheck — passed
  • npx 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 — passed

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

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.

@Astro-Han
Astro-Han marked this pull request as ready for review August 11, 2026 05:00
@Astro-Han
Astro-Han merged commit 80282a8 into apache:main Aug 11, 2026
10 checks passed
@Astro-Han
Astro-Han deleted the fix/2662-preserve-hosted-outcomes branch August 11, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settled hosted executions become indeterminate after a diagnostics disconnect

1 participant