Skip to content

feat(control-plane,sbx,mocactl): place template workers by host memory - #776

Merged
webchang merged 17 commits into
rossoctl:mainfrom
webchang:pr/i21-memory-placement
Nov 14, 2026
Merged

webchang merged 17 commits into
rossoctl:mainfrom
webchang:pr/i21-memory-placement

Conversation

@webchang

@webchang webchang commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #744. On main (ec0f840): #775 (activation leases and placement), which this branch stacked on, is merged. Its own change is 4 commits (review range b35b8c77..82ea4597), plus merges of main.

What it does: template workers are placed by host memory instead of a fixed active limit. Four signed-off commits:

  1. The host agent:
    • the inventory reports memory: meminfo, PSI full avg10, the floor, the running workers, and vmCommittedMib, read from the slice's memory.stat (anon + shmem + kernel, never memory.current);
    • a build whose memory file isn't guest_ram_mb × 1 MiB is refused;
    • new settings SBX_MEM_FLOOR_MIB and SBX_MEM_PRESSURE_LIMIT.
  2. The control plane:
    • placement by memory, where headroom = min(total − floor − used, available − floor − pending), with stale-report and pressure brakes. It never evicts, and it prefers the host already running the worker;
    • readinessReason, no_active_slot {reason: memory} and template_unavailable {reason: memfile_mismatch}.
  3. mocactl: sbx hosts. show names the reason, and activate --wait says when it is waiting for memory.
  4. The docs:
    • the lifecycle spec's §6.2 "Memory", with a note for lease mode: set the floor at or above lease mode's reclaim target;
    • the RUNBOOK and configuration.md;
    • openapi 1.12.0, and the CHANGELOG.

Notes for review:

Tests on the tip:

  • typecheck passes, and so does the control-plane suite;
  • mocactl passes, run serially;
  • host-agent, setup, overlay and status pass on bash 5 and 3.2;
  • shellcheck adds no findings, and prettier passes.

16 files, +1,502 / -89, counted over the review range.

Assisted-By: Claude Code

Each attached template worker maps and locks its snapshot's whole memory
file at start, so the cost of a host is mostly its attached workers times
their guest size, and the host agent reported nothing about memory.

Every inventory (the build poll's and each --wanted-only run's) now
carries an optional `memory` object:

- memTotalMib and memAvailableMib from /proc/meminfo, and memFloorMib,
  the effective floor (SBX_MEM_FLOOR_MIB, else 10% of MemTotal, at least
  4096). Without MemTotal and MemAvailable no figures are sent (an error
  line), and the control plane places the host by its active limit alone;
- memPressureFull10, memory PSI `full avg10` (left out with no
  /proc/pressure, which is no brake; the summary says "psi":"absent"),
  and memPressureLimit (SBX_MEM_PRESSURE_LIMIT, default 10);
- runningWorkers, the held builds' workers whose sbx-worker unit is
  active, and vmCommittedMib per running worker: its slice's memory.stat
  anon + shmem + kernel (kernel_stack + pagetables + slab without the
  kernel line), never memory.current, which also counts the page cache
  its VMs' files fill. A slice that cannot be read, or has no anon line,
  is left out and named in the summary (sliceUnread);
- memfileMismatch, the held builds whose memory file is not exactly
  guest_ram_mb x 1 MiB (or is missing): an error line each, a summary
  count, and the agent refuses to start them (reported `refused`)
  whatever the control plane asks.

Both settings are validated with the agent's others (exit 2 before any
call) and live in host-agent.env. SBX_SYS_ROOT is the test seam for
/proc and /sys/fs/cgroup.

Refs rossoctl#744

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
…fixed active limit

place() gains a memory test on hosts whose agent reports memory figures;
an inventory without them is placed by activeLimit alone, as before:

