Skip to content

fix: only ellipsize truncated subagent tool results - #1447

Closed
RealBhupesh wants to merge 2 commits into
Nano-Collective:mainfrom
RealBhupesh:fix/subagent-tool-ellipsis
Closed

RealBhupesh wants to merge 2 commits into
Nano-Collective:mainfrom
RealBhupesh:fix/subagent-tool-ellipsis

Conversation

@RealBhupesh

Copy link
Copy Markdown
Contributor

Fixes #1408.

The subagent transcript sliced every tool result to 100 characters and always appended .... Short results such as OK were shown as OK.... The ellipsis is now added only when the result was actually longer than the limit.

Test plan

  • tool-result-preview.spec.ts

Made with Cursor

Every tool result in the subagent transcript ended in "...", including
short results that were shown in full.

Fixes Nano-Collective#1408
@github-actions

Copy link
Copy Markdown
Contributor

No changeset found

This PR does not add a changeset, so it will not appear in the changelog or trigger a release.

If the change is user-facing, add one:

pnpm changeset

Pick a bump (patch / minor / major) and write the changelog entry in our usual voice ("Added X... Thanks to @you. Closes #123."), then commit the generated .changeset/*.md file.

If this PR is docs-only or a chore that needs no release note, you can ignore this — or run pnpm changeset --empty to record that intentionally.

@github-actions

Copy link
Copy Markdown
Contributor

nc-review: needs work — 1 blocking, 1 important, 1 nit

@RealBhupesh — there is a blocking item below.

PR #1447 fixes a real and accurately diagnosed bug: every tool-result line in subagent-view.tsx was unconditionally suffixed with ..., falsely implying truncation. The new formatSubagentToolResult helper correctly mirrors the guarded pattern already used in tools/git/git-commit.tsx (only append ... when content.length > limit), and both spec cases would catch a regression on either branch. However, this change ships without a changeset despite being a user-facing TUI fix, and open PR #1428 from another contributor ('fix: subagent view appends ellipsis only for long tool results') targets the same file, the same line, and almost certainly the same fix — a maintainer needs to pick one before either lands.

Possible duplicate of #1428 — worth checking before going further.

🔴 blocking · changeset · .changeset/

This is a user-facing change to how the subagent transcript renders tool results in the TUI — every short tool output is currently displayed with a spurious trailing ... and will visibly change after this lands. Per CONTRIBUTING.md ('Every user-facing PR includes a .changeset/*.md file') and the project rubric ('A user-facing change needs a changeset'), this needs a .changeset/<name>.md entry alongside the three source files in the diff. The package name in the changeset must match the workspace; a bot will leave a reminder otherwise.

🟠 important · duplicate · source/components/subagent-view.tsx

Open PR #1428 ('fix: subagent view appends ellipsis only for long tool results') from awhite0030 targets exactly this line in source/components/subagent-view.tsx:78 with the same fix shape (guard the ... on content.length > 100). Both titles describe the same one-line behavioural change to the same file; the issue (#1408) is the same one. A maintainer should compare the two diffs and merge only one — landing both would be redundant. Confidence is high but not absolute since I cannot read #1428's diff from here.

⚪ nit · design · source/components/tool-result-preview.ts

The new helper lives in source/components/ but is a pure string formatter with no UI dependency — colocating it next to a component is a mild smell, and the module name tool-result-preview (singular, generic) is broader than the single export formatSubagentToolResult. The file would fit just as well in source/utils/ or even inline in subagent-view.tsx. Not worth blocking on, but worth a glance.


🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional

Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with /re-review.

@github-actions github-actions Bot added the agent:needs-work nc-review found blocking findings label Sep 23, 2026
The subagent transcript passed a possibly undefined tool result into a
string formatter, which failed typecheck, tests, and the build. Empty
content is formatted as an empty result, and the new import is sorted.
@RealBhupesh

Copy link
Copy Markdown
Contributor Author

Closing this as superseded by #1423, which has merged the guarded ellipsis behavior and component regression coverage for #1408. No additional change is needed for the original issue. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:needs-work nc-review found blocking findings area:tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Subagent transcript view appends "..." to every tool result, even short ones that weren't truncated

1 participant