Repository navigation
fix: Route lane tests and builds through declared pueue operations - #37
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 517c625860
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ${resolveFlakeDir} | ||
| if [ "''${SINNIXD_PRINCIPAL:-}" = agent-control ] \ | ||
| && [ "''${SINNIXD_OPERATION:-}" != check ]; then | ||
| exec agentctl job start sinnix check --workspace "$_flake_dir" --wait -- "$@" |
There was a problem hiding this comment.
Fail when queued verification is still running
When the single-slot bulk pool is occupied, this nested job can spend part or all of the default 3,600-second wait queued; agentctl then returns exit 0 for a nonterminal task (pkgs/sinnixd/sinnixd/cli.py:225-236), so the lane treats check as successful while verification is still running or has not started. The equivalent check-heavy and check-all redirects have the same problem; either wait long enough to include queueing and the operation timeout or make a wait timeout fail.
AGENTS.md reference: AGENTS.md:L38-L46
Useful? React with 👍 / 👎.
| MemoryHigh = "8G"; | ||
| MemoryMax = "10G"; |
There was a problem hiding this comment.
Keep the hard memory ceiling on each lane scope
Because sinnixd-pueue-agent.slice contains all six admitted agent tasks, this MemoryMax is a shared 10G cap rather than the intended per-lane 10G safety boundary. With multiple healthy lanes, their combined usage can exceed 10G even though every lane remains below its own declared limit, causing allocation failures or OOM kills and undercutting the parent job plane's 20G budget; leave the hard cap on each lane scope rather than on the shared pool slice.
AGENTS.md reference: AGENTS.md:L98-L107
Useful? React with 👍 / 👎.
| def scope_unit_for(job_id: object, pool: str) -> str: | ||
| """Name the transient scope that carries one queued task's workload.""" | ||
| safe_job_id = re.sub(r"[^A-Za-z0-9_.-]", "-", str(job_id)).strip("-") or "job" | ||
| return f"{POOL_SLICE_PREFIX}-{pool}-{safe_job_id[:160]}.scope" |
There was a problem hiding this comment.
Preserve the unique suffix when shortening scope names
For any project/operation label that makes the generated job reference exceed 160 characters, this truncation removes the UUID suffix added by _reference(). Two concurrent launches with the same long label therefore request the same transient scope name, and the second systemd-run fails because the first scope already exists; descriptor validation permits identifiers of this length, so shorten or hash the label while retaining the unique suffix.
Useful? React with 👍 / 👎.
Summary
Route every new agentctl pueue launch through a transient systemd scope named for its declared pool, with fixed pool resource budgets and recursive-worker guards. Route Sinnix heavy check entry points through declared bulk operations and keep agent conversation parallelism at six.
Problem
Managed lane tests and Nix workloads could remain descendants of the conversational agent scope, bypassing pueue pool admission and resource isolation. The incident snapshot recorded four lanes consuming about 3.1 GiB together and a Nix child reaching about 1.89 GiB RSS inside the agent cgroup.
Solution
sinnixd-queue-runwraps new launches insinnixd-pueue-<pool>-<job>.scopeundersinnixd-pueue-<pool>.slice.SINNIXD_QUEUE_WORKER=1and operation identity; managed lane wrappers submit checks to their declared pueue operations.Verification
python -m pytest -q pkgs/sinnixd/test_queue_run.py::test_a_declared_pool_runs_the_child_in_its_named_systemd_scope pkgs/sinnixd/test_launch.py::test_cancel_kills_the_task_and_signals_the_recorded_process_group pkgs/sinnixd/test_launch.py::test_start_writes_the_launch_input_and_queues_the_wrapper_in_the_pool—3 passed in 0.05s.python -m pytest -q pkgs/sinnixd/test_pueue.py::test_a_private_pueue_task_places_its_child_in_the_declared_pool_scope—1 passed in 2.05s.nix build .#sinnixd --accept-flake-config --no-link— exit0.nix build .#checks.x86_64-linux.agent-resource-policy .#checks.x86_64-linux.agentctl-operation-contract .#checks.x86_64-linux.agentctl-operation-launch --accept-flake-config --no-link— exit0.Residual risk
The deployed live service was not switched; live smoke and hostile-allocation checks require activation authority. The broader local Python selection had one inherited environment-scrubbing failure involving
PYTHONNOUSERSITEandLC_CTYPE; the changed focused tests and package checks pass.