MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / traceRestResponse

Function traceRestResponse

apps/kimi-web/src/debug/trace.ts:181–209  ·  view source on GitHub ↗
(info: {
  method: string;
  path: string;
  requestId: string;
  status: number;
  durationMs: number;
  code: number;
  msg: string;
  envelopeRequestId?: string;
  data?: unknown;
})

Source from the content-addressed store, hash-verified

179}
180
181export function traceRestResponse(info: {
182 method: string;
183 path: string;
184 requestId: string;
185 status: number;
186 durationMs: number;
187 code: number;
188 msg: string;
189 envelopeRequestId?: string;
190 data?: unknown;
191}): void {
192 if (!isTraceEnabled()) return;
193 const failed = info.code !== 0;
194 push({
195 source: 'rest',
196 kind: failed ? 'rest:error' : 'rest:response',
197 label: `← ${info.method} ${info.path} ${info.status} code=${info.code}${failed ? ` "${info.msg}"` : ''} ${Math.round(info.durationMs)}ms`,
198 method: info.method,
199 path: info.path,
200 requestId: info.requestId,
201 status: info.status,
202 code: info.code,
203 durationMs: info.durationMs,
204 detail: {
205 envelope: { code: info.code, msg: info.msg, request_id: info.envelopeRequestId },
206 data: detailOf(info.data),
207 },
208 });
209}
210
211export function traceRestFailure(info: {
212 method: string;

Callers 3

getBlobMethod · 0.90
postFormMethod · 0.90
requestMethod · 0.90

Calls 3

isTraceEnabledFunction · 0.85
detailOfFunction · 0.85
pushFunction · 0.70

Tested by

no test coverage detected