Skip to content

Gate AppServer pre-dispatch cancellation before releasing initialize #119

Description

@lynnswap

Problem

AppServerClientTests.backendAdmissionRefusesThreadStartBeforeDispatch creates the cancellation task and immediately opens the held initialize response. It does not wait for ReviewStartAdmission to record the cancellation owner.

If initialization resumes first, the backend legitimately reaches thread/start; the fake has no queued thread response and decodes {} as Thread.Start.Response, producing the intermittent keyNotFound("thread") failure seen in full package runs. The test passes individually when cancellation happens to win.

Required fix

After creating the cancellation task, wait for the semantic cancellation admission (.mcpClient("Stop")) before opening the initialize gate. Keep production unchanged. Search the neighboring AppServer admission fixtures for the same task-scheduling assumption.

Acceptance

  • Deterministically proves zero thread/start writes after admitted pre-dispatch cancellation.
  • Repeated focused runs and the full AppServer/full package suites pass.
  • No sleeps, Task.yield(), request-count ordering, or production changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions