Skip to content

Commit 261f266

Browse files
fix(server): Code Mode sent messages stay inline in long turns
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 3dc3bbb commit 261f266

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎apps/server/src/orchestration-v2/ProjectionStore.test.ts‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4333,13 +4333,16 @@ it.layer(layerTest)("ProjectionStoreV2", (it) => {
43334333
workCursor = page.nextCursor;
43344334
}
43354335
assert.strictEqual(workIds.size, 999);
4336-
for (const toolName of [
4337-
"t3-code.delegate_task",
4338-
"mcp__t3_code__delegate_task",
4339-
"mcp__t3-code__send_to_user",
4340-
]) {
4336+
for (const [toolName, output] of [
4337+
["t3-code.delegate_task", null],
4338+
["mcp__t3_code__delegate_task", null],
4339+
["mcp__t3-code__send_to_user", null],
4340+
// OpenCode Code Mode reports a nested send_to_user call as one `execute` item.
4341+
["execute", JSON.stringify({ sentMessage: "Draft" })],
4342+
] as const) {
43414343
yield* sql`UPDATE orchestration_v2_projection_turn_items SET type = 'dynamic_tool',
4342-
payload_json = json_set(payload_json, '$.type', 'dynamic_tool', '$.toolName', ${toolName})
4344+
payload_json = json_set(payload_json, '$.type', 'dynamic_tool', '$.toolName', ${toolName},
4345+
'$.output', ${output})
43434346
WHERE thread_id = ${threadId} AND ordinal = 2`;
43444347
const window = yield* projectionStore.getThreadSnapshotWindow(threadId, {
43454348
rowLimit: sqlPageLimit,

‎apps/server/src/orchestration-v2/ProjectionStore.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,8 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
21292129
item.payload_json LIKE '%htmlRender%' OR item.payload_json LIKE ${`%${MCP_APP_OUTPUT_KEY}%`}
21302130
OR item.payload_json LIKE '%"viewedImagePath"%'
21312131
OR item.payload_json LIKE '%"toolName":"%delegate_task"%'
2132-
OR item.payload_json LIKE '%"toolName":"%send_to_user"%')`;
2132+
OR item.payload_json LIKE '%"toolName":"%send_to_user"%'
2133+
OR item.payload_json LIKE '%sentMessage%')`;
21332134

21342135
// SQLite uses the partial conversation index of migration 082 only for this exact predicate.
21352136
const CONVERSATION_INDEX_EXCLUDED_TYPES = sql.literal(

0 commit comments

Comments
 (0)