fix(attach): read OPENCODE_SERVER_USERNAME instead of hardcoding opencode#18641
Open
ernestodeoliveira wants to merge 1 commit intoanomalyco:devfrom
Open
fix(attach): read OPENCODE_SERVER_USERNAME instead of hardcoding opencode#18641ernestodeoliveira wants to merge 1 commit intoanomalyco:devfrom
ernestodeoliveira wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
3 tasks
atharvau
reviewed
Mar 23, 2026
atharvau
left a comment
There was a problem hiding this comment.
Code Review for PR #18641: Duplicate Fix
⚠️ Notice: Duplicate PR
This PR is identical to PR #18646 by @kevinWangSheng, which implements the exact same fix:
- Both add
OPENCODE_SERVER_USERNAMEenvironment variable support - Both use
"opencode"as the fallback default - Both modify the same file with identical changes
📋 Recommendation
Since PR #18646 was submitted first and has already been reviewed, I recommend:
- Close this PR in favor of #18646
- Credit @ernestodeoliveira in #18646 for also identifying this issue
- Merge #18646 which has the same fix
This is a common situation where multiple contributors identify the same issue. Both solutions are correct, but we should avoid duplicate merges.
✅ Technical Assessment
The code change itself is excellent - same quality as #18646:
- Backwards compatible
- Follows established patterns
- Clean implementation
Recommendation: CLOSE (Duplicate of #18646)
Closed
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #18611
Type of change
What does this PR do?
opencode attachbuilds the Basic auth header hardcoding"opencode"as the username:This ignores
OPENCODE_SERVER_USERNAME, so authentication fails when the server is configured with a non-default username.opencode runalready reads the env var correctly (line 659 inrun.ts). This PR applies the same pattern toattach.How did you verify your code works?
Code inspection — the fix mirrors the existing pattern in
run.tsexactly.Screenshots / recordings
N/A — CLI-only change.
Checklist