axios+telemetry cleanup

This commit is contained in:
2026-04-02 15:19:11 +03:00
parent a3cbca1e11
commit 7e1eac8002
100 changed files with 3048 additions and 4491 deletions

View File

@@ -29,7 +29,7 @@
*/
import { feature } from 'bun:bundle'
import axios from 'axios'
import { isHttpError, nativeRequest } from '../utils/http.js'
import {
createV2ReplTransport,
type ReplBridgeTransport,
@@ -981,17 +981,17 @@ async function archiveSession(
// cse_* and we correctly send it.
const compatId = toCompatSessionId(sessionId)
try {
const response = await axios.post(
const response = await nativeRequest(
`${baseUrl}/v1/sessions/${compatId}/archive`,
{},
{
method: 'POST',
body: {},
headers: {
...oauthHeaders(accessToken),
'anthropic-beta': 'ccr-byoc-2025-07-29',
'x-organization-uuid': orgUUID,
},
timeout: timeoutMs,
validateStatus: () => true,
},
)
logForDebugging(
@@ -1001,7 +1001,7 @@ async function archiveSession(
} catch (err) {
const msg = errorMessage(err)
logForDebugging(`[remote-bridge] Archive failed: ${msg}`)
return axios.isAxiosError(err) && err.code === 'ECONNABORTED'
return isHttpError(err) && err.code === 'ECONNABORTED'
? 'timeout'
: 'error'
}