Skip to content

Commit da5ef5d

Browse files
committed
chore(deps): pin openai-responses to npm 0.2.1
1 parent 81f35cc commit da5ef5d

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

‎bun.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"@corbits/agent-intern": "workspace:*",
9090
"@corbits/codex-provider": "0.1.1",
9191
"@corbits/oauth-core": "0.2.0",
92-
"@corbits/openai-responses": "0.2.0",
92+
"@corbits/openai-responses": "0.2.1",
9393
"@corbits/xai-provider": "0.1.1",
9494
"@intx/agent": "workspace:*",
9595
"@intx/authz": "workspace:*",

‎tests/unit/codex-sse-fixtures.test.ts‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,13 @@ describe("codex-sse fixtures (golden parse)", () => {
149149
).toBe(true);
150150
});
151151

152-
test("incomplete stream emits partial text and is terminal without usage", () => {
152+
test("incomplete stream emits partial text and usage and is terminal", () => {
153153
const out = parseFixture("incomplete.json");
154154

155155
expect(eventTypes(out)).toEqual([
156156
"inference.text.delta",
157157
"inference.text.delta",
158+
"inference.usage",
158159
]);
159160
expect(out[0]).toMatchObject({
160161
type: "inference.text.delta",
@@ -164,8 +165,22 @@ describe("codex-sse fixtures (golden parse)", () => {
164165
type: "inference.text.delta",
165166
data: { token: "answer", index: 0 },
166167
});
167-
// response.incomplete is intentionally not mapped to usage (completed-only).
168-
expect(out.some((e) => e.type === "inference.usage")).toBe(false);
168+
// A truncated turn is still billed: the backend reports usage for the
169+
// partial turn (input plus output emitted before the cap), so
170+
// response.incomplete maps to usage like response.completed does.
171+
expect(out[2]).toMatchObject({
172+
type: "inference.usage",
173+
data: {
174+
usage: {
175+
input: 50,
176+
output: 8,
177+
cacheRead: 0,
178+
cacheWrite: 0,
179+
thinking: 0,
180+
},
181+
source: SOURCE,
182+
},
183+
});
169184

170185
const lastPayload = defined(
171186
loadFixture("incomplete.json").at(-1),

0 commit comments

Comments
 (0)