Skip to content

Commit be465c1

Browse files
committed
fix(server): acknowledge complete emoji result pages
1 parent 4146161 commit be465c1

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎apps/server/src/mcp/OrchestratorMcpService.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ function pageIncludesTerminalTaskResult(input: {
627627
if (!matchesResult) return false;
628628

629629
const text = turnItemText(row.item);
630-
return text !== null && text.length <= input.maxChars;
630+
return text !== null && text.length <= textPageEnd(text, 0, input.maxChars);
631631
});
632632
}
633633

‎apps/server/src/mcp/OrchestratorMcpToolkit.integration.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ describe("orchestrator MCP toolkit", () => {
195195
it.live.each([
196196
{ label: "distinct", result: queuedFollowupResult, latestSummary: queuedFollowupResult },
197197
{ label: "identical", result: delegatedResult, latestSummary: null },
198+
{ label: "emoji", result: "😀", latestSummary: "😀" },
198199
])("reports $label child results", ({ result, latestSummary }) =>
199200
Effect.scoped(
200201
Effect.gen(function* () {
@@ -616,7 +617,11 @@ describe("orchestrator MCP toolkit", () => {
616617
});
617618
const parentlessRead = yield* invoke(
618619
"t3_thread_read",
619-
{ threadId: delegated.childThreadId, limit: 100 },
620+
{
621+
threadId: delegated.childThreadId,
622+
limit: 100,
623+
maxCharsPerItem: result === "😀" ? 1 : 20_000,
624+
},
620625
{ ...invocation, thread: undefined },
621626
).pipe(Effect.withTracer(tracer));
622627
expect(parentlessRead.isError).not.toBe(true);
@@ -630,6 +635,7 @@ describe("orchestrator MCP toolkit", () => {
630635
const read = yield* invoke("t3_thread_read", {
631636
threadId: delegated.childThreadId,
632637
limit: 100,
638+
maxCharsPerItem: result === "😀" ? 1 : 20_000,
633639
}).pipe(Effect.withTracer(tracer));
634640
expect(read.isError).not.toBe(true);
635641
expect(transferReads.length).toBeGreaterThan(0);

0 commit comments

Comments
 (0)