feat(web): humanize tool-call rows with dynamic strings #5847
Closededuardosilveiradev(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/5847/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- apps/web/src/components/chat/MessagesTimeline.logic.ts lines 887 to 901Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -240,0 +877,21 @@877+ if (depth >= TOOL_INPUT_MAX_DEPTH) {878+ return `… (${value.length} items)`;879+ }880+ const kept = value881+ .slice(0, TOOL_INPUT_ARRAY_MAX_ITEMS)882+ .map((item) => boundToolInputValue(item, depth + 1));883+ const overflow = value.length - TOOL_INPUT_ARRAY_MAX_ITEMS;884+ return overflow > 0 ? [...kept, `… (+${overflow} more items)`] : kept;885+ }886+ if (value !== null && typeof value === "object") {887+ if (depth >= TOOL_INPUT_MAX_DEPTH) {888+ return "…";889+ }890+ return Object.fromEntries(891+ Object.entries(value as Record<string, unknown>).map(([key, item]) => [892+ key,893+ boundToolInputValue(item, depth + 1),894+ ]),895+ );896+ }897+ return value;
- @@ -1321,0 +1384,21 @@1384+ const input =1385+ asToolInputRecord(data.input) ??1386+ asToolInputRecord(item?.arguments) ??1387+ asToolInputRecord(state?.input) ??1388+ asToolInputRecord(data.rawInput);1389+1390+ const meta: ToolCallMeta = {};1391+ if (rawName) {1392+ const { server: mcpServer, name } = splitMcpToolName(rawName);1393+ meta.toolName = name;1394+ // Codex splits the MCP identity across `item.server` / `item.tool`.1395+ const server = mcpServer ?? asTrimmedString(item?.server);1396+ if (server) {1397+ meta.toolServer = server;1398+ }1399+ }1400+ if (input) {1401+ meta.toolInput = input;1402+ }1403+ return meta;1404+}@@ -240,0 +656,21 @@656+}657+658+function resolveToolCallSubject(entry: WorkLogEntry): ToolCallSubject | null {659+ if (entry.toolName) {660+ return {661+ toolName: entry.toolName,662+ ...(entry.toolServer !== undefined ? { toolServer: entry.toolServer } : {}),663+ ...(entry.toolInput !== undefined ? { input: entry.toolInput } : {}),664+ fromDetail: false,665+ };666+ }667+ const fromDetail = parseLegacyToolCallText(entry, entry.detail);668+ if (fromDetail) {669+ return { ...fromDetail.subject, fromDetail: true };670+ }671+ const fromLabel = parseLegacyToolCallText(entry, entry.label);672+ if (fromLabel) {673+ return { ...fromLabel.subject, fromDetail: false };674+ }675+ const fromTitle = toolNameFromTitle(entry.toolTitle);676+ return fromTitle ? { toolName: fromTitle, fromDetail: false } : null;
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
c9636aac-2a94-4128-8cf1-589a06475ebaYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share