AIX: Debugger: rename Dispatch Request loopback

This commit is contained in:
Enrico Ros
2025-02-27 19:59:37 -08:00
parent 3f1bed3b6e
commit 5ad11a8b75
4 changed files with 9 additions and 9 deletions
+4 -4
View File
@@ -551,8 +551,8 @@ async function _aixChatGenerateContent_LL(
fragments: [],
/* rest start as undefined (missing in reality) */
};
const debugDispatchRequestbody = getLabsDevMode() && aixContext.name === 'conversation'; // [DEV] Debugging the conversation request (only)
const contentReassembler = new ContentReassembler(accumulator_LL, debugDispatchRequestbody);
const debugDispatchRequest = getLabsDevMode() && aixContext.name === 'conversation'; // [DEV] Debugging the conversation request (only)
const contentReassembler = new ContentReassembler(accumulator_LL, debugDispatchRequest);
// Initialize throttler if throttling is enabled
const throttler = (onReassemblyUpdate && throttleParallelThreads)
@@ -568,9 +568,9 @@ async function _aixChatGenerateContent_LL(
chatGenerate: aixChatGenerate,
context: aixContext,
streaming: getLabsDevNoStreaming() ? false : aixStreaming, // [DEV] disable streaming if set in the UX (testing)
...(debugDispatchRequestbody && {
...(debugDispatchRequest && {
connectionOptions: {
debugDispatchRequestbody: true, // [DEV] Debugging the request without requiring a server restart
debugDispatchRequest: true, // [DEV] Debugging the request without requiring a server restart
},
}),
}, {
+1 -1
View File
@@ -54,7 +54,7 @@ export const aixRouter = createTRPCRouter({
try {
// [DEV] Debugging the request without requiring a server restart
if (input.connectionOptions?.debugDispatchRequestbody) {
if (input.connectionOptions?.debugDispatchRequest) {
chatGenerateTx.addDebugRequestInDev(dispatch.request.url, dispatch.request.headers, dispatch.request.body);
yield* chatGenerateTx.emitParticles();
}
+2 -2
View File
@@ -437,7 +437,7 @@ export namespace AixWire_API {
/// Connection options
export const ConnectionOptions_schema = z.object({
debugDispatchRequestbody: z.boolean().optional(),
debugDispatchRequest: z.boolean().optional(),
throttlePartTransmitter: z.number().optional(), // in ms
// retry: z.number().optional(),
// retryDelay: z.number().optional(),
@@ -502,7 +502,7 @@ export namespace AixWire_Particles {
| { cg: 'issue', issueId: CGIssueId, issueText: string }
| { cg: 'set-metrics', metrics: CGSelectMetrics }
| { cg: 'set-model', name: string }
| { cg: '_debugRequest', security: 'dev-env', request: { url: string, headers: string, body: string } }; // may generalize this in the future
| { cg: '_debugDispatchRequest', security: 'dev-env', dispatchRequest: { url: string, headers: string, body: string } }; // may generalize this in the future
export type CGEndReason = // the reason for the end of the chat generation
| 'abort-client' // user aborted before the end of stream
@@ -130,9 +130,9 @@ export class ChatGenerateTransmitter implements IParticleTransmitter {
// [security] only emit in development, as it may contain sensitive information
if (process.env.NODE_ENV !== 'development') return;
this.transmissionQueue.push({
cg: '_debugRequest',
cg: '_debugDispatchRequest',
security: 'dev-env',
request: {
dispatchRequest: {
url,
headers: JSON.stringify(headers, null, 2),
body: JSON.stringify(body, null, 2),