Skip to content

fix: report CLI result truncation - #1647

Closed
danusha2345 wants to merge 6 commits into
colbymchenry:mainfrom
danusha2345:fix/1639-cli-truncation-metadata
Closed

danusha2345 wants to merge 6 commits into
colbymchenry:mainfrom
danusha2345:fix/1639-cli-truncation-metadata

Conversation

@danusha2345

@danusha2345 danusha2345 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #1639.

  • callers and callees JSON now include total, limit, and truncated; human output shows shown of total plus a widening hint.
  • query fetches one extra result to detect a cut. Its existing bare-array JSON stdout remains unchanged; a truncation notice is emitted on stderr, while human output gets the same notice on stdout.
  • Metadata is emitted unconditionally for callers/callees, including truncated: false for complete results.

Tests:

  • regression tests failed against the pre-fix build
  • npm run build
  • focused CLI tests (11 passed)
  • npm test (3055 passed, 187 skipped)

Follow-up: MCP answers (#1674)

codegraph_callers / codegraph_callees sliced their list at limit (default 20) with no marker, so an agent read a capped answer as the complete set (#1674, the same symptom over MCP). The flat list now ends with "Showing N of M callers; pass limit (up to 100) to widen", and each per-definition section gets "… +N more". Covered by __tests__/mcp-callers-truncation.test.ts; full suite green.

danusha2345 added 3 commits August 30, 2026 12:16
…ymchenry#1674)

The codegraph_callers and codegraph_callees answers sliced the list at
`limit` (default 20) with no marker, so a capped answer read as the
complete set and an agent under-counted "who calls this". Both the flat
list and the per-definition sections now say "showing N of M".
danusha2345 added 2 commits September 8, 2026 11:12
@danusha2345

Copy link
Copy Markdown
Contributor Author

Merged current main (3adf067, post-#1770) into this branch: head 106e363. The only conflict was the CHANGELOG entry; no source conflict. tsc clean, the branch's tests pass.

@danusha2345

Copy link
Copy Markdown
Contributor Author

Merged current main (43271f3) into this branch: head 6c0d31e. The only conflict was the CHANGELOG entry; no source conflict. tsc clean, the branch's tests pass.

@colbymchenry

Copy link
Copy Markdown
Owner

Thanks @danusha2345 — this fix is solid. #1647 was conflicted with main after #1771 (CHANGELOG only). I rebased/landed the same changes onto current main as #1772 (covers #1674 / #1639). Please close this PR in favor of #1772 when convenient.

@danusha2345

Copy link
Copy Markdown
Contributor Author

Closing in favor of #1772 — thanks for carrying it over.

@danusha2345 danusha2345 closed this Sep 8, 2026
colbymchenry added a commit that referenced this pull request Sep 8, 2026
Land #1647 onto current main: callers/callees/query (CLI + MCP) now say
when --limit hid matches, with totals in JSON and a widening hint. Also
covers #1639.

Co-authored-by: Colby McHenry <colbymchenry@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants