GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(client-runtime): feedback trace durations near 10 s no longer sho… · only21mil/t3code@ebdfe94

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/client-runtime/src
    • feedbackRequest.test.ts
    • feedbackRequest.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/client-runtime/src/feedbackRequest.test.ts‎

Copy file name to clipboardExpand all lines: packages/client-runtime/src/feedbackRequest.test.ts
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,24 @@ describe("feedback preview", () => {
7878
"Adds the text of your messages and the agent's replies in the last 2 turns.",
7979
);
8080
});
81+
82+
it("drops the decimal once a tool duration rounds to 10 seconds", () => {
83+
const lines = feedbackTraceLines({
84+
turns: 1,
85+
textTurns: 0,
86+
truncated: false,
87+
entries: [9_949, 9_960, 10_000].map((durationMs) => ({
88+
turn: 1,
89+
type: "tool" as const,
90+
tool: "shell",
91+
outcome: "ok" as const,
92+
durationMs,
93+
})),
94+
});
95+
expect(lines.map((entry) => entry.line)).toEqual([
96+
"Turn 1 · shell · ok · 9.9 s",
97+
"Turn 1 · shell · ok · 10 s",
98+
"Turn 1 · shell · ok · 10 s",
99+
]);
100+
});
81101
});
Collapse file

‎packages/client-runtime/src/feedbackRequest.ts‎

Copy file name to clipboardExpand all lines: packages/client-runtime/src/feedbackRequest.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ export function feedbackPreviewFields(
6868
].filter((field) => field.value !== "");
6969
}
7070

71-
const seconds = (ms: number) => `${(ms / 1_000).toFixed(ms < 10_000 ? 1 : 0)} s`;
71+
const seconds = (ms: number) => {
72+
const tenths = (ms / 1_000).toFixed(1);
73+
return `${Number(tenths) < 10 ? tenths : (ms / 1_000).toFixed(0)} s`;
74+
};
7275

7376
/** One line per outline entry, plus the message text that goes with it. */
7477
export function feedbackTraceLines(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.