- a build costs its guest RAM (the registered spec's guest_mb, else the
  create's guest_mb or guest_ram_mb, else 4096) plus 128 MiB for the
  worker and its VMM;
- used = the cost of the host's running workers (the agent's
  runningWorkers, any build's, wanted or draining) + their VMs'
  vmCommittedMib + the builds placed there in this pass and not started;
  headroom = min(total - floor - used, available - floor - pending); a
  build fits if cost <= headroom and the host is under activeLimit; a
  host already running the build's worker keeps it (nothing is evicted)
  and is preferred;
- no new start on a host whose inventory is over 60 s old or whose PSI
  full avg10 is above its limit; a build in a host's memfileMismatch is
  never placed there.

Placement's unplaced reasons gain `memory` and `memfile_mismatch`. A
409 no_active_slot for memory carries reason: memory (Retry-After as
before; at the active limit it answers as before, with no reason); every
holder reporting a wrong memory file is 409 template_unavailable with
reason: memfile_mismatch; template_not_active with readiness unavailable
carries the reason. Templates and builds gain readinessReason, present
only with readiness unavailable, and GET /v1/templates' hosts gain
`memory` (the figures, the effective floor, used, headroom, the brake).
The inventory route parses `memory` field by field (parseHostMemory),
dropping what is malformed. The check runs under the activation lock, so
two activations cannot see the same headroom.

openapi 1.8.0 (ReadinessReason, the inventory's memory, the hosts
block's memory, the refusals' reason) with a CHANGELOG entry.

Refs rossoctl#744

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
The client part of placement by host memory:

- `mocactl sbx hosts [--json]` prints each KVM host from GET
  /v1/templates' hosts block: its active slots, its memory headroom, total
  and effective floor with a brake and any memory-file mismatches (from
  an agent that reports memory), and its disk; "no host has reported
  yet" when the block is empty. It takes no argument.
- `templates show` names a build's readinessReason beside `unavailable`
  (`unavailable (memory)`), on the template and on each build.
- `templates activate --wait` says when it waits for memory: a 409
  no_active_slot with reason: memory, and a build unavailable for memory,
  each read as "no host holding it has the memory for its worker now";
  the other reasons have their own words.

Refs rossoctl#744

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
…K and the configuration

- The template lifecycle spec's §6.2 gains the memory rule: why a fixed
  active limit is not enough (an attached worker locks its guest's whole
  memory file), the inventory's memory, a build's cost and the
  memory-file check, what vmCommittedMib counts (memory.stat, never the
  page cache), the headroom, the brakes, the settings, what a client
  sees, compatibility both ways, and the limits, with how the floor
  relates to the sandbox lease mode's reclaim; §6.3's refusals name the
  memory reasons.
- The RUNBOOK's host agent section lists SBX_MEM_FLOOR_MIB and
  SBX_MEM_PRESSURE_LIMIT in host-agent.env, the summary's memory notes,
  SBX_ACTIVE_LIMIT as an upper bound, and a "Memory-aware placement"
  part: what the agent reports, the settings, the cost and headroom, the
  brakes, the memory-file check, what a client sees (with `mocactl sbx
  hosts`), lease mode, and version skew; keep /srv/sbx off tmpfs.
- docs/reference/configuration.md gains the two settings' rows.

Refs rossoctl#744

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 12, 2026

@clawgenti clawgenti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR is stacked on #775, and the review covers only its own four commits (refs/prr/775...refs/prr/776): the host agent's memory inventory and memfile check, memory-aware place(), readinessReason and the new refusal reasons, mocactl sbx hosts, and the docs and openapi 1.8.0. I read the headroom arithmetic, the pending accounting, the brakes, the memfile-mismatch path on both the agent side and the control-plane side, and the version-skew handling against the spec, RUNBOOK, CHANGELOG and openapi text, and they match. I found no correctness defect. The one gap is a missing test: the PR claims that placement prefers a host already running the build's worker, and no test pins that sort key. Also, the PR body has no ## Summary heading.

Author: webchang (MEMBER — maintainer)
Areas reviewed: commit conventions/DCO, PR format, control-plane placement (activation.ts), host inventory parsing (host-handlers.ts), sandbox-handlers refusals and readinessReason, host-agent.sh shell, mocactl sbx hosts/activate, tests, openapi/CHANGELOG/RUNBOOK/spec/configuration docs, agent-config supply-chain gate
Agent/IDE config (.claude/.vscode): none
Commits: 4 commits, all signed-off: yes
CI status: passing (all 17 checks green, including deploy-scripts, deploy-scripts-bash32, shellcheck, k8s-kind-e2e)

0 must-fix, 1 suggestion, 1 nit.

Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).

.filter(fits)
.sort(
(a, b) =>
Number(isRunning(b)) - Number(isRunning(a)) ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The PR body and the docblock above place() both say that a memory-reporting host already running the build's worker "comes first". This line, Number(isRunning(b)) - Number(isRunning(a)), is what implements that, but none of the new tests in test/activation.test.ts covers it. The stale and pressure tests use a single host, so they show that a running worker is kept, not that its host wins the sort. If this key were dropped or reversed, the build would move to the host with fewer builds or the lower id. The old host's worker would then be stopped and a new one pinned elsewhere (a full guest's RAM), and no test would fail. Suggested test: two holders h1 and h2, with the worker running on h2 and h1 having fewer placed builds and the lower id. Assert placed.get(build) === 'h2', and that h2's usedMib does not count the build twice.

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The range adds a memory object to the host agent's inventory (meminfo, PSI full avg10, effective floor, running workers, per-slice anon+shmem+kernel, memfile-size mismatches), a memory test in place() (headroom = min(total - floor - used, available - floor - pending), stale and pressure brakes, prefer the host already running the worker), readinessReason / reason fields on the 409s, mocactl sbx hosts, and docs and openapi 1.8.0. Units are consistent (kB/1024, bytes/1048576, MiB everywhere), host-reported numbers are checked field by field, the agent-side memfile refusal backs up the control plane, and the docs match the code. I found no must-fix issue. The one real gap is that the MemAvailable bound stops counting a worker's cost as soon as its unit is active, which can be before its pinned memfile shows in MemAvailable.

Author: webchang (MEMBER — maintainer)
Areas reviewed: TypeScript, Shell, Docs/OpenAPI
Agent/IDE config (.claude/.vscode): none
Commits: all signed-off: yes
CI status: check (Test step) FAILED at this head; it was green at 82ea459. Job logs are unreadable from the reviewer sandbox, so the cause is unverified. Re-run it before merge

Inline: 0 must-fix, 1 suggestion, 0 nit. The head 689e7f6 is a merge-only cascade of #757 up the stack (empty remerge-diff, no new non-merge commits); the review covers this PR's own range b35b8c77..82ea4597, as the body asks.

AI-assisted review, approved by a maintainer before posting.

const u = memUse.get(h.id)!;
return Math.min(
m.totalMib! - m.floorMib! - u.usedMib,
m.availableMib! - m.floorMib! - u.pendingMib,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The MemAvailable bound subtracts only pendingMib, meaning builds placed this pass whose worker is not in runningWorkers. A worker counts as running as soon as systemctl is-active says so (Type=simple), but at that moment it may still be in VerifyWith / PinMemoryFile, reading and mlocking a multi-GiB memfile, and booting its standby VMs. The agent sends its inventory at the start of each run, before activation(). So the first inventory after a start can list the worker as running while MemAvailable does not yet show its pinned file: mlocked pages leave the file LRU and MemAvailable only once they are faulted in. At that point the build has left pending and its cost is not in available either, so this bound overstates headroom by up to the full cost (guest RAM + 128) for one or more 15 s cycles. Only total - floor - used still holds, and that bound does not see other workloads' memory, which is the whole point of the available term. Several starts on one host in a row can therefore go below the floor on a host shared with other work. Suggestion: keep a newly started worker's cost on the available side until its pin is visible. For example, the agent could report each running unit's ActiveEnterTimestampMonotonic (or a pinned flag the worker writes), and place() could count a worker started within N seconds of the inventory as pending. A simpler option is to subtract max(0, cost - (MemAvailable drop since the start)), but that needs a baseline. Please also add a test for the window where the worker is 'running but not yet pinned'.

@clawgenti clawgenti left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Re-review of the push since my last review (82ea459..689e7f6, review 5883320293). This PR's own commits are unchanged: git range-diff shows every earlier commit as equal. The push only merges the parent branches again ("Merge pr/i19-activation into pr/i21-memory-placement", and the merges below it), and so brings in #757's five new fixes (381d7c4 too-large command closes its connection, b1beba6 lease keeps its VM on that refusal, ace1c43 build-snapshot.sh no writes through a symlink, ab347c1 install-host.sh removes the old jail path, 5181204 http-api doc). Those belong to #757 and are reviewed there. I checked the two conflicted merges on the way down (3ee0acf upstream/main into i10, d4445a2 i10 into i17) against their recorded resolutions. errors.go, guestconn.go, build-snapshot.sh, microvm-worker main.go and snapshot_test.go keep both sides, as the commit messages say, and main.go's single LoadManifest now feeds both ManifestFeatures and VerifyWith. No new findings. The earlier 1 suggestion, 1 nit still apply: none of the files they cite changed in this push.

Author: webchang (MEMBER — maintainer)
Areas reviewed: range-diff of this PR's own commits, the incoming #757 commits (scope only), the conflict resolutions in the two upstream merges, commits/DCO, CI, agent-config gate
Agent/IDE config (.claude/.vscode): none
Commits: 50 commits, all signed-off: yes
CI status: 16 of 17 checks pass, 1 pending

0 new must-fix, 0 new suggestions, 0 new nits.

Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).

Brings in the parent's reviewed fixes (sticky placement, running
workers counted against activeLimit, silent hosts left out of
placement, imported templates never host-managed, Retry-After from
placed builds, refusal dedupe, host-agent.sh's running flags and
stops before starts). Both sides' rules now hold in place().

Conflicts and resolutions:

- packages/control-plane/src/activation.ts: HostView keeps at,
  memory (this branch) and running (the parent). Placement returns
  both used (the activeLimit counts) and memory. place() starts each
  host's count from the workers that stay running, takes busy, skips
  holders reporting the build's memfile wrong, then keeps a build on
  a holder already running it (sticky: past its limit, its brake and
  its headroom, as both sides say a running worker is never evicted);
  any other build needs a holder under its limit with memory for it.
  "Running" is the union of the held builds marked running and the
  inventory's runningWorkers. A worker running only by an attached
  report newer than the inventory is counted in pending too, since
  that inventory's MemAvailable cannot show it yet. The parent's
  sticky rule replaces this branch's "prefer the running host" sort
  key; a memfile mismatch overrides stickiness.
- packages/control-plane/src/host-handlers.ts: HOST_STALE_S and
  freshHosts kept; hostViewsOf passes at, running and memory; the
  inventory stores running, refused and memory; hostWanted stops a
  copy this host runs (by either report) while placement keeps it
  elsewhere.
- packages/control-plane/src/sandbox-handlers.ts: both imports; the
  hosts block lists fresh hosts with placement's used and the memory
  object; activation keeps the displaced build's reason, the
  memfile_mismatch refusal, and the parent's Retry-After from the
  holders' placed builds, now for no_slot and memory alike.
- packages/control-plane/test/activation.test.ts: inventory() takes
  running then memory; the memory tests pass [] for running. A new
  test pins sticky placement with the memory rule.
- deploy/sbx/host-agent.sh: memory_report kept; inventory() sends the
  per-build running flags and the memory object.
- docs/api/openapi.yaml: both texts in the hosts block, activate,
  inventory and wanted descriptions; the version stays 1.8.0.
- docs/reference/configuration.md, deploy/sbx/RUNBOOK.md, the
  template lifecycle spec: both texts; the spec's memory rule now
  says a running build stays (sticky) instead of being preferred.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
After about 60 s without an inventory the memory brake already stops
new starts on a host that reports its memory, keeping what it runs; at
360 s the host leaves placement entirely. Each constant now says so.

Refs rossoctl#744

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
…ng its worker

Two holders: h1 sorts first and has fewer builds; the worker runs on
h2. The build stays on h2, and h2 counts it once (running, not
pending) beside the build placed there in the same pass.

Refs rossoctl#744

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@webchang

Copy link
Copy Markdown
Member Author

Merged #775's reviewed head into this branch:

  • a running build stays on its host, which replaces the "prefer the running host" sort;
  • a host reporting a wrong memory file is never chosen, and its copy is stopped once no sandbox is live;
  • a worker known to be running only from an attached report counts as pending memory until the next inventory.

1. packages/control-plane/src/activation.ts:183 (MemAvailable bound for a just-started worker)

Thanks, agreed that this is a real window. Part of it is closed in this push. The merge of the
parent branch brings in the host's attached report, which marks a build running as soon as its
unit starts, before the next inventory. A worker that is running only by that report, and not in
the inventory's runningWorkers, now has its cost counted in pending too, because the
inventory's MemAvailable cannot show it yet. So until the next inventory both bounds count it. A
test covers this case: a host whose MemAvailable leaves room for one more build refuses a second
start beside a worker that an attached report says has just started.

The rest of the window is still open: a worker that the inventory does list as running but whose
memfile pin is not yet visible in MemAvailable. Closing it needs a start time or a "pinned" signal
from the host, plus a grace period chosen from measured pin times. That is a change to the
inventory contract, so I would rather propose it as a separate follow-up than add it to this approved range. Until
then, the total − floor − used bound still counts the full cost of every running worker.

2. packages/control-plane/src/activation.ts:211 (no test for "the running host comes first")

Thanks. With the parent's fixes merged, the sort key is gone: placement is now sticky, so a build
already running on a holder stays on that holder, whatever its count, limit, brake or headroom. The
one exception is a holder that reports the build's memory file wrong. The test you suggested is
added: two holders, h1 sorting first by id with fewer builds, the worker running on h2. It asserts
that the build stays on h2 and that h2 counts the build once (running, not pending). A second test
covers stickiness with both "running" reports (the per-build flag and runningWorkers) and the
memfile-mismatch exception.

3. PR body (nit: no ## Summary heading)

Thanks. The body now has a ## Summary heading.

Tip: 9748bc0

Assisted-By: Claude Code

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of 689e7f6..9748bc0 (prior: APPROVE at 689e7f6).

  • Own commits: 4e87f0d (memoryStaleS / HOST_STALE_S two-step doc, values match the code) and 9748bc0 (sticky test: build stays on h2, counted once as running, not pending) look good.
  • Merge d7823e1 (pr/i19-activation): I checked the 9 conflict resolutions with --remerge-diff. place() takes the union of running and runningWorkers. Stickiness wins over count/limit/brake/headroom, except on a memfile-mismatch holder. Attached-only workers count as pending. hostWanted stops the copy that runs here by either report. hostsBlock and hostViewsOf use fresh hosts with memory. takeLeaseLocked keeps busy and the memfile_mismatch 409. Neither side was lost.
  • Prior suggestion (activation.ts:183): the attached-report half is fixed and tested (activation.test.ts:1113-1123). Deferring the running-but-not-yet-pinned window to a follow-up is fine, since total − floor − used still bounds it. Please link the follow-up issue here.
  • Prior nit: ## Summary is added.

CI: the red deploy-scripts comes from #766, not this PR. Every branch stacked on #766 has failed "Run deploy shell tests" since a187e99, and main is green. The cause is deploy/sbx/template-onboarding/tests/examples.test.sh:22: jq parses A and B as $g | … as (A and B) as $g | …, so $g is bound to a boolean and every sample spec fails the check. Parenthesising the right side of the and fixes it (reproduced with jq 1.8.2). It is already raised as a must-fix on #766: #766 (comment). Please don't merge this PR until that fix has cascaded up the stack and deploy-scripts is green here.

Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).

Brings rossoctl#766's quota changes (the templates quota for a template holding
no slot, and the owned quota) through pr/i19-activation.

