iflytek/astron-agent · warning · X
e.status
e.status
Error message
e.statusText
What it means
The SDK's `upload` function POSTs log batches to `{baseUrl}/api/v1/logging/collect/list`. If the response is not ok, it throws `new X({ code: e.status, message: e.statusText })` — so the error's `code` is the raw HTTP status number (the message field shows as `e.statusText`, e.g. 'Internal Server Error'). This is the SDK's log-upload path failing with an uninterpreted HTTP error.
Solutions
- Inspect the network request to /api/v1/logging/collect/list for the actual status code (the thrown code === HTTP status) and treat it like that HTTP error.
- Verify the logging-collect service is deployed and the SDK baseUrl resolves to it in this environment.
- Reduce log batch size / upload frequency if rejected with 413 or 429.
- Refresh credentials if the POST is rejected 401/403.
- Since this is telemetry upload, wrap upload calls so failures are logged and swallowed rather than breaking the avatar session.
Example fix
// before: unguarded SDK log upload sdk.upload(logs) // after catchAndLog(() => sdk.upload(logs)); // telemetry failure must not break the session
Defensive patterns
Strategy: try-catch
Validate before calling
if (!navigator.onLine) skipLogUpload(); if (logs.reduce((n, l) => n + l.length, 0) > 1_000_000) logs = truncateBatch(logs);
Type guard
function isUploadHttpError(e) { return typeof e?.code === 'number' && e.code >= 400 && e.code < 600; } Try / catch
try { await sdk.upload(logs) }
catch (e) {
if (isUploadHttpError(e)) console.warn(`Log upload failed (HTTP ${e.code}), will retry later`, e.message);
// never rethrow: telemetry must not break the avatar session
} Prevention
- Treat log upload as best-effort: always catch and queue for later retry
- Cap batch payload size to avoid 413 rejections
- Verify the logging-collect route exists in every environment during deploy smoke tests
When it happens
Trigger: Any avatar session that triggers log collection where the logging endpoint returns a non-2xx status: wrong baseUrl for the logging route, service down (5xx), auth rejection (401/403), payload rejected (413/400), or 404 because the collect route does not exist in that environment.
Common situations: Log-upload endpoint not deployed/routed in the environment; oversized log batch bodies rejected; expired credentials making the POST 401; backend logging service returning 500 under load.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
- INVALID_PARAMETER
- errorMessage (dynamic; error.message or fallback 'Failed to…
- PERSONALITY_AI_GENERATE_ERROR
- sandbox-exec failed: HTTP
- Skill resource download failed: HTTP
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/19c848cfd8617e7a.
Report an issue: GitHub.
Appendix: source
Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/xrtc-player-BJTnVhG9.js:13168
t.extendInfo &&
t.extendInfo.location &&
(o += r
? '&location='.concat(t.extendInfo.location)
: '?location='.concat(t.extendInfo.location)),
t.privateKey &&
(o += r
? '&privateKey='.concat(t.privateKey)
: '?privateKey='.concat(t.privateKey)),
i.abrupt(
'return',
fetch(o, {
method: 'POST',
body: JSON.stringify(e),
headers: n,
})
.then(function (e) {
if (e.ok) return e.json();
throw new X({ code: e.status, message: e.statusText });
})
.catch(function (e) {
return Promise.reject(e);
})
)
);
case 10:
case 'end':
return i.stop();
}
}, i);
})
)();
},
};
function Ii(e, t) {
var i = Object.keys(e);
if (Object.getOwnPropertySymbols) {View on GitHub (pinned to 5e758547a8)