mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55:51 +00:00
fix: add Authorization header to peer message requests
getBridgeAccessToken() provides the OAuth Bearer token, matching the auth pattern used by bridgeApi.ts and codeSessionApi.ts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import axios from 'axios'
|
||||
import { logForDebugging } from '../utils/debug.js'
|
||||
import { errorMessage } from '../utils/errors.js'
|
||||
import { getBridgeAccessToken } from './bridgeConfig.js'
|
||||
import { getReplBridgeHandle } from './replBridgeHandle.js'
|
||||
import { toCompatSessionId } from './sessionIdCompat.js'
|
||||
|
||||
@@ -29,6 +30,11 @@ export async function postInterClaudeMessage(
|
||||
return { ok: false, error: 'No target session specified' }
|
||||
}
|
||||
|
||||
const accessToken = getBridgeAccessToken()
|
||||
if (!accessToken) {
|
||||
return { ok: false, error: 'No access token available' }
|
||||
}
|
||||
|
||||
const compatTarget = toCompatSessionId(target)
|
||||
const from = toCompatSessionId(handle.bridgeSessionId)
|
||||
const baseUrl = handle.sessionIngressUrl
|
||||
@@ -44,6 +50,7 @@ export async function postInterClaudeMessage(
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
'Content-Type': 'application/json',
|
||||
'anthropic-version': '2023-06-01',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user