Skip to content

Cap the get_outline and list_chat_rooms output #380

Description

@HMarzban

Parent

#328. Split from #226.

Problem

get_outline (documentTools.ts) and list_chat_rooms (chatTools.ts) return every heading, with no cap. Hosts cap a tool result near 150 000 characters, and a document can hold 5 MiB. structuredContent repeats the whole list, so the result is about twice the text. read_document and read_chat_thread already stop at MAX_READ_CHARS.

What to do

Reuse the MAX_READ_CHARS loop in read_chat_thread (chatTools.ts). Stop adding lines at MAX_READ_CHARS. Cut structuredContent to the same entries. Add one line: [Truncated: showing N of M headings.]

Acceptance

  • Both tools stop at MAX_READ_CHARS and say so.
  • structuredContent holds only the shown entries.
  • A short outline is unchanged.

No new test: the change copies a shipped loop.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions