Skip to content

Commit 0517936

Browse files
committed
fix(agents): align stale error follow-up with branch types
1 parent af87ff7 commit 0517936

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/agents/pi-embedded-runner/run/payloads.errors.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe("buildEmbeddedRunPayloads", () => {
104104
it("does not emit a synthetic billing error for successful turns with stale errorMessage", () => {
105105
const payloads = buildPayloads({
106106
lastAssistant: makeAssistant({
107-
stopReason: "end_turn",
107+
stopReason: "stop",
108108
errorMessage: "insufficient credits for embedding model",
109109
content: [{ type: "text", text: "Handle payment required errors in your API." }],
110110
}),

src/agents/pi-embedded-runner/run/payloads.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ export function buildEmbeddedRunPayloads(params: {
133133
? suppressAssistantArtifacts
134134
? undefined
135135
: formatAssistantErrorText(params.lastAssistant, {
136-
cfg: params.config,
137-
sessionKey: params.sessionKey,
138-
provider: params.provider,
139-
model: params.model,
140-
})
136+
cfg: params.config,
137+
sessionKey: params.sessionKey,
138+
provider: params.provider,
139+
model: params.model,
140+
})
141141
: undefined;
142142
const rawErrorMessage = lastAssistantErrored
143143
? params.lastAssistant?.errorMessage?.trim() || undefined

src/agents/pi-embedded-utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describe("extractAssistantText", () => {
139139
const msg = makeAssistantMessage({
140140
role: "assistant",
141141
errorMessage: "insufficient credits for embedding model",
142-
stopReason: "end_turn",
142+
stopReason: "stop",
143143
content: [{ type: "text", text: responseText }],
144144
timestamp: Date.now(),
145145
});

0 commit comments

Comments
 (0)