Repository navigation
fix(chat): every list read pages, with totals, so Chat reads all a page shows - #2448
Merged
Merged
Conversation
…ge shows
Chat read 10 of 451 signals, 25 prompts, 20 of each 100 mentions and 5
reports, with no total and no way to read on, and a result cut for size
came back as "{list}_more", which the model turned into "38 actions are
missing". Every list read now pages the way list_action_center_tasks
does since ansvisor#2420:
- Each list read takes limit (50 by default and at most) and offset, and
returns total (every match), offset, next_offset (null on the last
page) and a note ("Showing 1–50 of 451 signals, newest first. Read the
next page with offset 50, or say how many you judged."). Shared helpers
in lib/mcp/list-page.ts and chat/registry/list-paging.ts.
- Reads: list_brands, list_prompts, get_prompt_performance,
list_prompt_suggestions, get_prompt_volumes, list_topics, list_mentions,
list_citations (one offset pages domains and pages), list_competitors,
get_site_audit_summary, list_signals, get_action_history,
list_content_opportunities, list_drafts, get_reports and
get_ads_opportunities. Each keeps its filters; descriptions state the
real default.
- Database lists count on the server and read a range (new …PageFor
reads beside the MCP functions, which keep their shape); an offset past
the end is an empty page with the total. list_mentions reads any answer
by offset over mentions_list's own paging, not 20 of each 100.
- list_signals reads the Signals page's window (detected by its end, open
or resolved after its start) over the run's period, in compact rows:
title and description in the page's words, where, and the actions
built on it (lib/mcp/signal-page.ts).
- scope.ts treats any read with an offset as paged: no probe row, 50 a
page. Each page gets a 20,000-character share (PAGE_CHARS).
- fitResult cuts a page over its share into a shorter page whose
next_offset and note say where to read on: never "{list}_more".
- Every read stays limited to the caller's organization and brand access
(brand-scope test covers each new page read).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
# Conflicts: # web/src/lib/help/approved-articles.json
This was referenced Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chat read only part of a list. It saw 10 of 451 signals, 25 prompts and 20 of every 100 mentions. It got no total and had no way to read on. A result cut for size came back as
{list}_more, and the model turned that into "38 actions are missing".Every list read now pages the way Actions does since #2420. Each page:
A page cut for size stays a page, so the rest reads as "the next page" and never as missing.
Changes
One page shape for every list read:
limit(50 by default and at most) andoffset;total,offset,next_offset(null on the last page) and anote, e.g. "Showing 1–50 of 451 signals, newest first. Read the next page with offset 50, or say how many you judged."lib/mcp/list-page.tsandchat/registry/list-paging.ts.Reads, with their old and new defaults:
list_signalsget_action_historylist_content_opportunitieslist_promptsget_prompt_performanceget_prompt_volumeslist_citationslist_mentionsget_reportslist_drafts,list_topics,list_competitors,list_prompt_suggestions,get_site_audit_summary,list_brands,get_ads_opportunitiesDescriptions state the real default. The wrong ones said "default 50" or "default 100" for reads that took 5, 10, 20 or 25.
Filters stay. Each read keeps its filters.
list_signalsalso takes the run's period, read the way the Signals page reads its window: detected by its end, and open or resolved after its start.Signals rows are compact. Each has a title and description in the page's words, kind, status, impact, the day it was detected, where it happened, and its actions. So a page of 50 fits one read.
Counted on the server. Database lists count every match and read a range. New
…PageForreads sit beside the MCP functions, which keep their shape. The MCP changes are additive: an optionaloffset, and atotalon prompt performance. An offset past the end is an empty page with the total.Mentions:
list_mentionspages overmentions_list's own offset, so answers 21–100 of each 100 can be read.scope.ts: any read with anoffsetinput is paged. It reads no extra probe row and takes 50 a page.Data share: each page gets a 20,000-character share (
PAGE_CHARS), as fix(chat): read every open action by priority, say how many, and name actions by title #2420 gave actions.fitResult: a page over its share comes back as a shorter page. Itsnext_offsetandnotesay where to read on. No more{list}_moreor{list}_reston a page.Scope: every read stays limited to the caller's organization and brand access. The brand-scope test covers each new page read.
Size: about 750 lines added and 215 removed outside tests. That is over the ~800 aim because it covers 16 reads in one shape. About 200 of those lines move existing queries into counted closures without changing them.
Not paged, and why:
list_members,list_connections: short lists for the whole workspace.list_ready_agents: 3–5 picks by design.get_whats_new: 3 updates by design.list_ai_answers: one prompt's full answers, up to 9.get_gsc_queries,get_prompt_insights,get_fanout_gaps: top-N summary reads.get_visibility_trend,get_ai_traffic_summary: summary reads. These are for later PRs in the audit plan.How to test
total,next_offset: 50and the note.offset: 50.cd web && yarn vitest run src/lib/mcp/list-page.test.ts src/lib/mcp/signal-page.test.ts src/lib/chat/fit.test.ts src/lib/chat/scope.test.ts src/lib/chat/registry.Checks
npx tsc --noEmit -p .: clean.upstream/main. The run coveredsrc/lib/chat,src/lib/mcp(brand-scope included),src/components/chat,src/lib/action-center,src/lib/help,src/i18n,src/lib/agent,use-server-exportsandsubscription-guard-coverage.upstream/main(with fix(chat): no row counts in Chat's steps, Data used or exports #2446) is merged in.approved-articles.jsonwas regenerated, not hand-merged.git merge-treeis clean withupstream/main.fix/chat-action-by-code(fix(chat): look up an action by its code, and never answer with "the closest" ones #2445) there are two conflicts. Both already exist between that branch andupstream/main, and are being resolved there: the Help front matter'slast_checkedline inhelp/chat/chat.md, and the generatedapproved-articles.json.'use server'file touched.Generated by Claude Code