Skip to content

fix(ui): only ellipsis subagent tool results that were truncated - #1423

Merged
akramcodez merged 2 commits into
Nano-Collective:mainfrom
insuffer:fix/subagent-transcript-ellipsis
Sep 28, 2026
Merged

akramcodez merged 2 commits into
Nano-Collective:mainfrom
insuffer:fix/subagent-transcript-ellipsis

Conversation

@insuffer

Copy link
Copy Markdown
Contributor

What

The subagent transcript view (source/components/subagent-view.tsx) sliced
every tool result to 100 characters and appended ... unconditionally:

message={`⚒ ${msg.name}: ${msg.content.slice(0, 100)}...`}

A short result like OK therefore rendered as OK..., implying output
was cut off when nothing was. The ellipsis belongs only on results that
were actually truncated.

Change

One guard in the same shape as the pattern already used in
source/tools/git/git-commit.tsx:

message={`⚒ ${msg.name}: ${
  msg.content.length > 100
    ? `${msg.content.slice(0, 100)}...`
    : msg.content
}`}

Plus two regression tests in source/components/subagent-view.spec.tsx:
a short result renders without the ellipsis, and a result past the limit
keeps it.

Verification

pnpm run test:ava source/components/subagent-view.spec.tsx
-> 5 tests passed (3 existing + 2 new)

The new short-result test fails on the unpatched component (verified by
reverting the one-line change and re-running), so it pins the fix rather
than passing either way.

Repo gates on this commit:

pnpm test:format -> pass (biome check, 536 files)
pnpm test:types  -> pass (tsc --noEmit)
pnpm test:lint   -> pass (biome lint)
pnpm test:knip   -> pass

Full-suite comparison (pnpm test:ava): the suite fails in the local
environment for reasons unrelated to this change (the cli-integration
specs need a built dist/, plus an Ink ESM interop issue on Node 24).
Baseline main and this branch produce an identical failure signature
(128 tests, 20 hooks, 10 uncaught exceptions, 14 skipped), and no
subagent-view test is among the failures.

Closes #1408

The subagent transcript sliced every tool result to 100 characters and
appended "..." unconditionally, so a short result like "OK" rendered as
"OK..." and implied output that was never cut. Append the ellipsis only
when the content is actually past the limit, matching the guarded
pattern already used in tools/git/git-commit.tsx.

Regression tests cover both sides: a short result renders without the
ellipsis, and a result past the limit keeps it.
@github-actions github-actions Bot added the area:tui Terminal UI label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

nc-review: comments — 1 important

@insuffer — a few things worth a look, none blocking.

Correct, minimal fix for issue #1408: the subagent-view tool line now mirrors the guarded length > 100 pattern from source/tools/git/git-commit.tsx, and two regression tests pin both branches (short content renders without ..., long content still gets it). One missing piece: this is a user-facing bug fix and the diff ships no .changeset/*.md, which CONTRIBUTING.md requires.

🟠 important · changeset · .changeset/

This is a user-facing bug fix (fix(ui): only ellipsis subagent tool results that were truncated) and per CONTRIBUTING.md ("Releasing a New Version") and the project rubric ("A user-facing change needs a changeset") it needs a .changeset/*.md entry. The diff as given only touches source/components/subagent-view.tsx and its spec; no changeset file is included. Without one the change ships silently in the next release and the bot leaves a stale reminder, and the project rubric specifically calls out a wrong package name in a changeset as a foot-gun for release-prepare later — so just adding an entry now avoids both.


🔴 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:comments nc-review left non-blocking findings label Sep 21, 2026
@insuffer

Copy link
Copy Markdown
Contributor Author

Thanks for the automated review — I've added .changeset/subagent-tool-result-ellipsis.md (@nanocollective/nanocoder, patch) as requested, in a second commit on this branch. The Pull Request Automated Checks run is waiting for fork approval — could a maintainer approve it so the full check suite can validate? Thanks!

@akramcodez
akramcodez merged commit 21833d0 into Nano-Collective:main Sep 28, 2026
16 checks passed
@akramcodez

Copy link
Copy Markdown
Member

Thanks for the PR @insuffer

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

Labels

agent:comments nc-review left non-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

2 participants