fix(#2783): refresh OIDC token before agent start - #2859
Conversation
PR Summary by QodoRefresh OIDC token immediately before agent start (WIF mode)
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Site previewPreview: https://554158f0-site.fullsend-ai.workers.dev Commit: |
|
🤖 Review · |
Code Review by Qodo
1.
|
GHA OIDC tokens expire after 5 minutes. When sandbox setup (creation + bootstrap + code copy + scans) exceeds that window, the pre-fetched token from prepare-sandbox-credentials.sh is stale before the agent's first inference call, causing an immediate invalid_grant failure. Add an immediate refreshOIDCToken() call after sandbox is ready and before starting the periodic refresh goroutine. This resets the token age to ~0s right before the agent starts, well within the 5-minute lifetime. Also fix the incorrect ~10 min comment in the credentials script. Closes #2783 Assisted-by: Claude (fix) Signed-off-by: Wayne Sun <gsun@redhat.com>
92f3767 to
49edb64
Compare
|
🤖 Finished Review · ✅ Success · Started 6:10 PM UTC · Completed 6:23 PM UTC |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Looks good to me |
ralphbean
left a comment
There was a problem hiding this comment.
LGTM. One minor note on the existing context thread.
|
🤖 Finished Retro · ✅ Success · Started 7:10 PM UTC · Completed 7:17 PM UTC |
Retro: PR #2859 — refresh OIDC token before agent startTimeline: Human-authored PR by waynesun09, created 17:58 UTC, merged 19:06 UTC (~68 min). Single commit, 2 files changed (+7/−2). Fixed a real production bug where stale OIDC tokens caused What happened:
Review quality gap: The fullsend review agent missed a real correctness issue that both Qodo and the human caught: the new synchronous blocking call should use the parent Filtered proposals (already covered by open issues):
1 new proposal filed for the context propagation review gap. Proposals filed
|
Summary
refreshOIDCToken()call right before starting the periodic refresh goroutine. The pre-fetched OIDC token fromprepare-sandbox-credentials.shexpires after 5 minutes (GHA OIDC token lifetime), but sandbox setup can exceed that window — causinginvalid_granton the agent's first inference call.prepare-sandbox-credentials.sh(~10 min→~5 min).Test plan
go test ./internal/cli/ -run OIDC)make lint)Closes #2783