Repository navigation
feat(native-chat): label Codex tool rows by what the command actually did - #18760
Conversation
… did Codex's app-server `commandExecution` item carries `commandActions`, which already classifies each command as a read, a search, or a directory listing with the target path, name, or query extracted. Orca ignored the field, so every shell call rendered as an undifferentiated row of raw argv. Read it and name the row by its class, keeping the raw command and cwd for the expanded view. Unclassified commands are untouched: absent, null, or malformed `commandActions` produces byte-identical output to before. Rank the search term above the command in the shared label keys so a classified search row reads by what it looked for rather than the shell text that ran it. No first-party tool input carries both keys today, so this only reaches the new rows; an MCP tool supplying both would prefer its search term. Note `commandActions` is the app-server spelling. `parsedCmd` is the rollout-file shape and never arrives on this lane; a test pins that it stays ignored.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe change classifies Merge Risk: 🟡 Moderate · up to This change improves native-chat tool labels and glyphs, but malformed or incomplete action data can still be presented with misleading classifications, malformed MCP-like names can receive an MCP glyph, and a reported test typecheck issue remains unresolved. These should be addressed before merge. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
ℹ️ One minor nitpick inline — the change itself is solid and well-tested.
Reviewed changes
- Codex
commandActionsclassification —commandItemnow reads Codex's owncommandActionsclassification and names each shell row by its class (read/search/list), liftingpath/query/nameintoinputwhile keeping the rawcommandandcwdfor the expanded view. - Shared label key reorder —
PRIMARY_ARG_KEYS/BRIEF_ARG_KEYSnow rankquery/patternabovecommand/cmdso a classified search row labels by its term rather than the raw shell text. - Unclassified fallback battery — absent,
null, non-array, all-unknown, and malformedcommandActions(including__proto__/constructorand the rolloutparsedCmdshape) fall back byte-identically to the existingshellrow.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Visual proof — structured Codex chat, live dev app (macOS)Same structured Codex session flow on both builds: Codex was asked to run Before (base
|
A row named only by a word makes the reader parse text to tell a read from a search. Pair the word with an icon: icon for category, word for action, argument for target. Name the full eight-category vocabulary in `src/shared/native-chat-tool-icon.ts` now — read/search/listFiles/unknown/fileChange/webSearch/mcpToolCall/ subAgentActivity — even though only the classified shell categories reach a row today, so the MCP and web-search rows landing separately inherit these names rather than coining their own. Glyph ids are the lucide spelling shared by `lucide-react` and `lucide-react-native`, so mobile can resolve one name to its own component when it adopts this; mobile rows stay text-only for now. The glyph is decorative and `aria-hidden`: the word is the accessible name, and never renders without it. One glyph per category, fixed across running, completed, and failed — a row that swapped icons on completion would read as changing identity — so the run header's active row also takes its category glyph instead of the generic wrench it fell back to once these rows stopped being called `shell`. A word outside the vocabulary gets the terminal glyph rather than a blank slot, so rows stay left-aligned. Also stand `.` in for a `listFiles` action whose `path` is null, which is what a bare `ls` sends. The row named the action and then showed the raw argv as its target; now it names the directory it listed.
… slot to 16/14 The header swapped its leading glyph on settle: the active tool's icon while running, a check once done. That is the identity swap a fixed per-category glyph exists to prevent — the row appeared to become a different thing when it finished. Name the header by the run's latest tool in both states and move the completion check to the trailing edge, where the rest of the state signal already lives. Size both header slots to the mock's 16px slot with a 14px glyph, matching the tool rows beneath them and the subagent summary row landing separately. They were 24/16, so the icon columns sat 8px apart and broke the left alignment the icon treatment depends on. The fixity test walks running, completed, and failed and pins the leading glyph of every row by lucide's own class name, so a swap shows up as a different name rather than a still-present icon.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: be535a0f-5249-43c6-9f76-f8d3f025a8c8
📒 Files selected for processing (7)
src/main/codex/codex-structured-item-translation.test.tssrc/main/codex/codex-structured-item-translation.tssrc/renderer/src/components/native-chat/NativeChatToolIcon.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.tsxsrc/shared/native-chat-tool-icon.test.tssrc/shared/native-chat-tool-icon.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
| if (classified === undefined) { | ||
| continue | ||
| } | ||
| const fields: Record<string, string> = { ...classified.fallback } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep malformed classified actions on the shell fallback.
When commandActions contains { type: 'read' } or { type: 'search', path: null, query: null }, this code returns the classified name with no usable fields. The row then renders read or search instead of the required raw shell label. Require at least one valid mapped field, or an intentional class fallback, before returning classified facts.
Suggested fix
const fields: Record<string, string> = { ...classified.fallback }
+ let hasUsableField = Object.keys(fields).length > 0
for (const key of classified.keys) {
const value = readString(record, key)
if (value !== null) {
fields[key] = value
+ hasUsableField = true
}
}
+ if (!hasUsableField) {
+ continue
+ }
return { name: classified.name, fields }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const fields: Record<string, string> = { ...classified.fallback } | |
| const fields: Record<string, string> = { ...classified.fallback } | |
| let hasUsableField = Object.keys(fields).length > 0 | |
| for (const key of classified.keys) { | |
| const value = readString(record, key) | |
| if (value !== null) { | |
| fields[key] = value | |
| hasUsableField = true | |
| } | |
| } | |
| if (!hasUsableField) { | |
| continue | |
| } | |
| return { name: classified.name, fields } |
There was a problem hiding this comment.
ℹ️ One minor suggestion inline — the glyph system and the
.stand-in are otherwise clean and well-tested (63 node-side + 14 renderer tests pass).
Reviewed changes
listFiles.stand-in — a barels(Codex sendspath: null) now emitspath: '.', so the row readslist .rather than a lone word.- Tool-row category glyphs — added a shared
native-chat-tool-icon.tsvocabulary mapping row words (read/search/list/shell/edit/web search) to lucide glyphs via aMap, plus a desktopNativeChatToolIconcomponent and a run-header active slot that resolve glyphs from it. - Running-row icon stability — a classified row keeps its category glyph while it runs so the icon doesn't swap to the generic wrench when it settles.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ The new commit is clean and well-tested — no new findings. This stays non-approving only because two prior minor suggestions remain open in their threads (the lifted
namekey and the mobile.link); both are cosmetic and non-blocking.
Reviewed changes
- Fixed the header glyph across states — the run header now derives its glyph from the run's latest tool in both active and settled states (
latestActiveCall ?? calls.at(-1)), so the leading icon no longer swaps to a check when the tool settles; completion moved to a trailing check mark. - Sized the header slot to match tool rows — the header icon slot is now
size-4/size-3.5(matchingNativeChatToolIcon) and markedaria-hidden. - Strengthened the renderer test —
leadingGlyphsasserts the leading glyph is identical acrossrunning/completed/failed, rather than spot-checking a single state.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Conflict: `NativeChatToolRun.tsx`. Main deleted the local `COMMAND_TOOL_NAMES` set and `normalizedToolName`, and now selects the active call through `selectActiveToolCall`, so the header glyph is rebuilt on that structure: `isCommandToolName` for the uncategorized branch and `findLast(isToolCallBlock)` for the run's latest call, in place of the removed locals and the `calls` array.
…and doesn't support Three claims the `commandActions` row model was making on its own: - `listFiles` with a null path was given `path: '.'`. Codex sends null for a recursive walk and for the repo root, and the invented path flows into `createToolInputDisplay().filePath`, which mobile turns into a tappable "open file" link onto a directory — an affordance that can only fail. The row now keeps the raw command, which is what the label logic already falls back to. - A command whose actions classify as two different things (`cat a.txt && ls src`) was named after the first one, silently dropping the rest. Recognized actions must now agree on one class; a repeat of one class keeps the class and only a target every entry names. - `read` lifted `name` into the journal payload, where no label ever reads it — `path` always wins — so it was bounded weight carrying nothing.
…terminal The row-word vocabulary named seven words, and everything else fell through to the terminal glyph — which reads as "a shell ran here" for rows where nothing says one did. Codex's own `apply_patch` row, `Grep`/`Glob`/`Task`/`WebFetch`/ `TodoWrite`, and every `mcp__*` tool all rendered a terminal, leaving the declared `mcpToolCall` and `subAgentActivity` categories unreachable. - Split the vocabulary: `unknown` stays the shell command Codex could not classify and keeps the terminal, while a new `other` carries the generic wrench that unmodelled words now fall back to. - Read the edit family from `EDIT_TOOL_NAMES` and the command tools from `isCommandToolName` rather than restating either. Command tools resolve first: `isEditToolName` counts `shell`/`exec` as possible patch carriers, and a shell row is not an edit. - Result rows get no category glyph. Their word is `translate(…, 'Result')`, so keying a category off it resolved a different glyph per locale; an empty slot keeps the rows aligned. - The header and the row now resolve through `NativeChatToolIcon`, so one `Grep` run can no longer show a wrench in the header and a terminal on its line. The glyph map and the unused `category` prop go with the duplication.
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline about a search-row edge case the new aggregation can produce.
Reviewed changes
- Retired the
readnamekey —readnow lifts onlypath, soinput.nameno longer lingers as dead data no label reads. - Dropped the
listFiles.stand-in — a barelsno longer inventspath: '.', keeping the raw command as the honest label and avoiding the mobile open-file dead link. - Aggregated multi-action commands —
commandActionFactsnow requires every classified action to agree on a class (intersecting their fields), socat a.txt && ls srcstays ashellrow instead of being named after one half. - Split
unknown(terminal) fromother(wrench) — unmodelled tool rows now take a generic wrench rather than asserting a shell ran, andtodoList/list-checksjoined the vocabulary; Claude-lane row words and the edit family resolve from shared sets rather than a parallel list. - Unified header/row glyph resolution — the run header and its rows resolve glyphs through the same
NativeChatToolIcon, and result rows render an empty slot so a translatedResultword carries no category glyph.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Every Codex fileChange item projects to a tool call named `Diff`, which the edit set does not name — it names the tools that carry the edit in their own input. So a run whose body renders an edited-file card was headed by the generic wrench.
Fresh visual proof at
|
| row | glyph | note |
|---|---|---|
read /…/scratch/notes.txt |
eye | from sed -n '1,200p' notes.txt, path lifted from commandActions |
search beta |
magnifier | from rg -n --no-heading beta ., query lifted |
list /bin/zsh -lc ls |
folder | bare ls: class is right, argument falls back to the raw command because Codex sends no path — deliberate, not a bug |
shell /bin/zsh -lc 'echo hello-from-qa .' |
terminal | unclassified, stays a shell row showing raw argv |
Result … |
(none) | result rows get an empty slot, which is what keeps the column aligned |
Full window for context:
2. Collapsed run header — the glyph does not change when the run settles
Same single-command run, caught while active and again after it settled.
Active:
Settled:
The leading terminal glyph is identical in both states; completion reads as the trailing check mark,
and the header glyph matches the row it names.
Full windows: active ·
settled
3. Claude lane — the wider glyph vocabulary
Read = eye · Bash = terminal · WebFetch = globe · ToolSearch (a tool this vocabulary does not
model) = wrench, not a terminal · the edit folds into its own diff card · result rows carry no glyph.
The run header takes the globe of the last row it names, plus the trailing check.
Full window:
What is not shown, and why
bot(Task / sub-agent) andlist-checks(TodoWrite) were not captured. In this build a Task
sub-agent's prompt renders as an inline user message rather than aTasktool row, andTodoWrite,
Grep,GlobandBashOutputare not present in the running Claude toolset — so no row with those
words was ever emitted. Pre-existing, unrelated to this PR.plug(MCP) was not exercised — no MCP server was configured in the QA workspace.- The
search= magnifier case is shown on the Codex side above, which covers the same category
Grep/Globwould have taken. - Rig note: the dev renderer needed a QA-only Vite shim to boot, for a pre-existing dev-only issue on
origin/main(the renderer module graph reachesshared/process-table-snapshot-reader, which is
node-only). It is unrelated to this PR and touches none of the code under test. - Head moved right after capture. Every image above was taken against
7115f083972(last capture
01:43 local);9b684266bbdand2916f81b076landed at 01:46. Those two add thediff→ file-change
glyph and route a classifiedlistFilestarget throughdirectory, neither of which is pictured here.
The bare-lsrow shown above still falls back to the raw command at the newer head, and rows 1–3 above
are otherwise unaffected.
…o open
A listFiles action's path is a directory, and a search action's path is the
root it scanned. Lifted under `path`, both became the row's file target, which
mobile renders as a tappable open-file link that can only fail — the same dead
link the removed `{ path: '.' }` stand-in would have produced. They lift to
`directory` instead, which still labels the row but is never a file target.
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: fd828ec2-027c-4cf7-985f-ae7fc124e134
📒 Files selected for processing (10)
src/main/codex/codex-structured-item-translation.test.tssrc/main/codex/codex-structured-item-translation.tssrc/renderer/src/components/native-chat/NativeChatToolIcon.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.test.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.tsxsrc/shared/native-chat-diff.tssrc/shared/native-chat-tool-icon.test.tssrc/shared/native-chat-tool-icon.tssrc/shared/native-chat-tool-summary.test.tssrc/shared/native-chat-tool-summary.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/shared/native-chat-tool-summary.test.ts
- src/renderer/src/components/native-chat/NativeChatToolRun.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| * vocabulary doesn't model yet. */ | ||
| export function nativeChatToolCategory(rowWord: string): NativeChatToolCategory | null { | ||
| const word = rowWord.trim().toLowerCase() | ||
| if (word.startsWith(MCP_TOOL_PREFIX)) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Validate the complete MCP row format.
AgentJournalItemBodySchema accepts any tool-call name, and the projection passes it to NativeChatToolIcon. Therefore mcp__, mcp__server, and mcp__server__ can reach nativeChatToolCategory() and render plug instead of the wrench fallback. Require non-blank server and tool segments before returning mcpToolCall, and add regression cases for these values.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Remapped the scan-root / listed-directory field off
path—searchandlistFilesnow lift Codex'spathinto adirectoryinput key, which no label helper reads as a file target, closing the mobile open-file dead link without inventing a target. - Ranked
directoryas a label key —PRIMARY_ARG_KEYS/BRIEF_ARG_KEYSgaindirectoryso a term-less search or listing still renders its scan root / target as the row label, never as a tappable link. - Gave the projected
Diffrow its file-change glyph —diffjoinsCATEGORY_BY_ROW_WORDasfileChange, so an edited-file card is headed by a pencil rather than the generic wrench.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Mobile's run header picks between a terminal and a generic glyph by tool name. Now that the host publishes `read`/`search`/`list` for the same commands it used to publish as `shell`, that name check answers false and a command that really ran heads its run with a wrench. Ask the shared category vocabulary instead. Mobile keeps its two icons — porting the full glyph set is a separate lane.
The comment claimed the header names the same tool in both states, so its glyph cannot change on settle. It can: the live header names the running call while the settled one names the run's last tool call, and with out-of-order completion those differ. The glyph is fixed for whichever tool the header names — say that, and drop the never-taken running branch from the settled header's call. Also pin the other half of the file-target rule: `read` keeps `path`, so its row stays tappable, where `list`/`search` lift a folder to `directory` and offer no target at all.
`exec` and `local_shell` are what the Codex rollout transcript names a shell call — `native-chat-edit-normalize` already treats those three words as the command tools — but the activity set the glyph vocabulary reuses carries neither, so both rows headed a real command with the generic-tool wrench. Named in the vocabulary rather than in that activity set, because that set also picks the running row's copy and this is only about the glyph.
… word Codex now names a classified shell row `read` / `search` / `list`, which lowercase to Claude's own `Read` / `Grep` / `Glob`. Mobile has only a terminal and a wrench, so keying that choice on the row word gave Claude's filesystem tools a terminal for a shell that never ran. The input separates them: Codex keeps the raw command on a classified row, while Claude's `Read` carries only a file path. `isShellActivityToolCall` replaces `isShellActivityToolRow` and asks the command tool names first, then the call's input.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Mobile terminal glyph via the category vocabulary —
MobileNativeChatToolRunnow keys its active-row glyph offisShellActivityToolRowinstead ofisCommandToolName, so Codex's classifiedread/search/listrows read as terminal activity on mobile rather than a generic wrench. - Settled header glyph guarantees — the run header now names
settledHeaderCall(blocks.findLast(isToolCallBlock)) and renders a category glyph with a trailing check, clarifying that only the settled header reads it while the live header still nameslatestActiveCall. - Rollout-transcript command names —
execandlocal_shelljoinCATEGORY_BY_ROW_WORDasunknown, so the Codex rollout-transcript names for a shell call (already recognized bynative-chat-edit-normalize) resolve to the terminal glyph instead of a wrench.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Keyed the mobile terminal glyph off the call's input, not its word —
isShellActivityToolRow(word)becameisShellActivityToolCall({ name, input }), resolving the tie between Codex's classifiedread/search/list(which keep thecommandthey ran) and Claude'sRead/Grep/Glob(which carry no command), so the two-glyph mobile lane no longer shows a terminal for a Claude filesystem tool. - Exposed
toolInputCommand— a helper innative-chat-tool-summary.tsthat returns the shell command a call's input carries (command/cmd, string or argv), backed by a battery of shape/null/blank tests pinning that only a real command claims the terminal.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The settled run header drew the glyph of the run's last tool call while the text beside it summarizes the run's first three, so a ten-call run ending in a `read` showed an eye above "shell npm test · shell git status · …" — a category the summary never described. Resolve the header's glyph from every call in the run instead: the shared category's glyph when all agree, the generic tool glyph when the run spans categories, and no glyph when there are no tool calls. The running header still names the active call, whose glyph is true of it.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Settled-header glyph now speaks for the whole run —
nativeChatToolRunCategory/nativeChatToolRunIconNamereduce a run to the single category every tool call shares, so a settled header (whosesummarytext lists the run's first calls) no longer heads with whichever call finished last viafindLast. A run spanning categories falls back to the generic wrench; a run with no tool call heads with no glyph at all. - Extracted the shared glyph slot —
NativeChatGlyphSlotnow backs bothNativeChatToolIcon(row / active call) and the newNativeChatToolRunIcon(settled header), so a category can never draw two different glyphs. - Pinned the behavior on both sides — six renderer tests assert the read / shell / spanning / single-call / no-call / active-call header glyphs, and six node tests assert the shared-category reduction (including unmodelled-tool runs and the empty case).
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Review loop complete — merge-readyFull review loop on this PR: readiness-checklist at open and close, five review-and-fix loops, and a live-app visual capture. Head moved The original design held up and was kept: read Blocker cleared firstThe branch was CONFLICTING with CI was also red on typecheck at one point — a test fixture missing a required Defects found and fixed
Also dropped a Verification
Visual proofLive-session screenshots are attached above, captured from real Codex and Claude sessions in a dev build of this branch — not renderer-driven fixtures. Provenance, for accuracy: they were captured by a subagent driving the app over CDP directly, not by a separate QA agent. One caption there is now stale: it describes the settled header taking the last row's glyph, which is exactly what fix #8 changed. The rest still holds. Deliberately deferred
|
… did (stablyai#18760) * feat(native-chat): label Codex tool rows by what the command actually did Codex's app-server `commandExecution` item carries `commandActions`, which already classifies each command as a read, a search, or a directory listing with the target path, name, or query extracted. Orca ignored the field, so every shell call rendered as an undifferentiated row of raw argv. Read it and name the row by its class, keeping the raw command and cwd for the expanded view. Unclassified commands are untouched: absent, null, or malformed `commandActions` produces byte-identical output to before. Rank the search term above the command in the shared label keys so a classified search row reads by what it looked for rather than the shell text that ran it. No first-party tool input carries both keys today, so this only reaches the new rows; an MCP tool supplying both would prefer its search term. Note `commandActions` is the app-server spelling. `parsedCmd` is the rollout-file shape and never arrives on this lane; a test pins that it stays ignored. * feat(native-chat): give tool rows a category glyph beside their word A row named only by a word makes the reader parse text to tell a read from a search. Pair the word with an icon: icon for category, word for action, argument for target. Name the full eight-category vocabulary in `src/shared/native-chat-tool-icon.ts` now — read/search/listFiles/unknown/fileChange/webSearch/mcpToolCall/ subAgentActivity — even though only the classified shell categories reach a row today, so the MCP and web-search rows landing separately inherit these names rather than coining their own. Glyph ids are the lucide spelling shared by `lucide-react` and `lucide-react-native`, so mobile can resolve one name to its own component when it adopts this; mobile rows stay text-only for now. The glyph is decorative and `aria-hidden`: the word is the accessible name, and never renders without it. One glyph per category, fixed across running, completed, and failed — a row that swapped icons on completion would read as changing identity — so the run header's active row also takes its category glyph instead of the generic wrench it fell back to once these rows stopped being called `shell`. A word outside the vocabulary gets the terminal glyph rather than a blank slot, so rows stay left-aligned. Also stand `.` in for a `listFiles` action whose `path` is null, which is what a bare `ls` sends. The row named the action and then showed the raw argv as its target; now it names the directory it listed. * fix(native-chat): hold the tool run header's glyph fixed and size its slot to 16/14 The header swapped its leading glyph on settle: the active tool's icon while running, a check once done. That is the identity swap a fixed per-category glyph exists to prevent — the row appeared to become a different thing when it finished. Name the header by the run's latest tool in both states and move the completion check to the trailing edge, where the rest of the state signal already lives. Size both header slots to the mock's 16px slot with a 14px glyph, matching the tool rows beneath them and the subagent summary row landing separately. They were 24/16, so the icon columns sat 8px apart and broke the left alignment the icon treatment depends on. The fixity test walks running, completed, and failed and pins the leading glyph of every row by lucide's own class name, so a swap shows up as a different name rather than a still-present icon. * fix(codex): stop a classified shell row from asserting facts the command doesn't support Three claims the `commandActions` row model was making on its own: - `listFiles` with a null path was given `path: '.'`. Codex sends null for a recursive walk and for the repo root, and the invented path flows into `createToolInputDisplay().filePath`, which mobile turns into a tappable "open file" link onto a directory — an affordance that can only fail. The row now keeps the raw command, which is what the label logic already falls back to. - A command whose actions classify as two different things (`cat a.txt && ls src`) was named after the first one, silently dropping the rest. Recognized actions must now agree on one class; a repeat of one class keeps the class and only a target every entry names. - `read` lifted `name` into the journal payload, where no label ever reads it — `path` always wins — so it was bounded weight carrying nothing. * fix(native-chat): give an unmodelled tool row a generic glyph, not a terminal The row-word vocabulary named seven words, and everything else fell through to the terminal glyph — which reads as "a shell ran here" for rows where nothing says one did. Codex's own `apply_patch` row, `Grep`/`Glob`/`Task`/`WebFetch`/ `TodoWrite`, and every `mcp__*` tool all rendered a terminal, leaving the declared `mcpToolCall` and `subAgentActivity` categories unreachable. - Split the vocabulary: `unknown` stays the shell command Codex could not classify and keeps the terminal, while a new `other` carries the generic wrench that unmodelled words now fall back to. - Read the edit family from `EDIT_TOOL_NAMES` and the command tools from `isCommandToolName` rather than restating either. Command tools resolve first: `isEditToolName` counts `shell`/`exec` as possible patch carriers, and a shell row is not an edit. - Result rows get no category glyph. Their word is `translate(…, 'Result')`, so keying a category off it resolved a different glyph per locale; an empty slot keeps the rows aligned. - The header and the row now resolve through `NativeChatToolIcon`, so one `Grep` run can no longer show a wrench in the header and a terminal on its line. The glyph map and the unused `category` prop go with the duplication. * fix(native-chat): give the projected Diff row the file-change glyph Every Codex fileChange item projects to a tool call named `Diff`, which the edit set does not name — it names the tools that carry the edit in their own input. So a run whose body renders an edited-file card was headed by the generic wrench. * fix(codex): stop a classified shell row offering a folder as a file to open A listFiles action's path is a directory, and a search action's path is the root it scanned. Lifted under `path`, both became the row's file target, which mobile renders as a tappable open-file link that can only fail — the same dead link the removed `{ path: '.' }` stand-in would have produced. They lift to `directory` instead, which still labels the row but is never a file target. * fix(mobile): keep the terminal glyph on a classified Codex shell row Mobile's run header picks between a terminal and a generic glyph by tool name. Now that the host publishes `read`/`search`/`list` for the same commands it used to publish as `shell`, that name check answers false and a command that really ran heads its run with a wrench. Ask the shared category vocabulary instead. Mobile keeps its two icons — porting the full glyph set is a separate lane. * fix(native-chat): say what the run header's glyph actually guarantees The comment claimed the header names the same tool in both states, so its glyph cannot change on settle. It can: the live header names the running call while the settled one names the run's last tool call, and with out-of-order completion those differ. The glyph is fixed for whichever tool the header names — say that, and drop the never-taken running branch from the settled header's call. Also pin the other half of the file-target rule: `read` keeps `path`, so its row stays tappable, where `list`/`search` lift a folder to `directory` and offer no target at all. * fix(native-chat): give a rollout-transcript shell row the terminal glyph `exec` and `local_shell` are what the Codex rollout transcript names a shell call — `native-chat-edit-normalize` already treats those three words as the command tools — but the activity set the glyph vocabulary reuses carries neither, so both rows headed a real command with the generic-tool wrench. Named in the vocabulary rather than in that activity set, because that set also picks the running row's copy and this is only about the glyph. * fix(mobile): pick the run-header glyph from the call's input, not its word Codex now names a classified shell row `read` / `search` / `list`, which lowercase to Claude's own `Read` / `Grep` / `Glob`. Mobile has only a terminal and a wrench, so keying that choice on the row word gave Claude's filesystem tools a terminal for a shell that never ran. The input separates them: Codex keeps the raw command on a classified row, while Claude's `Read` carries only a file path. `isShellActivityToolCall` replaces `isShellActivityToolRow` and asks the command tool names first, then the call's input. * fix(native-chat): give the projected diff fixture its required digest * fix(native-chat): head a settled run with a glyph the whole run shares The settled run header drew the glyph of the run's last tool call while the text beside it summarizes the run's first three, so a ten-call run ending in a `read` showed an eye above "shell npm test · shell git status · …" — a category the summary never described. Resolve the header's glyph from every call in the run instead: the shared category's glyph when all agree, the generic tool glyph when the run spans categories, and no glyph when there are no tool calls. The running header still names the active call, whose glyph is true of it. --------- Co-authored-by: Merge Sim <sim@local>




What
Codex's app-server
commandExecutionitem carriescommandActions— Codex has already classified each command as a read, a search, or a directory listing, with the target path, name, or query extracted. Orca ignored the field entirely, so every shell call rendered as an undifferentiated row of raw argv.This reads it and names the row by its class.
shell sed -n '1,200p' notes.txtread notes.txtshell rg -n --no-heading beta .search betashell lslist ls(class named, command kept — see below)The raw command and cwd are kept for the expanded view — this changes the collapsed row label only.
Field provenance
commandActionsis the app-server spelling, confirmed against live captured frames fromcodex app-server0.152.1:{"type":"read", "command":"sed -n '1,200p' notes.txt", "name":"notes.txt", "path":"/…/notes.txt"} {"type":"search", "command":"rg -n --no-heading beta .", "query":"beta", "path":"."} {"type":"listFiles", "command":"ls", "path":null}parsedCmdis the rollout-file shape and never arrives on this lane. An earlier draft of this change readparsedCmdand was therefore inert in production; a test now pins that the rollout shape stays ignored so it can't be reintroduced.Note the tag is
listFiles, camelCase — notlist_files.Verified in the running app
Captured before/after in a real structured Codex session (see the proof comment below).
readandsearchreproduce exactly.listFilesdoes not fully reduce. Codex sends it withpath: nullfar more often than just for a barels— captured off the wire fromcodex app-server0.152.1:So the row keeps the class and falls back to the raw command, reading
list /bin/zsh -lc ls.Nothing is invented for the missing target. Those three targets are a directory, a recursive walk
and the repo root — a null target is not evidence the target is the cwd, so this row model does
not guess. A revision in between did stand
.in for it; that has been removed, because thelifted
pathbecomescreateToolInputDisplay(...).filePath, which mobile renders as a tappable"open file" link — pointing it at a directory produces only a "couldn't open" toast, on rows that
were never tappable before this PR.
A command whose actions classify as two different things (
cat a.txt && ls src→[read, listFiles]) stays an unclassifiedshellrow showing the whole command, rather than beingnamed after one half and silently dropping the other. One class run twice keeps the class and only
a target every entry agrees on.
Classification is also Codex-side and phrasing-sensitive:
sed -n '1,$p' README.mdwas notclassified and correctly stayed a raw
shellrow. That is the intended "unclassified untouched"contract, but it means the improved labels depend on Codex recognising the command.
Row glyphs
Each row gets a lucide glyph beside its word — icon + text, never icon-only: the word carries
the accessible name and the glyph is
aria-hidden. One glyph per category, fixed acrossrunning/completed/failed, so a row never reads as changing identity when it settles; state rides on
tone plus a trailing mark. An ablation test pins that.
The vocabulary separates two different "we don't know" cases:
unknown→ terminal, for a shell command Codex could not classify. That glyph is a fact aboutthe row.
other→ wrench, the fallback for a tool word this vocabulary doesn't model. Claiming a terminalthere asserted a shell ran when nothing said one did — which is what
apply_patch,Grep,Glob,Task,WebFetch,TodoWriteand everymcp__*tool used to render.The edit family comes from
EDIT_TOOL_NAMESand the command tools fromisCommandToolNameratherthan a parallel list; command tools resolve first, since
isEditToolNamecountsshell/execaspossible patch carriers and a shell row is not an edit. Result rows get no category glyph at all —
their word is the translated
Resultstring, so keying a category off it would have resolved adifferent glyph per locale. The run header and the row it names resolve through the same component,
so one
Greprun can no longer show a wrench in the header and a terminal on its line.Safety
nameisz.string(),inputisz.unknown().optional().null, non-array, all-unknown, and malformedcommandActionsall fall back to the existingshellrow. Pinned by atoEqualbattery.Map, not an object: a{type:'__proto__'}wire payload against an object would return a truthy non-string, which would be written as the journal body'snameand parse as a MALFORMED row. Pinned by test.Shared-key reorder
PRIMARY_ARG_KEYS/BRIEF_ARG_KEYSinsrc/shared/native-chat-tool-summary.tsnow rankquery/patternabovecommand/cmd. Without this a classified search row would be renamed but still labelled with the raw shell text.This file is shared with the Claude lane and mobile, but the change is effectively scoped: Claude's Grep/Glob carry
patternwith nocommand, Bash/SlashCommand carrycommandwith no search key, WebSearch carriesqueryalone. No first-party tool input carries both keys — these new search rows are the first. An MCP tool supplying both would prefer its search term; label ranking only, no data loss.Ablation: reverting the key order reddens exactly one test — the one that names the mechanism.
A classified
listorsearchlifts its target underdirectory, notpath.pathis whatnormalizedToolFilePathreads as a file target, and mobile turns a non-nullfilePathinto atappable "open file" link — so lifting a scan root or a listed folder under
pathhanded mobile alink onto a directory, which can only fail.
readstill liftspath, so a file row stays tappable.directoryis ranked afterquery/patternand beforecommand/cmd, and is the only producerof that key in the repo.
Mobile
mobile/src/session/MobileNativeChatToolRun.tsxhas a two-glyph run header and chose between themwith
isCommandToolName(activeCall.name). Renaming the row fromshelltoread/search/listturned that predicate false, so a command that really ran started heading with a wrench.
The row word alone can't settle it — Codex's class word
readand Claude's toolReadare the samestring once lowercased, and only one of them ran a command. The call's input breaks the tie:
Codex keeps the raw command on a classified row, Claude's
Readcarries only a file path. SoisShellActivityToolCallanswers onisCommandToolName(name) || toolInputCommand(input) !== null,which restores every pre-PR answer — including Claude's
Read/Grep/Globkeeping their wrench.Mobile still imports exactly the two icons it already had; porting the per-category vocabulary to
mobile is a separate lane and is not in this PR.
Run header
The settled header's glyph describes the whole run, because the text beside it does:
summarizeToolRunspeaks for the run's first calls, so a glyph taken from the last one asserted a category the summary
didn't describe. A run whose calls all share a category heads with that category's glyph; a run that
spans categories heads with the generic tool glyph rather than picking a side. The running header is
unchanged — it names the active call, so that call's glyph is the right one.
Tests
115 passing across the four changed test files, on top of the
origin/mainmerge. Covers each class,the search-label mechanism, the command-only unchanged case, the heterogeneous-actions fallback, the
null-path row (asserting
filePathis null, which is the mobile dead-link guard), the glyphvocabulary per category, the header/row agreement, the run-spanning-categories header, the
glyph-fixed-across-states ablation, and the full unclassified-fallback battery including
__proto__/constructorand theparsedCmdrollout shape.Not in scope
summarizeToolRunclass-aggregate rewrite ("Read 4 files, changed 2 files, and ran 3 commands"),deferred to its own PR after this one proves the classification lands.
falls back to
shellrather than naming itself after a part.🤖 Generated with Claude Code