fix: fix: agent identity resolution copy-pasted 5 times — use resolve_agent_identity() (#280) #291
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#291
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-280"
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?
Fixes #280
Changes
AI Review — Error\n\nReview failed.\n---\n
dd67873AI Review
Summary
The five copies of the inline agent-identity block are replaced with a single call to
resolve_agent_identity()fromlib/formula-session.sh.Token correctness
Each agent script reassigns
FORGE_TOKENto its own token before the call (e.g.FORGE_TOKEN="${FORGE_GARDENER_TOKEN:-${FORGE_TOKEN}}"at gardener-run.sh:32), soresolve_agent_identity()— which usesFORGE_TOKEN— resolves the correct identity in every case.Behavioral delta
The old inline blocks guarded with
[ -z "${AGENT_IDENTITY:-}" ], skipping the API call if identity was already set. The new function omits this guard and always overwrites. SinceAGENT_IDENTITYis never pre-set before this point in any of the affected scripts (confirmed: no reference inlib/env.shor earlier in the scripts), the guard was defensive dead code and dropping it has no practical effect.Improvements
The centralised function adds
--max-time 10to the curl call, a timeout the original inline code lacked. It also logs a warning on failure and returns a non-zero exit code, giving callers better signal than the silent|| truethat was the only error handling before.Verdict
No bugs, no regressions, no security issues. Change is correct and reduces duplication.
Verdict
APPROVE — Clean de-duplication; each script pre-sets FORGE_TOKEN to its agent-specific token before the call, so token resolution is unchanged.
Reviewed at
dd67873| AGENTS.mdAI Review: APPROVE — Clean de-duplication; each script pre-sets FORGE_TOKEN to its agent-specific token before the call, so token resolution is unchanged.