Conflicts: none.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
pr/i19-activation now carries upstream/main: this brings upstream's sbx
templates create, build, follow, cancel, quota and policy beside this
branch's sbx hosts and its unavailable-reason readiness.

Conflicts and resolutions:

- packages/mocactl/src/sbx/api.ts: both sides' types kept (SbxHost; the
  create, quota and policy types).
- packages/mocactl/src/sbx/cli.ts: the import list holds both sides' commands.
- packages/mocactl/src/sbx/templates.ts: both sides' imports (with
  SbxReadinessReason); the module comment covers both; cmdHosts kept beside
  the follow, cancel and create commands.
- packages/mocactl/test/sbx-templates.test.ts: the header comment covers both;
  both sides' describe blocks kept.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@webchang

Copy link
Copy Markdown
Member Author

Merged main (d4babb8). CI is the full check: local tests ran on the existing node_modules during the hono pin's release-age window.

Assisted-By: Claude Code

Brings in upstream main (lease modes, API 1.6.0) through pr/i19-activation.

Conflicts:
- docs/api/CHANGELOG.md: this branch's memory placement section, renumbered 1.9.0, above
  pr/i19-activation's 1.8.0, pr/i18-host-agent's 1.7.0 and main's 1.6.0.

API version: this branch's memory placement moves from 1.8.0 to 1.9.0: openapi info.version and
its "(1.8.0)" field notes, the changelog, and the "openapi 1.8.0" mentions in deploy/sbx/RUNBOOK.md
and deploy/sbx/host-agent.sh.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
Brings in upstream main through f60db30 (turn grants, API 1.7.0) by pr/i19-activation.

Conflicts:
- docs/api/CHANGELOG.md: this branch's memory placement section, renumbered 1.10.0, above
  pr/i19-activation's 1.9.0, pr/i18-host-agent's 1.8.0 and main's 1.7.0 and 1.6.0.

API version: this branch's memory placement moves from 1.9.0 to 1.10.0: openapi info.version and
its field notes, the changelog, and the "openapi 1.9.0" mentions in deploy/sbx/RUNBOOK.md and
deploy/sbx/host-agent.sh.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
webchang added a commit to webchang/moca that referenced this pull request Nov 13, 2026
…ps a running build on its host

`used` counted only the builds one placement pass placed, but the hosts run more workers than
that: an earlier lease ending could move a running build to another host (two copies of one worker
id), and a worker still draining a live sandbox took a host slot nobody counted.

- Each `holds` entry of an inventory may carry `running` (the build's worker unit runs); between
  inventories the host's attached, detached and refused reports keep it current.
- Placement is sticky: a wanted build already running on a holder stays on that host (the first
  by id if more than one runs it). Each host's count starts with the workers that stay running on
  it before anything else is placed: the wanted builds it runs and the unleased ones whose worker
  has a live sandbox (draining). `active.used` in the hosts block shows that count.
- When a host runs a leased build that placement keeps on another host, its wanted state lists
  that build in `stop` (never under a live sandbox), so one worker id does not stay on two hosts.
- With the memory rule, "running" is the union of the held builds marked running and the memory
  report's runningWorkers, and a worker started since the inventory (by an attached report) is
  counted as pending too, since the host's MemAvailable cannot show it yet (the upstream memory
  branch's merge of these fixes). activation.ts takes the upstream text, whose comments no longer
  name internal register ids.

The API changelog says so. The activation tests' host ids are neutral names, and their inventory
helper takes the builds a host marks running.

Tests (fail with the fix reverted): keeps a running build on its host: an earlier lease ending
moves nothing; counts a draining worker against its host's activeLimit until its last sandbox ends;
stops a host's copy of a leased build that another host runs and is placed on; sticky placement and
the memory rule together: running is the union of both reports. Also: keeps a build on the
memory-reporting host already running its worker, counting it once.

(cherry picked from commit c1872f7)
(cherry picked from commit 9748bc0)
(cherry picked from commit d7823e1)

Ports rossoctl#775 and rossoctl#776 review fixes

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
Brings in upstream main through ab8d10e (template tags, edits and owner transfer at API 1.8.0,
setup.sh's Redis image guard), the host agent at 1.9.0 and activation at 1.10.0, by
pr/i19-activation.

Conflicts:
- docs/api/CHANGELOG.md: this branch's memory placement section, renumbered 1.11.0, above
  activation's 1.10.0, the host agent's 1.9.0 and main's 1.8.0, 1.7.0 and 1.6.0.
- docs/reference/change-policy.md: version 1.11.0; main's list, then the template host agents,
  activation leases, and memory-aware placement.
- docs/specs/2026-11-03-template-lifecycle-and-provenance-design.md: the status line names
  §5.1-§5.2 and this branch's placement by host memory.
- packages/control-plane/src/sandbox-handlers.ts: main's provenance, identity and sandbox-config
  imports, with this branch's readinessReasonOf from activation.ts.
- packages/mocactl/src/sbx/api.ts: main's SbxTagsMoved and this branch's SbxHost.

API version: this branch's memory placement moves from 1.10.0 to 1.11.0 (openapi info.version
and its four "1.10.0" field notes, the changelog, change-policy, and the "openapi 1.10.0" mentions
in deploy/sbx/RUNBOOK.md and deploy/sbx/host-agent.sh).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
Brings in upstream main through 01528b6 (subject trust for gate records at API 1.9.0), the host
agent at 1.10.0 and activation at 1.11.0, by pr/i19-activation.

Conflicts:
- docs/api/CHANGELOG.md: this branch's memory placement section, renumbered 1.12.0, above
  activation's 1.11.0, the host agent's 1.10.0 and main's 1.9.0 and below.
- docs/reference/change-policy.md: version 1.12.0; main's list (through subject trust for gate
  records), then the template host agents, activation leases and memory-aware placement.

API version: this branch's memory placement moves from 1.11.0 to 1.12.0 (openapi info.version
and its four field notes, the changelog, change-policy, and the "openapi 1.11.0" mentions in
deploy/sbx/RUNBOOK.md and deploy/sbx/host-agent.sh).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
Brings in upstream main through ec0f840, whose tree is pr/i19-activation's, already merged here
(its merges of pr/i18-host-agent and pr/i19-activation). No conflicts and no file changes.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@webchang
webchang merged commit 3efcf9a into rossoctl:main Nov 14, 2026
18 checks passed
webchang added a commit to webchang/moca that referenced this pull request Nov 14, 2026
Brings pr/i26-retire at upstream main d227d41 (through rossoctl#790, with rossoctl#789's
combined plane and pinned-session holds, rossoctl#791/rossoctl#792 egress, rossoctl#784 pacing,
rossoctl#776 memory placement and rossoctl#808), and i26's retire at API 1.18.0. This
branch's quotas and reject section moves to 1.19.0.

Conflicts:
- docs/api/CHANGELOG.md: ## 1.19.0 quotas and reject above i26's
  ## 1.18.0 and main's sections, which are unchanged.
- docs/api/openapi.yaml: info.version 1.19.0. The wanted-state
  description is main's (memory, idle grace, pinned-session hold, start
  order) with this branch's admin-rejected builds in `stop`.
- docs/reference/change-policy.md: main's list, then "template retire",
  then "admin quotas and build reject"; control plane 1.19.0, harness
  1.3.0.
- docs/reference/http-api.md: main's rows (egress records, Retire at
  1.18.0), then the Admin row at 1.19.0.
- docs/specs/2026-11-03-template-lifecycle-and-provenance-design.md:
  the status line names both main's §6.2/§6.5 parts and this branch's
  quotas and reject.
- packages/control-plane/src/activation.ts: main's buildOfWorker and
  running-worker maps, with endedWithWorker (retired or admin-rejected)
  where main tests for a retired build with a worker.
- packages/control-plane/src/host-handlers.ts: main's file (wantedAnswer,
  egress, start limit, grace), with this branch's rejectedByAdmin in the
  wanted state's ended branch, liveSnapshots skipping rejected builds,
  and `detached` taken for an admin-rejected build.
- packages/control-plane/src/sandbox-handlers.ts: activationLock is
  main's import from activation-lock.ts (its local copy dropped, so no
  duplicate); this branch's templateUseLock stays. Imports carry both
  rejectedByAdmin and main's readinessReasonOf, startQueue,
  startRetryAfterS; identity.js is imported once.
- packages/control-plane/test/activation.test.ts: both new placement
  cases.
- packages/control-plane/test/openapi-contract.test.ts: 31 enrollable
  routes (28 + this branch's 2 + main's 1).
- packages/mocactl/src/sbx/api.ts, commands.ts, cli.ts: both sides'
  types, imports, usage, flags and dispatch (quota and --stop-now).
- packages/mocactl/test/contract.test.ts: 28 replies (25 + 1 + 2), with
  main's reply shape.

Also: activation-lock.ts's comment says, as this branch's code does,
that a reject takes the activation lock and a sandbox create takes only
its template's use lock; http-api.md's "admin routes came with API
1.19.0"; the reject test reads main's wanted answer (starting,
egressSids).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
webchang added a commit to webchang/moca that referenced this pull request Nov 14, 2026
Brings pr/i26-retire at upstream main d227d41 (through rossoctl#790, with rossoctl#789's
combined plane and pinned-session holds, rossoctl#791/rossoctl#792 egress, rossoctl#784 pacing,
rossoctl#776 memory placement and rossoctl#808), and i26's retire at API 1.18.0. This
branch's removal section moves to 1.19.0.

Conflicts:
- docs/api/CHANGELOG.md: ## 1.19.0 removal above i26's ## 1.18.0 and
  main's sections, which are unchanged. The `remove` bullet names a
  pinned session's hold beside a live sandbox.
- docs/api/openapi.yaml: info.version 1.19.0. The wanted-state
  description is main's (memory, idle grace, pinned-session hold, start
  order), with "in no list", `remove` (since 1.19.0; not under a live
  sandbox or a session's hold) and the shared-build rule; the response
  keeps main's `starting`, `graced` and `egressSids` and adds `remove`.
- docs/reference/change-policy.md: main's list, then "template retire",
  then "retired build removal"; control plane 1.19.0, harness 1.3.0.
- packages/control-plane/src/host-handlers.ts: main moved the wanted
  state into wantedAnswer; `remove` is built there, in the retired
  branch, under main's busyWorkers (a live sandbox or a pinned session's
  hold), and returned beside main's run, stop, starting and graced;
  hostWanted adds egressSids as main does. hostWorkerReport takes
  `removed` on main's version of it (st.running and refused kept); the
  host's holds drop the build on st. The header, liveSnapshots and
  T.unique texts are this branch's.
- packages/control-plane/test/activation.test.ts: the wanted answers
  carry both `remove` and main's `starting`/`egressSids`.
- packages/mocactl/src/sbx/cli.ts: main's usage (sbx hosts, create
  --mode/--idle-timeout) with this branch's retire --wait text.
- deploy/sbx/host-agent.sh: main's header and run loop (run.tsv, start
  limit, grace), then this branch's removal() before the lock is let go;
  REMOVED beside main's counters; summary keeps "removed" before
  "errors" and main's egress, memory, start and grace fields after it.
- deploy/sbx/tests/host-agent.test.sh: both mocks (install-host,
  journalctl) and both settings; main's sections 13-26, then this
  branch's removal section as 27, on a clean srv with well-formed
  snapshots (snapfiles), so main's memory report raises no error.
- deploy/sbx/RUNBOOK.md: main's summary text with "removed".
- docs/specs/2026-11-03-template-lifecycle-and-provenance-design.md:
  main's records table with this branch's `event: removed`; step 7 names
  a pinned session's hold.

Also moved to 1.19.0: http-api.md's "Since API 1.19.0" and
host-agent.sh's "older than API 1.19.0" comment. activation.test.ts's
live-sandbox removal case reads the answer with toMatchObject: the
wanted state now also carries egressSids, which list the sandbox.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
webchang added a commit to webchang/moca that referenced this pull request Nov 16, 2026
…te lifecycle stack

Upstream main 0dc3d01 (API 1.21.0) carries the reviewed, final form of
the features this branch held in early, integrated versions, through the
PRs filed from this fork (rossoctl#755-rossoctl#776, rossoctl#781, rossoctl#782, rossoctl#784-rossoctl#786, rossoctl#789-rossoctl#794,
rossoctl#798-rossoctl#800) and the maintainer's lease mode, grants and lease clients
(rossoctl#763, rossoctl#802, rossoctl#807, rossoctl#808, rossoctl#810, rossoctl#812, rossoctl#814). Where upstream has a feature,
upstream's version wins: its code, tests, openapi, CHANGELOG (byte
identical), docs and specs.

The fork was 736 commits behind and 390 ahead (merge base dd0ce71).

Conflict resolution (148 files, 82 both-modified, 66 both-added): every
conflicted file is upstream's side as is (byte identical to 0dc3d01).
No conflicted file differs from 0dc3d01 in this commit.

One file merged without a conflict and was set back to upstream's:
- packages/mocactl/src/sbx/push.ts: the auto-merge added the fork's
  baselineAtHead a second time beside upstream's own (fb28e06's
  function, already upstream); upstream's file as is.

With that, this commit's tree is 0dc3d01's plus the 18 files only the
fork has (below). Every other file the fork changed is upstream's.

Conflicted files, all resolved to upstream's side (0dc3d01):
- deploy/k8s/overlays/ocp-combined/kustomization.yaml (AA)
- deploy/k8s/overlays/ocp-combined/patch-addressing.yaml (AA)
- deploy/k8s/overlays/ocp-combined/patch-relay.yaml (AA)
- deploy/microvm/P4-ON-P6.md (UU)
- deploy/microvm/build-rootfs.sh (UU)
- deploy/microvm/build-snapshot.sh (UU)
- deploy/microvm/setup-microvm.sh (UU)
- deploy/microvm/tests/build-rootfs.test.sh (UU)
- deploy/microvm/tests/build-snapshot.test.sh (UU)
- deploy/microvm/tests/setup-microvm.test.sh (UU)
- deploy/sbx/README.md (UU)
- deploy/sbx/RUNBOOK.md (UU)
- deploy/sbx/host-agent.sh (AA)
- deploy/sbx/install-host.sh (UU)
- deploy/sbx/sbx-host-agent-wanted.service (AA)
- deploy/sbx/sbx-host-agent-wanted.timer (AA)
- deploy/sbx/sbx-host-agent.service (AA)
- deploy/sbx/[email protected] (UU)
- deploy/sbx/setup.sh (UU)
- deploy/sbx/template-onboarding/GUIDE.md (AA)
- deploy/sbx/template-onboarding/ONBOARDING.md (AA)
- deploy/sbx/template-onboarding/README.md (AA)
- deploy/sbx/template-onboarding/examples/django__django-11133.gate-record.json (AA)
- deploy/sbx/template-onboarding/examples/django__django-11133.json (AA)
- deploy/sbx/template-onboarding/governance/GATING-RULES.md (AA)
- deploy/sbx/template-onboarding/governance/PROCESS.md (AA)
- deploy/sbx/template-onboarding/governance/README.md (AA)
- deploy/sbx/template-onboarding/template-build.sh (AA)
- deploy/sbx/template-onboarding/template-register.sh (AA)
- deploy/sbx/template-onboarding/tests/examples.test.sh (AA)
- deploy/sbx/template-onboarding/tests/template-build.test.sh (AA)
- deploy/sbx/template-onboarding/tests/template-register.test.sh (AA)
- deploy/sbx/template-onboarding/verify-provenance.py (AA)
- deploy/sbx/templates-check.sh (AA)
- deploy/sbx/tests/host-agent.test.sh (AA)
- deploy/sbx/tests/install-host.test.sh (UU)
- deploy/sbx/tests/overlay-combined.test.sh (AA)
- deploy/sbx/tests/setup.test.sh (UU)
- deploy/sbx/tests/templates-check.test.sh (AA)
- deploy/vm/tests/setup-vm.test.sh (UU)
- docs/api/CHANGELOG.md (UU)
- docs/api/harness-openapi.yaml (UU)
- docs/api/openapi.yaml (UU)
- docs/concepts/sandboxes-and-tiers.md (UU)
- docs/reference/change-policy.md (UU)
- docs/reference/cli-mocactl.md (UU)
- docs/reference/configuration.md (UU)
- docs/reference/http-api.md (UU)
- docs/sbx/user-guide.md (UU)
- docs/specs/2026-10-15-sbx0-internal-sandbox-service-design.md (UU)
- docs/specs/2026-10-30-session-sandbox-templates-design.md (AA)
- docs/specs/2026-11-03-template-lifecycle-and-provenance-design.md (AA)
- docs/specs/2026-11-05-combined-control-plane-design.md (AA)
- docs/specs/2026-11-08-enrollment-and-roles-api-design.md (AA)
- docs/specs/2026-11-08-sandbox-egress-records-design.md (AA)
- docs/specs/2026-11-08-subject-trust-gate-records-design.md (AA)
- docs/specs/README.md (UU)
- harness/src/run-turn.ts (UU)
- harness/src/sandbox-affinity.ts (UU)
- harness/src/select-sandbox.ts (UU)
- harness/test/select-sandbox-templates.test.ts (AA)
- harness/test/turn-seed.test.ts (AA)
- harness/test/turn-stream.test.ts (UU)
- packages/control-plane/src/activation-lock.ts (AA)
- packages/control-plane/src/activation.ts (AA)
- packages/control-plane/src/egress-handlers.ts (UU)
- packages/control-plane/src/egress-log.ts (AA)
- packages/control-plane/src/errors.ts (UU)
- packages/control-plane/src/exchange.ts (UU)
- packages/control-plane/src/handler-util.ts (UU)
- packages/control-plane/src/handlers.ts (UU)
- packages/control-plane/src/host-handlers.ts (AA)
- packages/control-plane/src/identity.ts (UU)
- packages/control-plane/src/index.ts (UU)
- packages/control-plane/src/main.ts (UU)
- packages/control-plane/src/member-handlers.ts (AA)
- packages/control-plane/src/members.ts (AA)
- packages/control-plane/src/ownership.ts (UU)
- packages/control-plane/src/provenance.ts (AA)
- packages/control-plane/src/routes.ts (UU)
- packages/control-plane/src/sandbox-config.ts (UU)
- packages/control-plane/src/sandbox-handlers.ts (UU)
- packages/control-plane/src/server.ts (UU)
- packages/control-plane/src/template-catalog.ts (AA)
- packages/control-plane/src/template-policy.ts (AA)
- packages/control-plane/src/token.ts (UU)
- packages/control-plane/test/activation.test.ts (AA)
- packages/control-plane/test/egress-redis.test.ts (AA)
- packages/control-plane/test/errors.test.ts (UU)
- packages/control-plane/test/host-flow.test.ts (AA)
- packages/control-plane/test/members.test.ts (AA)
- packages/control-plane/test/openapi-contract.test.ts (UU)
- packages/control-plane/test/provenance.test.ts (AA)
- packages/control-plane/test/repository-allowlist.test.ts (AA)
- packages/control-plane/test/route-authz-enumeration.test.ts (UU)
- packages/control-plane/test/route-profile.test.ts (UU)
- packages/control-plane/test/routes.test.ts (UU)
- packages/control-plane/test/sandbox-egress.test.ts (AA)
- packages/control-plane/test/sandbox-handlers.test.ts (UU)
- packages/control-plane/test/session-templates.test.ts (AA)
- packages/control-plane/test/subject-trust.test.ts (AA)
- packages/control-plane/test/template-admin.test.ts (AA)
- packages/control-plane/test/template-catalog.test.ts (AA)
- packages/control-plane/test/template-create.test.ts (AA)
- packages/knative-server/src/server.ts (UU)
- packages/knative-server/src/turn-auth.ts (UU)
- packages/knative-server/test/turn-auth.test.ts (UU)
- packages/mocactl/src/api/errors.ts (UU)
- packages/mocactl/src/api/frames.ts (UU)
- packages/mocactl/src/cli.ts (UU)
- packages/mocactl/src/core/session-manager.ts (UU)
- packages/mocactl/src/core/session-options.ts (UU)
- packages/mocactl/src/headless.ts (UU)
- packages/mocactl/src/sbx/api.ts (UU)
- packages/mocactl/src/sbx/call-record.ts (AA)
- packages/mocactl/src/sbx/cli.ts (UU)
- packages/mocactl/src/sbx/commands.ts (UU)
- packages/mocactl/src/sbx/dry-run.ts (AA)
- packages/mocactl/src/sbx/exec.ts (UU)
- packages/mocactl/src/sbx/run.ts (UU)
- packages/mocactl/src/sbx/templates.ts (AA)
- packages/mocactl/test/contract.test.ts (UU)
- packages/mocactl/test/harness.test.ts (UU)
- packages/mocactl/test/headless.test.ts (UU)
- packages/mocactl/test/helpers/sbx.ts (UU)
- packages/mocactl/test/run-record.test.ts (AA)
- packages/mocactl/test/sbx-admin-subjects.test.ts (AA)
- packages/mocactl/test/sbx-cli.test.ts (UU)
- packages/mocactl/test/sbx-egress.test.ts (AA)
- packages/mocactl/test/sbx-exec.test.ts (UU)
- packages/mocactl/test/sbx-templates.test.ts (AA)
- packages/mocactl/test/session-manager.test.ts (UU)
- packages/mocactl/test/session-options.test.ts (UU)
- remote-worker/cmd/microvm-worker/main.go (UU)
- remote-worker/cmd/microvm-worker/template_record.go (AA)
- remote-worker/cmd/microvm-worker/template_record_test.go (AA)
- remote-worker/cmd/microvm-worker/verify_cache.go (AA)
- remote-worker/cmd/microvm-worker/verify_cache_test.go (AA)
- remote-worker/internal/egress/audit_test.go (UU)
- remote-worker/internal/session/labels.go (UU)
- remote-worker/internal/vmpool/errors.go (UU)
- remote-worker/internal/vmpool/guestconn.go (UU)
- remote-worker/internal/vmpool/guestconn_test.go (UU)
- remote-worker/internal/vmpool/launcher_firecracker.go (UU)
- remote-worker/internal/vmpool/launcher_firecracker_egress_unix_test.go (UU)
- remote-worker/internal/vmpool/snapshot.go (UU)
- remote-worker/internal/vmpool/snapshot_test.go (UU)
- remote-worker/internal/vmpool/verifycache.go (AA)

Fork-only files, kept as they are (upstream has no such file):
- deploy/sbx/mint-login.sh, deploy/sbx/tests/mint-login.test.sh: a test
  login minted with the deployment's signing key. Checked against
  upstream: makeSigner/mint, SANDBOX_API_ISSUER, the moca-mu1 Secret and
  its label, the env keys it reads and mocactl's sbx-auth.json shape are
  all still upstream's.
- deploy/sbx/template-onboarding/deck/ (README, requirements, the two
  generators, deck_kit.py, the two PDFs, .gitignore): the fork's decks.
- deploy/sbx/template-onboarding/GUIDE.pdf: regenerated from upstream's
  GUIDE.md in a later commit.
- deploy/sbx/template-onboarding/governance/GAPS-AND-ASSUMPTIONS.md and
  INVENTORY-2026-11-02.md: the fork's register and inventory.
- docs/specs/2026-11-09-cold-start-pacing-design.md,
  2026-11-09-memory-aware-placement-design.md and
  2026-11-10-mocactl-template-commands-design.md: the fork's design
  notes; upstream folded their content into its lifecycle spec
  (§6.4 memory, §6.5 pacing) and the user guide (mocactl).
- docs/tools/gen_pdf.py, docs/tools/gen_toc.py: the PDF and TOC tools.

Fork-only behaviour, decided one by one (from git log 0dc3d01..f125c02
--no-merges, checked against 0dc3d01):

Ported onto upstream's code, each in its own commit after this one:
- The pinned-session retire guard (c571226): a retire is refused
  (409 build_in_use) while an active Moca Pi session is pinned to the
  build. Upstream's buildsInUse checks live sandboxes only and its
  comment says pinned sessions are still to be checked.
- Reuse only while a host holds the snapshot (G29, 521efe5): upstream
  reuses any registered build with the same inputs; its own lifecycle
  spec (§4, Reuse) says a registered build is reused only while a host
  reports holding its snapshot.
- install-host.sh --uninstall-shared and the mounted legacy jail guard
  (5e66397): upstream has neither.
- GUIDE §4b.4's base example without skip_git_identity_check
  (f125c02): upstream applies X12 under every profile, so its example
  create would be refused.
- Links from upstream's READMEs to the fork-only files above.

Dropped, because upstream's design replaces them on purpose:
- Removal of admin-rejected builds: upstream stops them and never
  removes them (the user's decision in rossoctl#786).
- The harness-profile catalog's fallback to SH_SESSION_TEMPLATES
  (902255b): upstream serves the harness profile the store's templates
  only (its test was renamed so); a combined plane is unaffected.
- The fork's register ids (G-numbers), window dates and results
  pointers inside the documents upstream now has (RUNBOOK, README,
  GUIDE, ONBOARDING, PROCESS, GATING-RULES, P4-ON-P6, the specs):
  upstream's text wins; the fork's own documents above keep them.
- The fork's image-builder-specific wording in GATING-RULES.md:
  upstream's generic wording (the image builder) is taken as is.

Dropped, could be re-proposed (no upstream equivalent, but the port is
an API change or its intent upstream is unclear):
- TurnPlacement.template, a turn result naming the session's sandbox
  template (9d6004d): a harness API field; upstream's CHANGELOG is kept
  byte identical.
- An imported build's catalog entry and create record carrying the
  declared seed (20d0995): sessions are seeded the same (upstream falls
  back to the declared seed); only the field in the catalog API goes.
- mocactl: sbx create --seed checking the seeded HEAD against the spec's
  baseline_commit; activate --wait stopping at once on not_held or
  memfile_mismatch; ApiError's readiness, readinessReason and
  queuePosition in refusals; an admin write refused when the control
  plane URL came only from the login; the admin-write issuer check for
  the combined profile; the dry run's X1.offline check and its guest_mb
  and git-less advice; the quota, policy and build lines' extra fields
  (quotaSource, selfAttest, allowedRepositories, heldBy, attestation).
  Upstream's reviewed client (rossoctl#767, rossoctl#768) left them out; the server
  still enforces every rule.

Already upstream (not lost): build reuse (G21), the verify cache, the
host agent's --keep-shared removals, read-ahead, the hash_version 2
check in the microVM worker, M7, G39, G42, G43, G48, G49, G50, mocactl
--record, --version, the minted login's own control plane, activate
--wait sizing, and every other fork feature listed in the task.

The relay's per-client tokens: not on this branch (the fork's
sandbox-relay main.ts is older upstream code), so nothing to resolve.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@pdettori pdettori added this to the v0.11.0 milestone Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Place template workers by host memory, not by a fixed active limit

4 participants