fix(#2027): use start comment author instead of GetAuthenticatedUser in analyzeTimeline#2028
Conversation
…in analyzeTimeline analyzeTimeline called GetAuthenticatedUser to determine the bot's username for identifying agent-posted comments on the timeline. This API call fails for GitHub App installation tokens (/user returns 403, /app fallback returns 401), causing agentPosted to stay false and PostCompletion to post a new comment instead of editing the start comment in place. The start comment's Author field is already available from ListIssueComments at comments[startIdx]. Use it directly instead of making an extra API call, eliminating the fragile /user → /app fallback chain entirely. Updated the GetAuthenticatedUserError test to verify the new behavior: bot identity is now derived from the start comment, and GetAuthenticatedUser is never called. Note: make lint could not run in sandbox (shellcheck_py download blocked by network policy). go vet and go test passed. Closes #2027
Site previewPreview: https://9406a488-site.fullsend-ai.workers.dev Commit: |
|
🤖 Review · Started 3:40 PM UTC |
ReviewFindingsNo findings. |
|
🤖 Finished Review · ✅ Success · Started 3:40 PM UTC · Completed 3:46 PM UTC |
|
🤖 Retro · Started 4:35 PM UTC |
Retro: PR #2028 —
|
|
🤖 Finished Retro · ✅ Success · Started 4:35 PM UTC · Completed 4:43 PM UTC |
analyzeTimeline called GetAuthenticatedUser to determine the bot's username for identifying agent-posted comments on the timeline. This API call fails for GitHub App installation tokens (/user returns 403, /app fallback returns 401), causing agentPosted to stay false and PostCompletion to post a new comment instead of editing the start comment in place.
The start comment's Author field is already available from ListIssueComments at comments[startIdx]. Use it directly instead of making an extra API call, eliminating the fragile /user → /app fallback chain entirely.
Updated the GetAuthenticatedUserError test to verify the new behavior: bot identity is now derived from the start comment, and GetAuthenticatedUser is never called.
Note: make lint could not run in sandbox (shellcheck_py download blocked by network policy). go vet and go test passed.
Closes #2027
Post-script verification
agent/2027-use-start-comment-author)5faa79f06ad8dbac4b7f08aa7a6ff79772c74552..HEAD)