Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Limit response size for github_list_releases tool to prevent context overruns

Open
#83 0 comments 0 reactions 0 assignees View on GitHub

@blinkagent is already working on this.

Since Dec 2, 2025.

  • #91 by @blinkagent — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
ai, tooling

Research direction

Start in packages/github/src/tools.ts around line 928 at the github_list_releases definition. Reproduce the large response with include_body_and_assets enabled, then trace how per_page, release bodies, and assets are mapped. Done means responses stay within the agreed limits and clearly indicate when data was truncated.

Written by the indexing model from the issue text.

Description

Problem

The github_list_releases tool can return excessively large responses that cause the model to exceed context limits, resulting in "Input is too long for requested model" errors in brand new chats.

Root Cause Analysis

When fetching releases with include_body_and_assets: true, the tool returns massive amounts of data. Testing with coder/coder:

  • 5 releases with bodies and assets = ~38KB of JSON
  • Each release has ~24 assets (download URLs, sizes, counts, etc.)
  • Release bodies can be ~1KB each (full changelogs)
  • Requesting 100 releases with full data could exceed 500KB+

The tool implementation at packages/github/src/tools.ts (line ~928) passes data through without any size limits:

list_releases: toolWithOctokit(({ octokit }) =>
  tool({
    inputSchema: z.object({
      owner: z.string(),
      repo: z.string(),
      page: z.number(),
      per_page: z.number(),  // No max limit!
      include_body_and_assets: z.boolean(),
    }),
    execute: async (args, opts) => {
      // ...
      return {
        releases: response.data.map((release) => ({
          // Full body returned, no truncation
          body: args.include_body_and_assets
            ? (release.body ?? undefined)
            : undefined,
          // ALL assets returned
          assets: args.include_body_and_assets
            ? release.assets.map((asset) => ({ ... }))
            : undefined,
        })),
      };
    },
  })
),

Proposed Solution

Modify the tool in packages/github/src/tools.ts:

  1. Cap per_page to a reasonable max (e.g., 10 releases)
  2. Truncate release bodies to ~500-1000 chars with a [truncated] indicator
  3. Limit assets per release to 5-10 most relevant ones
  4. Add response size indicator so the model knows data was limited
list_releases: toolWithOctokit(({ octokit }) =>
  tool({
    inputSchema: z.object({
      owner: z.string(),
      repo: z.string(),
      page: z.number(),
      per_page: z.number().max(10), // Hard cap
      include_body_and_assets: z.boolean(),
    }),
    execute: async (args, opts) => {
      const MAX_BODY_LENGTH = 500;
      const MAX_ASSETS = 5;
      
      const response = await (await octokit()).request(...);
      
      return {
        releases: response.data.map((release) => ({
          // ...
          body: args.include_body_and_assets && release.body
            ? release.body.length > MAX_BODY_LENGTH
              ? release.body.slice(0, MAX_BODY_LENGTH) + '... [truncated]'
              : release.body
            : undefined,
          assets: args.include_body_and_assets
            ? release.assets.slice(0, MAX_ASSETS).map((asset) => ({ ... }))
            : undefined,
          total_assets: release.assets.length, // Let model know if more exist
        })),
        _truncated: true, // Signal that limits were applied
      };
    },
  })
),

Related Context

This affects the Blink agent (coder/agents) which uses github.tools directly. The fix should be in the SDK (coder/blink) since that's where the tool is defined.

Dominant language
TypeScript
Stars
165
Forks
20
Avg merge
24m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coder/blink

All issues in coder/blink

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.