Repository navigation
fix: serve over-cap skill bodies as a progressive-loading pointer (#393) - #450
Merged
Merged
Conversation
8 tasks done
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0fade22ca0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A full-body skill response above the host's per-response token cap is
refused by the host and saved to a file, so the canonical load fails
opaquely ("result ... exceeds maximum allowed tokens"). The heaviest
skill, sumo-qa-reviewing-before-merge (~17.8k est. tokens), is the first
to cross that wall.
Both full-body entry paths now detect an over-cap body and return a
compact, actionable pointer to the progressive-loading slices
(manifest/section/module) instead of the oversized content:
- the per-skill zero-argument tool (skill_prompts)
- load_skill_context(mode="full") (skill_manifest)
Under-cap skills stay byte-for-byte unchanged. The detection threshold is
configurable (SUMO_QA_SKILL_RESPONSE_TOKEN_CAP env var > injected param >
documented default) so tests inject it and a differently-capped host can
override it, rather than hard-coding an undocumented host constant.
reviewing-before-merge per-load: 17,812 -> 205 est-tokens (98.8%);
cumulative load-every-skill-once: 64,752 -> 47,145 (27.2%).
The over-cap mode="full" pointer omitted estimated_tokens, which every normal full slice returns and docs/TOOLS.md advertises for all section/module/full slices. A client reading full["estimated_tokens"] uniformly broke only for over-cap skills. Carry it as the full-body estimate (parity with estimated_tokens_full); the body stays omitted.
sumithr
force-pushed
the
fix/issue-393-oversize-skill-response
branch
from
June 21, 2026 14:16
0fade22 to
2fe58f5
Compare
3 tasks done
sumithr
added a commit
that referenced
this pull request
Jun 21, 2026
🤖 I have created a release *beep* *boop* --- ## [0.50.3](v0.50.2...v0.50.3) (2026-06-21) ### Bug Fixes * serve over-cap skill bodies as a progressive-loading pointer ([#393](#393)) ([#450](#450)) ([13f51aa](13f51aa)) --- 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: release-please[bot] <release-please[bot]@users.noreply.github.com>
4 tasks done
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.
Closes #393.
Problem
A full-body skill MCP response above the host's per-response token cap is refused by the host and saved to a file, so the canonical load fails opaquely (
result ... exceeds maximum allowed tokens). The heaviest skill,sumo-qa-reviewing-before-merge(~17,812 est. tokens), is the first to cross that wall. Surfaced while dogfooding/work-issue, where the self-review step loads the reviewing discipline via its full-body tool.Fix
Both full-body entry paths now detect an over-cap body and return a compact, actionable pointer to the progressive-loading slices instead of the oversized content:
skill_prompts._make_skill_callable) returns a pointer string naming thesumo_qa_load_skill_contextmanifest / section / module route;load_skill_context(mode="full")(skill_manifest) returns anoversizeenvelope (nocontent) carrying the section/module index pluscontent_hashandestimated_tokens(the full-body estimate, parity with the normal full slice so a client readingfull["estimated_tokens"]does not break on the over-cap skill), and still honouringknown_hashchange-detection.Under-cap skills stay byte-for-byte unchanged. The detection threshold resolves explicit param >
SUMO_QA_SKILL_RESPONSE_TOKEN_CAPenv var > documented default (12,000 est-tokens, set conservatively below the observed reject point of ~16,623 est-tokens / 66,492 chars), so tests inject it and a differently-capped host can override it, rather than hard-coding an undocumented host constant.Acceptance criteria
test_reviewing_before_merge_is_the_over_cap_skill,test_no_served_full_body_exceeds_the_default_cap).test_per_skill_tool_one_token_over_cap_returns_pointer,test_loader_full_over_cap_returns_pointer_envelope_without_body).test_no_served_full_body_exceeds_the_default_cap, over both entry paths for every bundled skill).Token savings (real measurement, before vs after)
sumo-qa-reviewing-before-mergeper loadAll 17 other skills are byte-for-byte identical. "Before" is asserted in the test equal to the raw on-disk body (exactly what
mainserves).Tests and evidence
tests/test_skill_response_oversize.py: the>cap boundary (at-cap stays full, one token over degrades), a decision table over entry-path x size, env-var / override resolution, the AC guard over the real library,known_hashon the oversize path, and contract parity that the oversize envelope carriesestimated_tokens(test_loader_full_over_cap_carries_estimated_tokens).estimated_tokens_full(the real on-disk weight, so the >=50% saving floor is unchanged).docs/TOOLS.md,docs/SKILLS.md,docs/ARCHITECTURE.md.sumo-qa-reviewing-before-merge, then three adversarial codex passes (which found aknown_hashgap on the oversize path, a stale resource description, and a missingestimated_tokensfield on the oversize full envelope - all fixed; re-review clean).