feat: finally a good working state

This commit is contained in:
hugo committed 2026-02-26 11:55:21 +01:00
1 parent cf57879d1f
commit 121aa6a9f7
12 files changed
+585 -44

No files matched your search

+6
View File
@@ -293,10 +293,16 @@ export class OpenCodeManager {
let fullResponse = '';
const toolCallsCollected: Array<{ name: string; args: unknown }> = [];
// Compute turn index for surface-to-message association
const turnIndex = dbMessages.filter(m => m.role === 'user').length - 1;
// Wrap onA2UIMessage emission for render tools
const emitA2UIMessages = (messages: A2UIServerMessage[]) => {
if (onA2UIMessage) {
for (const msg of messages) {
if (msg.type === 'createSurface') {
msg.metadata = { ...msg.metadata, turnIndex };
}
onA2UIMessage(msg);
}
}