Clean up old stuff & fix ui errors
Build and Push Spoon Images / quality (push) Successful in 2m22s
Build and Push Spoon Images / build-images (push) Successful in 23m10s

This commit is contained in:
Gabriel Brown
2026-06-23 14:57:05 -04:00
parent d207b8b0b8
commit a6f7ea7f78
34 changed files with 1565 additions and 551 deletions
@@ -51,6 +51,91 @@ describe('agent event normalization', () => {
).toContainEqual({ kind: 'file_edited', path: 'src/app.ts' });
});
test('normalizes current Codex item events', () => {
expect(
normalizeCodexJsonLine(
JSON.stringify({
type: 'item.completed',
item: {
id: 'item-1',
type: 'agent_message',
text: 'I updated the auth provider.',
},
}),
),
).toContainEqual({
kind: 'assistant_delta',
content: 'I updated the auth provider.',
});
expect(
normalizeCodexJsonLine(
JSON.stringify({
type: 'item.completed',
item: {
id: 'item-2',
type: 'error',
message: 'sandbox failed',
},
}),
),
).toContainEqual({
kind: 'error',
message: 'sandbox failed',
});
expect(
normalizeCodexJsonLine(
JSON.stringify({
type: 'turn.failed',
error: { message: 'request failed' },
}),
),
).toContainEqual({
kind: 'error',
message: '{\n "message": "request failed"\n}',
});
});
test('normalizes Codex tool item lifecycle events', () => {
expect(
normalizeCodexJsonLine(
JSON.stringify({
type: 'item.started',
item: {
id: 'tool-1',
type: 'local_shell_call',
command: ['bash', '-lc', 'rg Authentik'],
},
}),
),
).toContainEqual({
kind: 'tool_started',
name: 'local_shell_call',
input: 'bash -lc rg Authentik',
externalMessageId: 'tool-1',
});
expect(
normalizeCodexJsonLine(
JSON.stringify({
type: 'item.completed',
item: {
id: 'tool-1',
type: 'local_shell_call',
command: ['bash', '-lc', 'rg Authentik'],
output: 'apps/web/auth.ts',
},
}),
),
).toContainEqual({
kind: 'tool_completed',
name: 'local_shell_call',
output: 'apps/web/auth.ts',
externalMessageId: 'tool-1',
});
});
test('normalizes OpenCode assistant, tool, and permission events', () => {
expect(
normalizeOpenCodeEvent({
@@ -93,5 +178,21 @@ describe('agent event normalization', () => {
body: 'Run bun test?',
metadata: '{\n "permissionID": "perm-1",\n "message": "Run bun test?"\n}',
});
expect(
normalizeOpenCodeEvent({
type: 'tool.output',
properties: {
tool: 'read',
output: 'apps/web/auth.ts',
messageID: 'message-2',
},
}),
).toContainEqual({
kind: 'tool_completed',
name: 'read',
output: 'apps/web/auth.ts',
externalMessageId: 'message-2',
});
});
});