Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/server/src/provider/acp/AntigravityChildWork.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,14 @@ it.layer(NodeServices.layer)("readAntigravityChildWork", (it) => {

it.effect("reads only the tail of a large transcript", () =>
Effect.gen(function* () {
const stepPrefix = "x".repeat(3_999);
const toolPrefix = "y".repeat(990);
const filler = JSON.stringify({
step_index: 0,
type: "VIEW_FILE",
status: "DONE",
content: "x".repeat(10_000),
content: stepPrefix + "🚀" + "x".repeat(6_000),
tool_calls: [{ name: "fixture", args: { text: JSON.stringify(toolPrefix + "🚀") } }],
});
const { profile } = yield* makeProfile({
steps: autoApproved,
Expand All @@ -235,7 +238,10 @@ it.layer(NodeServices.layer)("readAntigravityChildWork", (it) => {
expect(child?.truncated).toBe(true);
expect(child?.steps?.length).toBeLessThan(40);
expect(child?.steps?.at(-1)?.text).toBe("marker 4242 found");
expect(child?.steps?.[0]?.text?.length).toBeLessThanOrEqual(4_001);
expect(child?.steps?.[0]).toMatchObject({
text: stepPrefix + "…",
toolCalls: [{ input: `{"text":"${toolPrefix}…` }],
});

const lastLine = JSON.stringify(transcriptLines[3]) + "\n";
const step = { step_index: 2, type: "VIEW_FILE", content: "" };
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/provider/acp/AntigravityChildWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ const toolArguments = (args: unknown) =>
: (args ?? {});

const capText = (value: string, limit: number) =>
value.length <= limit ? value : `${value.slice(0, limit)}…`;
value.length <= limit ? value : `${value.slice(0, limit).replace(/[\uD800-\uDBFF]$/u, "")}…`;

/** Skips the runtime's opening envelope around the launch prompt the view already shows. */
function transcriptSteps(
Expand Down
Loading