diff_cap_lines = 0 is silently rewritten to 400, so the cap cannot be switched off #1660

Closed
opened 2026-10-27 13:41:17 +00:00 by sam · 0 comments
Owner

Fixed. Config.DiffCapLines was a plain int, so the defaults pass could not tell an absent key from an explicit 0 and rewrote both to 400. The dashboard schema said '0 means unlimited' and StageDiffCap treated <= 0 as unlimited, but 0 never reached it. Hit in production 2026-09-19: task 11 parked at 789 lines against a 400 cap while ~/.config/archie/config.toml had diff_cap_lines = 0.

Same root cause, worse instance: daemon.configForIdentity assigned root.DiffCapLines = identity.DiffCapLines unconditionally, so an identity that simply omitted the key overwrote the shared cap with 0 and silently disabled the safety rail entirely.

Fix: Config.DiffCapLines and IdentityConfig.DiffCapLines are *int (nil = absent, 0 = no cap), read through Config.DiffCap(). Defaults fill only nil. configForIdentity overrides only when the identity set it. TaskConfig keeps a resolved int, so the daemon/agent wire format is unchanged.

Also fixed the park reason, which told the operator to 'approve manually' -- a parked task's actions are retry/abandon/reject, so there is no approve path out of diff-cap. It now says to split the issue or raise diff_cap_lines and retry.

Not investigated: whether baseline-fix edits count toward ChangedLines, which would mean part of task 11's 789 lines was pre-existing repo breakage rather than the agent's change.


Imported from beads archie-core-xq1b · GitHub #907 · type bug · priority P1 · created 2026-09-19 · closed 2026-09-19

Fixed. Config.DiffCapLines was a plain int, so the defaults pass could not tell an absent key from an explicit 0 and rewrote both to 400. The dashboard schema said '0 means unlimited' and StageDiffCap treated <= 0 as unlimited, but 0 never reached it. Hit in production 2026-09-19: task 11 parked at 789 lines against a 400 cap while ~/.config/archie/config.toml had diff_cap_lines = 0. Same root cause, worse instance: daemon.configForIdentity assigned root.DiffCapLines = identity.DiffCapLines unconditionally, so an identity that simply omitted the key overwrote the shared cap with 0 and silently disabled the safety rail entirely. Fix: Config.DiffCapLines and IdentityConfig.DiffCapLines are *int (nil = absent, 0 = no cap), read through Config.DiffCap(). Defaults fill only nil. configForIdentity overrides only when the identity set it. TaskConfig keeps a resolved int, so the daemon/agent wire format is unchanged. Also fixed the park reason, which told the operator to 'approve manually' -- a parked task's actions are retry/abandon/reject, so there is no approve path out of diff-cap. It now says to split the issue or raise diff_cap_lines and retry. Not investigated: whether baseline-fix edits count toward ChangedLines, which would mean part of task 11's 789 lines was pre-existing repo breakage rather than the agent's change. --- _Imported from beads `archie-core-xq1b` · GitHub #907 · type bug · priority P1 · created 2026-09-19 · closed 2026-09-19_
sam added the highbug labels 2026-10-27 13:41:17 +00:00
sam self-assigned this 2026-10-27 13:41:17 +00:00
sam closed this issue 2026-10-27 13:41:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1660