Skip to content

refactor(opencode): extract in-process fetch helper - #48934

Open
joaocostaz7 wants to merge 2 commits into
anomalyco:devfrom
joaocostaz7:run-inprocess-fetch
Open

joaocostaz7 wants to merge 2 commits into
anomalyco:devfrom
joaocostaz7:run-inprocess-fetch

Conversation

@joaocostaz7

@joaocostaz7 joaocostaz7 commented Sep 14, 2026

Copy link
Copy Markdown

Issue for this PR

n/a — refactor only, no linked issue.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Local opencode run and opencode --mini both build an SDK client that sends requests into Server.Default().app.fetch instead of the network. That fetch wrapper was duplicated in two branches (fresh --mini vs execute()).

This moves the wrapper into one inProcessFetch helper. Same behavior: lazy-load Server, attach ServerAuth.header() when OPENCODE_SERVER_PASSWORD is set.

How did you verify your code works?

Ran bun typecheck from the repo root (turbo, including the opencode package). No runtime change; the two call sites now pass the same helper they previously inlined.

Screenshots / recordings

n/a — no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Local `run` and `--mini` both dispatched SDK requests into Server.Default()
with the same fetch wrapper. Share one helper so auth-header changes stay in
one place.
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant