Repository navigation
fix: route prompt runs to workload sandboxes - #340
Conversation
Signed-off-by: Jeremy Cohn <[email protected]>
906c839 to
569136a
Compare
pdettori
left a comment
There was a problem hiding this comment.
Summary
Clean, well-scoped fix. Removes the kind === 'prompt' special case in resolveRunWorkload() that made workload-addressed prompt runs ignore the workload's sandboxSelector (previously just warn-logged). Now prompt runs resolve the selector the same way every other leaf kind does, matching the PR title. ADR 0028 and the multi-user control-plane spec are updated to match, and tests cover both the sync (/runs) and async/queued (enqueue) paths.
Verification performed:
- Confirmed both call sites of
resolveRunWorkload(synchandleRunLeafParsedand asynchandleEnqueueLeafParsed) share the same function, so the fix applies uniformly — the new queued-path test is exercising a genuinely separate code path, not a duplicate. - Confirmed the client-supplied
sandboxPoolSelectoris still stripped at the HTTP boundary before dispatch, so this change doesn't weaken that invariant — the selector still only ever comes from the server-resolvedWorkloadRecord. - The failing
protoCI check is the known flakyvmpooltimeout test, unrelated to this PR's TypeScript changes (confirmed via job log).
Author: moonlight16 (MEMBER — maintainer)
Areas reviewed: TypeScript (knative-server), Docs (ADR/spec), Tests
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, signed-off: yes
CI status: all required checks passing; proto failing on a known unrelated flake (vmpool timeout)
Sixteen ADRs still said Proposed although their decisions are in code on main. Each status line now names the merged PRs that implemented it and the date the core landed (format of ADR-0042), and notes what is still owed where only part is built: - 0028 (rossoctl#170, rossoctl#201, rossoctl#340; its KEDA transport removed by ADR-0041) - 0029 (rossoctl#171), 0030 (rossoctl#214), 0031 (rossoctl#214, rossoctl#225) - 0032 (rossoctl#249, rossoctl#350, as amended by MI1) - 0035 (rossoctl#251; ADR-0048 adds lease mode beside it) - 0036 (rossoctl#347), 0038 (rossoctl#458), 0039 (rossoctl#467), 0040 (rossoctl#481) - 0043 (rossoctl#560, rossoctl#588, rossoctl#600, rossoctl#615), 0044 (rossoctl#563), 0045 (rossoctl#620) - 0046 (phase 1: rossoctl#630, rossoctl#641, rossoctl#646; phase 2 owed) - 0047 (M1 and M3: rossoctl#704, rossoctl#713, rossoctl#717, rossoctl#765; M2 owed) - 0048 (rossoctl#706, rossoctl#763, rossoctl#802, rossoctl#808, rossoctl#814; off by default until the security review's lease sections are signed off) The README index follows, and its 0033 row, which still said Proposed after rossoctl#249 accepted the ADR, is corrected. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
Problem
POST /runsaccepts aworkloadId, but prompt runs currently use it only to verify that the workload exists. They discard the workload's sandbox selector and run in the default pool. As a result, a prompt cannot see the PVC mounted in the sandbox created for that workload.Change
Resolve
workloadIdto its sandbox selector for prompt runs, matching the behavior of other run types. The common resolver covers both synchronous and queued execution; callers continue to provide only the workload ID, never a raw Kubernetes selector. The ADR and control-plane design now describe that contract.Validation
git diff --checkpassCloses #237