mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 16:31:50 +00:00
fix(acp): pass server auth to internal client (#25591)
This commit is contained in:
parent
2ad1eb56d3
commit
7a503de606
1 changed files with 8 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import { ACP } from "@/acp/agent"
|
|||
import { Server } from "@/server/server"
|
||||
import { createOpencodeClient } from "@opencode-ai/sdk/v2"
|
||||
import { withNetworkOptions, resolveNetworkOptions } from "../network"
|
||||
import { Flag } from "@opencode-ai/core/flag/flag"
|
||||
|
||||
const log = Log.create({ service: "acp-command" })
|
||||
|
||||
|
|
@ -26,6 +27,13 @@ export const AcpCommand = effectCmd({
|
|||
|
||||
const sdk = createOpencodeClient({
|
||||
baseUrl: `http://${server.hostname}:${server.port}`,
|
||||
headers: Flag.OPENCODE_SERVER_PASSWORD
|
||||
? {
|
||||
Authorization: `Basic ${Buffer.from(
|
||||
`${Flag.OPENCODE_SERVER_USERNAME ?? "opencode"}:${Flag.OPENCODE_SERVER_PASSWORD}`,
|
||||
).toString("base64")}`,
|
||||
}
|
||||
: undefined,
|
||||
})
|
||||
|
||||
const input = new WritableStream<Uint8Array>({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue