AFK spawn-options checkbox is 2-state over a 3-state inherit model (misleading + no path back to inherit) #21
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from the landing review of #20 (ADR-0021, spawn defaults + provider-options bag). Not a correctness bug — the behaviour matches the ADR's documented
null = inherit/present = explicitmodel — but the AFK spawn-options control is a 2-state checkbox over a 3-state model, which can mislead an operator about what an AFK fleet will actually run.Problem
The bool spawn-option (today:
ultracode) renders as a plain checkbox in the global and repo AFK-defaults sections (web/src/routes/RepoSettings.tsx~L283, and the equivalent inSettings.tsx). The underlying model is three-state:afk_options = null→ inherit (repo falls back to the global AFK bag)afk_options = {}or{"ultracode": "..."}→ explicit (overrides global)A checkbox can only show two of those three states, so:
afk_options = nullthat inherits a globalultracode: "true"renders the repo checkbox unchecked, even though that repo's AFK runs will run ultracode. The checkbox shows the repo override, not the effective value.truestores{"ultracode": "false"}— an explicit off that overrides the global — rather than clearing the bag back tonull(inherit). Once an operator touches the checkbox there is no way, from the UI, to return the repo to "same as global default".Why it matters
An operator configuring a repo can be misled into thinking an AFK fleet won't run ultracode (unchecked box) when it will (inherited from global), or can't express "go back to inheriting the global default" once they've set an explicit value. Model/effort already avoid this — they use a select with an explicit "same as default (inherit)" entry.
Proposed direction
Make the bool spawn-option a tri-state control at the repo scope, mirroring how model/effort already render an inherit entry:
null.Schema-driven so future bool options (and eventual enum/string types) get the same treatment automatically.
Scope / notes
null/present semantics from ADR-0021 stay exactly as shipped.InitialPromptNIT ininternal/provider/claudecode/claudecode.go(~L283) — the ultracode no-op keys onprompt == ""rather thanstrings.TrimSpace(prompt) == "". Unreachable in current flows (manual passes"", AFK passes substantive text), so purely defensive — fold in only if trivial.Refs: #20, ADR-0021, #19.