Skip to content

Commit b51aa1d

Browse files
committed
A couple of fixes from CodeRabbit
1 parent e8c8cc6 commit b51aa1d

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

apps/webapp/app/presenters/v3/TestTaskPresenter.server.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,17 @@ export class TestTaskPresenter {
250250
// Infer schema from existing run payloads when no explicit schema is defined
251251
let inferredPayloadSchema: unknown | undefined;
252252
if (!task.payloadSchema && latestRuns.length > 0 && task.triggerSource === "STANDARD") {
253-
try {
254-
let inference: ReturnType<typeof inferSchema> | undefined;
255-
for (const run of latestRuns) {
253+
let inference: ReturnType<typeof inferSchema> | undefined;
254+
for (const run of latestRuns) {
255+
try {
256256
const parsed = await parsePacket({ data: run.payload, dataType: run.payloadType });
257257
inference = inferSchema(parsed, inference);
258+
} catch {
259+
// Skip malformed runs — inference is best-effort
258260
}
259-
if (inference) {
260-
inferredPayloadSchema = inference.toJSONSchema();
261-
}
262-
} catch {
263-
// Ignore inference errors — it's best-effort
261+
}
262+
if (inference) {
263+
inferredPayloadSchema = inference.toJSONSchema();
264264
}
265265
}
266266

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.ai-generate-payload.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
6666
taskIdentifier,
6767
hasPayloadSchema: !!payloadSchema,
6868
hasCurrentPayload: !!currentPayload,
69-
prompt,
69+
promptLength: prompt.length,
7070
});
7171

7272
const systemPrompt = buildSystemPrompt(taskIdentifier, payloadSchema, currentPayload);
@@ -207,7 +207,6 @@ async function getTaskSourceCode(
207207
taskIdentifier,
208208
filePath: file.filePath,
209209
contentLength: decompressed.length,
210-
contents: decompressed,
211210
});
212211

213212
return `File: ${file.filePath}\n\n${decompressed}`;

0 commit comments

Comments
 (0)