Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Commit 2acd922

Browse files
committed
fix: send usage after tool calls
1 parent 18f05b6 commit 2acd922

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { TuiPlugin, TuiPluginModule } from "@opencode-ai/plugin/tui";
2+
import { CURSOR_PLUGIN_ID } from "../constants";
3+
4+
export const tui: TuiPlugin = async () => {
5+
// The server target provides the provider/auth integration.
6+
// This TUI target makes the package installable into `tui.json`
7+
// so modern OpenCode can list and toggle it in the Plugins dialog.
8+
};
9+
10+
export const CursorAuthTuiPluginModule: TuiPluginModule & { id: string } = {
11+
id: CURSOR_PLUGIN_ID,
12+
tui,
13+
};
14+
15+
export default CursorAuthTuiPluginModule;

‎src/proxy/bridge-streaming.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ function createBridgeStreamResponse(
349349
pendingExecToolCallIds: sortedIds(state.pendingExecs.map((exec) => exec.toolCallId)),
350350
});
351351

352-
sendUsageChunkIfChanged();
353352
sendSSE(makeChunk({}, "tool_calls"));
353+
sendUsageChunkIfChanged();
354354
sendDone();
355355
closeController();
356356
};
@@ -530,7 +530,6 @@ function createBridgeStreamResponse(
530530
),
531531
});
532532
updateConversationCheckpoint(convKey, checkpointBytes);
533-
sendUsageChunkIfChanged();
534533
bridgeController.noteCheckpoint();
535534
if (state.pendingExecs.length > 0 && !toolCallsFlushed) {
536535
publishPendingToolCalls("checkpoint");

‎src/tui.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export {
2+
CursorAuthTuiPluginModule,
3+
tui,
4+
} from "./plugin/cursor-auth-plugin-tui";
5+
export { default } from "./plugin/cursor-auth-plugin-tui";

0 commit comments

Comments
 (0)