Repository navigation
Description
Context
resolveRunWorkload() (packages/knative-server/src/server.ts:300-324) resolves a
sandboxPoolSelector from a WorkloadRecord.sandboxSelector (context-service.ts:13-26) and
returns it on the envelope:
return { ...body, sandboxPoolSelector: record.sandboxSelector };For kind: 'prompt' leaves it deliberately does not, and only warns (:308-320, an ADR-0028
amendment dated 2026-09-01):
A prompt leaf DOES lease a pool sandbox now, and honors an envelope
sandboxPoolSelector
(ADR 0028 amendment, 2026-09-01) — but a workload-addressed one still ignores the workload's own
selector. The workloadId gates existence (404 above) and nothing more.
Whether a workload's pool should bound its prompt leaves is a separate decision from making the
lease work at all; until it is taken, warn rather than change behavior here.
So the decision was explicitly deferred, with a warn as the placeholder. This issue is to take it.
Why it matters now
POST /runs strips any client-supplied sandboxPoolSelector at server.ts:553 by design ("never
accept a Kubernetes selector directly from an external run request"), so resolveRunWorkload() is
the only injection point for pool scoping on that path.
The Z8 multi-user control plane design
(docs/specs/2026-09-08-multi-user-control-plane-design.md
§2.6, §8.2, §11.1) needs a per-tenant selector so that two users' leaves cannot be placed on the same
pooled sandbox pod. The path a logged-in user's session turn takes is exactly kind: 'prompt' — the
one case the resolver declines. Until this is decided, the tenant-labelled pool partition cannot be
enforced, and multi-user isolation holds at the API, session store, and inference credential but
not at the sandbox.
Note this is not only a multi-user question: it affects the plain /runs + workloadId path too,
which is why Z8 recorded it as owed rather than deciding it unilaterally.
Options
- Honour the workload's selector for prompt leaves — deletes the special case, one consistent
rule for every kind. Changes existing behaviour for anyone dispatching a workload-addressed
prompt leaf today, which is presumably why it was deferred. - Keep ignoring it; add a separate tenant-scoped selector channel — leaves
/runssemantics
untouched and gives the control plane its own path. Two mechanisms doing one job, and the warn
stays forever. - Make it opt-in per workload record — a field on
WorkloadRecord(e.g.boundPromptLeaves).
Backward compatible, at the cost of another knob and another combination to test.
No recommendation offered here — the deferral predates the Z8 design and the tradeoff is mostly
about existing /runs consumers.
Acceptance criteria
- Decision recorded (ADR amendment to 0028, or a new ADR).
- The
console.warnatserver.ts:315-318is removed or replaced by the chosen behaviour. - A test pins whichever behaviour is chosen for
kind: 'prompt'+workloadId. - Z8 §8.2 / §11.1 updated to reference the outcome.
Raised out of the Z8 multi-user control-plane design (docs/specs/2026-09-08-multi-user-control-plane-design.md, §2.6 / §8.2 / §11.1), which records this as owed rather than deciding it.
Activity
docs(spec): Z8 multi-user control plane — owned sessions, per-user cr…
docs(spec): address PR rossoctl#238 review — rossoctl#237 does not ga…
pdettori commentedon Sep 8, 2026
Correction to this issue's "why it matters now" section — the MU2 dependency I claimed here is inverted, found in review of #238.
There are two distinct selectors, and
server.ts:308-311distinguishes them in the sentence this issue quotes:kind: 'prompt'?sandboxPoolSelectorWorkloadRecord.sandboxSelectorThis issue governs only the second. The multi-user tenant partition uses the envelope selector, which prompt leaves already honour:
sandboxEnvironment()(run-leaf.ts:124-128) is not gated onkind,runPromptLeafreaches it at:390, andselectPoolSandboxtakes its environment as an argument (select-sandbox.ts:75), so the selector is request-scoped already.So this issue does not block MU2, and MU2 should not be listed as a reason to prioritise it. MU2's actual gap is unrelated: the
/turnpath resolves a single pod viaresolveSandboxConfig(run-turn.ts:57) and never leases from the pool, so it needs the same substitutionrunPromptLeafalready made.The decision here still stands on its own merits for the
/runs+workloadIdpath — theconsole.warnis a placeholder for a decision nobody has taken, and it affects non-multi-user callers. The acceptance criteria are unchanged apart from the last one, which should now read "MU1 §8.2 / §11.1 reference the outcome" rather than implying MU2 waits on it.