Skip to content

fix(debugging): link docs once per issue in get_issues - #610

Merged
barryroodt merged 3 commits into
supabase:mainfrom
Brian-1812:get-issues-docs-url-per-issue
Nov 26, 2026
Merged

barryroodt merged 3 commits into
supabase:mainfrom
Brian-1812:get-issues-docs-url-per-issue

Conversation

@Brian-1812

@Brian-1812 Brian-1812 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix (response size). Follow-up to #546, as @barryroodt asked on #574 (comment). Refs #124.

What is the current behavior?

Every finding in get_issues repeats its issue's docs_url. In splinter, each lint has one fixed remediation link, so these copies add no data for splinter lints. On a project the size of the Mockamaster capture in #546 (547 findings in 11 issues), the copies are about 22% of the default response.

What is the new behavior?

Findings no longer carry docs_url. The issue keeps its docs_url, so every finding still reaches the link through its issue. Nothing else in the output changes.

Call Before After Saved (chars / tokens)
default 62,296 chars, 15,225 tokens 48,243 chars, 11,614 tokens 22.6% / 23.7%
severity: warning 43,789 chars, 10,533 tokens 34,836 chars, 8,252 tokens 20.4% / 21.7%

I ran the real splinter SQL in PGlite on the supabase/evals#552 seed and fed the lints to the real get_issues on main. Splinter also flags 41 unused indexes there, because a fresh database has no index scans. I left those out to match 547 findings in 11 issues. With them, the default call goes from 69,279 to 53,346 chars (23.0%). Tokens are OpenAI o200k_base; I did not count Claude tokens. In every call I ran, each removed link was equal to its issue's link, and the rest of the output is byte-identical.

There is exactly one way this change can lose data: two findings of the same lint with different docs links, where the second link is now gone. I checked splinter at cc529aa9: each of its 31 lints has one constant remediation, so this can't happen there. I can't see the platform-only and health lints, though: can you confirm that none of them gives two findings of one lint different links?

How to Review

  1. Output contract

    • packages/mcp-server-supabase/src/issues.ts
    • docs_url leaves the finding schema and the finding object. The issue-level docs_url does not change. get_issues uses this schema as its output schema, so tools/list changes too.
  2. Tests

    • packages/mcp-server-supabase/src/server.debugging.test.ts: a new size test calls get_issues through the server harness on 547 findings in 11 issues. The default response must stay under LARGE_PROJECT_ISSUES_BUDGET (48,000 chars).
    • packages/mcp-server-supabase/src/issues.test.ts: one feat(debugging): add project issues DEBUG-311 #546 test gave two findings of one issue different links. It now checks the issue's link, and that a finding has no docs_url.

Review questions

  • Is 48,000 chars a good budget? It is about 10% above today's 43,493 for this fixture, so it catches growth early. It is well under the 25,000-token limit from get_advisors tool returns responses exceeding token limits without pagination support #124.
  • If a platform-only or health lint can give different links (question above), should I keep docs_url on a finding only when it differs from the issue's link?
  • Should this land before the release in chore: release main #586? Then no published version has docs_url on findings.
  • Do the tests check output, not implementation details?

Verification

  • With main's issues.ts, the new size test fails with expected 56866 to be less than 48000. On this branch it passes at 43,493.
  • pnpm format:check, tsc --noEmit, and vitest run --project unit: 1028/1028 passed.

Additional context

This changes the get_issues output schema: issues[].affected[] no longer has docs_url. So it is best merged before that schema goes into a ChatGPT submission. If #586 merges first, the field is in a published release. Then I will mark the commit as breaking, as CONTRIBUTING asks for a contract step.

🤖 Generated with Claude Code

Each finding repeated the docs_url of its issue. Splinter gives one
remediation link per lint, so the copies added no data. On a project
shaped like the Mockamaster capture (547 findings in 11 issues), they
were about 23% of the default get_issues response.

Remove docs_url from findings. The issue keeps its docs_url.
Add a test that keeps the default response for a large project under
a size budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Brian-1812
Brian-1812 requested a review from a team as a code owner November 25, 2026 13:29
Brian-1812 and others added 2 commits November 25, 2026 14:40
The budget comment now says what the size test checks: growth of more
than about 10% fails. The supabase#546 test name now says that the docs link is
on the issue. The finding no longer has its own remediation link.
No assertion or constant changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@barryroodt barryroodt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, @Brian-1812! Thanks for following through on #574 and measuring this on real splinter output. I checked the platform-side lints too. Each lint uses the same docs link for every finding, so keeping docs_url on the issue covers them all.

48,000 characters works for me as the budget. I'll get this merged ahead of #586 so we never ship the per-finding field.

@Brian-1812

Brian-1812 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review and approval!
Happy to follow up if anything else is needed

@barryroodt
barryroodt merged commit 74801d8 into supabase:main Nov 26, 2026
5 of 7 checks passed
@supabase-releaser supabase-releaser Bot mentioned this pull request Nov 26, 2026
barryroodt pushed a commit that referenced this pull request Nov 26, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>mcp-utils: 0.11.1</summary>

##
[0.11.1](mcp-utils-v0.11.0...mcp-utils-v0.11.1)
(2026-11-26)


### Bug Fixes

* **mcp-ui:** shared project card for create-project and create-branch
([#578](#578))
([efe189f](efe189f))
</details>

<details><summary>mcp-server-supabase: 0.20.0</summary>

##
[0.20.0](mcp-server-supabase-v0.19.0...mcp-server-supabase-v0.20.0)
(2026-11-26)


### Features

* **debugging:** add project issues DEBUG-311
([#546](#546))
([01f8021](01f8021))
* **mcp-server-supabase:** add optional schemas parameter to
generate_typescript_types
([#592](#592))
([7532f53](7532f53))


### Bug Fixes

* **debugging:** link docs once per issue in get_issues
([#610](#610))
([74801d8](74801d8))
* **mcp-server-supabase:** detect import maps uploaded with a ./ prefix
([#591](#591))
([6b8f4dc](6b8f4dc))
* **mcp-server-supabase:** keep a declined or cancelled SQL confirmation
final ([#581](#581))
([03afe8e](03afe8e))
* **mcp-server-supabase:** match Studio's notebook row_limit and clarify
skip and blank-input messages
([#593](#593))
([ad07f1b](ad07f1b))
* **mcp-server-supabase:** skip cost confirmation for $0 projects on
clients without forms
([#608](#608))
([50cfc37](50cfc37))
* **mcp-server-supabase:** stop reusing a removed import map on edge
function redeploy ([#588](#588))
([56093a6](56093a6))
* **mcp-ui:** shared project card for create-project and create-branch
([#578](#578))
([efe189f](efe189f))
* **mcp:** confirm UPDATEs without WHERE that follow a comment and set a
dollar-quoted value ([#612](#612))
([468907a](468907a))
* **mcp:** confirm UPDATEs without WHERE that use inheritance syntax
([#565](#565))
([687b3ee](687b3ee))
* **mcp:** confirm UPDATEs without WHERE when a column name ends in
where ([#557](#557))
([57fa34b](57fa34b))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@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

Development

Successfully merging this pull request may close these issues.

2 participants