You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
afx cleanup -p rejects a project number with leading zeros (0466) that afx send accepts #2002
afx cleanup -p 0466 fails with Builder not found for project: 0466, while afx cleanup -p 466 finds the builder. afx send 0466 "…" works, because afx send ignores leading zeros. The same number has to be typed two different ways depending on the command.
Root cause
findProjectBuilder in packages/codev/src/agent-farm/commands/cleanup.ts compares the typed id as a string: an exact match on the builder id, then (for a task-… name) the task builder id, then builder.name.includes(projectId). A builder for project 466 is builder-spir-466, and that name does not contain 0466, so none of the three steps matches.
(Before the cleanup fix for all-digit task builders, PR #1994, the same three comparisons sat inline in cleanup(); the gap is older than that PR and was left out of it on purpose.)
Fix
Normalise an all-digit project id by stripping leading zeros before the lookup in findProjectBuilder, the same way afx send resolves a bare number. Leave ids that are not all digits unchanged (task-0042 is a task short id, not a number).
Check afx cleanup --issue for the same gap while there. Two neighbouring lookups have their own issues and are not this one: the -i / -p bugfix-<n> lookup against Tower-canonical ids (issue #1799) and the missing name fallback for -i (issue #1445).
Testing
A unit test on findProjectBuilder: 0466 and 466 both return the builder named builder-spir-466; 0466 does not return a builder for project 4660; task-0042 still resolves as a task. No load is needed to reproduce: the function is pure.
Activity