Summary
Runtime Host shutdown can exit with code 1 when Host drain begins while an active Turn is still entering a user-question Interaction. The Interaction rejection is an expected consequence of authority_draining, but the rejection is propagated as a shutdown failure.
Evidence
The failure was observed in CI run 33049161324, job 98440163642, while testing PR #3985 at commit 1be4ebf7dead925687897f1af527fb5a97c77dc5:
- Test:
packages/runtime-host/src/__tests__/execution-host-queue.test.ts — graceful Host shutdown stops and drains an active Turn before releasing ownership
- Host result:
execution Host stopped uncleanly: code 1
- Error path:
FakeBackend.sendQuestionScenario → RuntimeInteractionRunBinding.admitUserQuestionRequest → RuntimeInteractionAdmissionRejectedError
- Rejection:
reason: authority_draining, closureReason: undefined
- The error is then aggregated by
RootTurnCoordinator.close().
The same test and symptom were recorded independently in the verification notes of unrelated PR #3955. The base commit used by #3985 also passed the main CI run 33048544587, so the failure is intermittent or scheduling-dependent rather than a deterministic change in #3985. PR #3985 does not modify the Runtime Host shutdown or Interaction-coordinator paths.
Related work
- #1760 fixed a related case where a follow-up backend start was cancelled by Host drain and surfaced as a shutdown failure. Its filter handles a
RuntimeInteractionFailStopError wrapping an authority_draining rejection.
- #1771 tracked the need for deterministic Runtime Host lifecycle-race coverage.
- #1773 added deterministic steering/follow-up lifecycle checkpoints and removed the temporary unbounded shutdown diagnostic.
This report is for the active-question admission variant. The observed error is a direct RuntimeInteractionAdmissionRejectedError, so it does not match the wrapper handled by #1760.
Expected behavior
When shutdown has already begun, an Interaction request rejected with authority_draining while its Turn is being stopped should be treated as expected cancellation and allow a clean Host exit. Genuine Interaction invariant, cleanup, or resource failures must remain visible and continue to fail shutdown.
Suggested follow-up
Add deterministic coverage that holds an active Turn at the user-question admission boundary, starts Host drain, and verifies clean exit, terminal cancellation, released ownership, and preserved authority state. The test should run repeatedly without relying on response length or scheduler timing.
Posted by an automated review agent operated by @Astro-Han. This is not an
independent human review and does not satisfy the committer review required by
CONTRIBUTING.md. A human is accountable for this comment — please push back if
anything here is wrong.
简体中文
本条评论由 @Astro-Han 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
Summary
Runtime Host shutdown can exit with code 1 when Host drain begins while an active Turn is still entering a user-question Interaction. The Interaction rejection is an expected consequence of
authority_draining, but the rejection is propagated as a shutdown failure.Evidence
The failure was observed in CI run 33049161324, job
98440163642, while testing PR #3985 at commit1be4ebf7dead925687897f1af527fb5a97c77dc5:packages/runtime-host/src/__tests__/execution-host-queue.test.ts—graceful Host shutdown stops and drains an active Turn before releasing ownershipexecution Host stopped uncleanly: code 1FakeBackend.sendQuestionScenario→RuntimeInteractionRunBinding.admitUserQuestionRequest→RuntimeInteractionAdmissionRejectedErrorreason: authority_draining,closureReason: undefinedRootTurnCoordinator.close().The same test and symptom were recorded independently in the verification notes of unrelated PR #3955. The base commit used by #3985 also passed the main CI run 33048544587, so the failure is intermittent or scheduling-dependent rather than a deterministic change in #3985. PR #3985 does not modify the Runtime Host shutdown or Interaction-coordinator paths.
Related work
RuntimeInteractionFailStopErrorwrapping anauthority_drainingrejection.This report is for the active-question admission variant. The observed error is a direct
RuntimeInteractionAdmissionRejectedError, so it does not match the wrapper handled by #1760.Expected behavior
When shutdown has already begun, an Interaction request rejected with
authority_drainingwhile its Turn is being stopped should be treated as expected cancellation and allow a clean Host exit. Genuine Interaction invariant, cleanup, or resource failures must remain visible and continue to fail shutdown.Suggested follow-up
Add deterministic coverage that holds an active Turn at the user-question admission boundary, starts Host drain, and verifies clean exit, terminal cancellation, released ownership, and preserved authority state. The test should run repeatedly without relying on response length or scheduler timing.
Posted by an automated review agent operated by @Astro-Han. This is not an
independent human review and does not satisfy the committer review required by
CONTRIBUTING.md. A human is accountable for this comment — please push back if
anything here is wrong.
简体中文
本条评论由 @Astro-Han 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md
所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。