Skip to content

ui-server: decide whether Claude may share its admission and turn-runner qualification #4398

Open

Description

@schlessera

Part of #4278. Found by the #4305 spike (PR #4393). No release commitment until ruled. Out of scope: process-wide pass caching, caching writable-area or alias verdicts, weakening launch checks, and changing provider history.

Context: a hosted Claude turn probes three times: admission at packages/ui-server/src/agent/worker-host.ts:49-63, the default turn-runner check at packages/ui-backend-claude/src/turn-runner.ts:175-177, and the distinct launch check at packages/ui-backend-claude/src/worker-spawn.ts:143-151. The real admission adapter passes mode, identity-sentinel configuration and supplied state/temp allowances through probeOptions; its ordinary-turn caller currently leaves the optional allowances undefined. The launch probe uses the worker's restricted flag, state allowance, temp allowance and profile, and must keep running unchanged. The spike timed two default-option probes versus one (about 156 ms versus 78 ms; 77 ms paired difference), not the three-probe hosted path or its launch-allowance proof. The proposed count is 3 → 2 only when admission and turn-runner context matches. A qualification must bind canonical brain identity, turn, mode, identity helper/configuration and every applicable option; equivalence must be proven rather than assumed. Pi is not included: its server admission plus one backend launch probe at packages/ui-backend-pi/src/worker-launch.ts:137-139 stay unchanged, with no extra default turn-runner check to eliminate.

Decision options: O1 (recommended, subject to ruling and native numbers): permit a private, single-turn handoff for Claude's matching admission and turn-runner qualifications, retaining one fresh shared probe for that pair plus the unchanged allowance/profile-specific launch probe. Saves only the duplicate default qualification and preserves the launch-time worker-specific proof; costs explicit context binding, ownership and invalidation. Standalone/mismatched/absent/expired contexts qualify afresh, and later turns never reuse a pass. O2: cache the default qualification across turns while retaining the launch probe; it can miss changes covered by the default proof and contradicts per-turn freshness, so reject. The experiment's process-wide upper bound does not cover or authorize caching the launch probe. O3: retain all three Claude probes; simplest unchanged rule, retaining the duplicate default check's local cost. Pi keeps both of its checks under every option. A launch failure must never permit a blind payload retry; recovery must first establish that no payload acted.

Acceptance criteria:

  • Maintainer ruling selects O1/O2/O3 and updates the binding worker-host documentation before any behavior change is approved.
  • If O1 is selected, Claude's admission and turn-runner qualifications share one fresh probe per turn in matching context, and the launch probe keeps running unchanged with the worker's own restricted, state, temp and profile allowances. Matching hosted Claude turns go 3 → 2 probes, never one. Standalone, mismatched, changed-config and next-turn callers qualify afresh; no unscoped success flag is accepted. Pi's server admission and launch probe remain unchanged.
  • Refused probes, revocation/cancellation and pre-payload launch failure cannot start the payload or leave a qualification/resource owner behind. A launch failure invalidates the handoff and records an immediate real re-probe; payload retry requires independent proof that it never ran.
  • Qualification failures retain their original status/cause and automatically recover through the next real probe; one backend/turn failure does not latch unrelated sessions. Answer the proportionate-containment checklist.
  • Failing-first and mutation tests cover changed brain/helper/options and two distinct turns; real namespace/Claude fixtures prove the matching path counts 3 → 2 while retaining the launch check's exact restricted/state/temp/profile options. Pi fixtures retain its existing admission and launch checks. Existing alias, scope, safety, budget and managed-storage guards remain fresh and unchanged.
  • Native --observation-timing --tree=large records probe counts and before/after admission/backend startup timings with raw paired evidence. No 77 ms native promise is inferred from this offline result.
  • Any changed public request type or contract is documented/versioned according to the integration contract; implementation introduces no new extension seam.

Activity

  1. added
    type: feat
    area: ui-server
    area: backends
    priority: p2
    needs: decision
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendsarea: ui-serverneeds: decisionpriority: p2type: feat

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions