ANIMA_RUNNER_EXEC_SLOTS_<NAME> is also parsed as an executor: the akh gateway advertises phantom slots-tecton / slots-thoth lanes #394

Merged
toasterson merged 3 commits from claude/wi-019fa7c9-anima-runner-exec-slots-name-is-also-par into main 2026-07-29 17:20:20 +00:00
Owner

Anima work item 019fa7c9-cc5c-72c3-8789-ea90253f3aec.

Symptom

akh-gateway-thoth boots with:

INFO anima_runner: anima-runner starting runner_id=019f2f96-… name=akh-gateway-thoth
  max_slots=6 executors=["slots-tecton", "slots-thoth"] server=https://anima.wegmueller.it

There is no executor called slots-tecton. Those two entries are the
per-executor cap variables being consumed as executor definitions.

Cause

crates/anima-runner/src/config.rs walks the environment twice with two
prefixes, and the second is a prefix of the first:

  • line 204: k.strip_prefix("ANIMA_RUNNER_EXEC_") → executor definitions
  • line 232: k.strip_prefix("ANIMA_RUNNER_EXEC_SLOTS_") → per-executor caps

ANIMA_RUNNER_EXEC_SLOTS_TECTON=1 matches both. The first loop strips the
shorter prefix, gets SLOTS_TECTON → slots-tecton, and hands the value "1"
to parse_executor, which happily accepts it as a whitespace-split Spawn argv
(the command 1). So every cap variable mints a phantom executor whose spawn
command does not exist.

The caps themselves are unaffected — the second loop parses them correctly, and
the cap is enforced (verified 2026-07-28: tecton took exactly one slot). This is
purely the phantom lanes.

Why it matters

The gateway advertises those names to the server as real executors. Anything
that routes on an advertised executor name — any_supports, reviewer
selection, a companion or work item pinned by name, availability display — can
pick slots-tecton and dispatch a session that can only fail at spawn. It also
makes the runner's own startup line lie about what the lane is.

Ask

Order the loops so the longer prefix wins (check ANIMA_RUNNER_EXEC_SLOTS_
first and continue), or match ANIMA_RUNNER_EXEC_ with an explicit exclusion
of the SLOTS_ infix. Add a regression test with both variables set for the
same executor asserting exactly one executor and one cap entry.

Introduced by WI 019fa2fc (commit 8ac37406). Found while lifting the 2026-07-27
tecton capacity hold.

Anima work item `019fa7c9-cc5c-72c3-8789-ea90253f3aec`. ## Symptom `akh-gateway-thoth` boots with: ``` INFO anima_runner: anima-runner starting runner_id=019f2f96-… name=akh-gateway-thoth max_slots=6 executors=["slots-tecton", "slots-thoth"] server=https://anima.wegmueller.it ``` There is no executor called `slots-tecton`. Those two entries are the **per-executor cap variables being consumed as executor definitions**. ## Cause `crates/anima-runner/src/config.rs` walks the environment twice with two prefixes, and the second is a prefix of the first: - line 204: `k.strip_prefix("ANIMA_RUNNER_EXEC_")` → executor definitions - line 232: `k.strip_prefix("ANIMA_RUNNER_EXEC_SLOTS_")` → per-executor caps `ANIMA_RUNNER_EXEC_SLOTS_TECTON=1` matches **both**. The first loop strips the shorter prefix, gets `SLOTS_TECTON` → `slots-tecton`, and hands the value `"1"` to `parse_executor`, which happily accepts it as a whitespace-split Spawn argv (the command `1`). So every cap variable mints a phantom executor whose spawn command does not exist. The caps themselves are unaffected — the second loop parses them correctly, and the cap is enforced (verified 2026-07-28: tecton took exactly one slot). This is purely the phantom lanes. ## Why it matters The gateway advertises those names to the server as real executors. Anything that routes on an advertised executor name — `any_supports`, reviewer selection, a companion or work item pinned by name, availability display — can pick `slots-tecton` and dispatch a session that can only fail at spawn. It also makes the runner's own startup line lie about what the lane is. ## Ask Order the loops so the longer prefix wins (check `ANIMA_RUNNER_EXEC_SLOTS_` first and `continue`), or match `ANIMA_RUNNER_EXEC_` with an explicit exclusion of the `SLOTS_` infix. Add a regression test with both variables set for the same executor asserting exactly one executor and one cap entry. Introduced by WI 019fa2fc (commit 8ac37406). Found while lifting the 2026-07-27 tecton capacity hold.
toasterson force-pushed claude/wi-019fa7c9-anima-runner-exec-slots-name-is-also-par from 460fa04fe0 to 1e9f61450d 2026-07-28 10:22:55 +00:00 Compare
toasterson force-pushed claude/wi-019fa7c9-anima-runner-exec-slots-name-is-also-par from 1e9f61450d to a94290c66a 2026-07-28 10:55:49 +00:00 Compare
toasterson force-pushed claude/wi-019fa7c9-anima-runner-exec-slots-name-is-also-par from a94290c66a to 00d4fd617f 2026-07-28 11:42:01 +00:00 Compare
toasterson force-pushed claude/wi-019fa7c9-anima-runner-exec-slots-name-is-also-par from 00d4fd617f to c7918df221 2026-07-28 12:41:19 +00:00 Compare
toasterson force-pushed claude/wi-019fa7c9-anima-runner-exec-slots-name-is-also-par from c7918df221 to 01f1cef67f 2026-07-28 21:08:10 +00:00 Compare
toasterson changed title from WIP: ANIMA_RUNNER_EXEC_SLOTS_<NAME> is also parsed as an executor: the akh gateway advertises phantom slots-tecton / slots-thoth lanes to ANIMA_RUNNER_EXEC_SLOTS_<NAME> is also parsed as an executor: the akh gateway advertises phantom slots-tecton / slots-thoth lanes 2026-07-28 21:40:00 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
toasterson/Anima!394
No description provided.