Repository navigation
chore: cut tool-schema token cost ~43% (text only) - #58
Merged
Merged
Conversation
Rewrite every github_* @tool docstring as one terse paragraph: what it does, when vs siblings, and the hard call-time constraints (merge confirm/sha guard, issue body gate, review guards, release confirm, 20000-char read cap + paging footer). No tool, parameter, type, default or required-ness changes. Workflow narrative (PR review, fix-round threads, CI triage, filing, merging, releasing) moves to a new skills/github/SKILL.md the host auto-loads. Schema chars (write: true, 38 tools): 33,287 -> 18,996 (-42.9%). Read-only 19 tools: 15,313 -> 9,054 (-40.9%). Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
QA panel review — PASS
code-review-structural · head fc7c8526180f · formal
No findings were raised, so there was nothing to verify. The panel confirmed this is a clean docstring-compression refactor: all four LLM finders independently verified that hard call-time constraints (caps, guards, cross-references, refusal semantics) are preserved in the compressed text, and the docstring-pinning tests remain green. The protoPatch engine flagged three pre-existing code-logic issues, but none fall within this PR's diff and were correctly dropped per scope. No defects in the diff itself.
No findings — the review came back clean.
findings JSON (machine-readable)
[]
Merged
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.
Why
protoAgent sends every bound tool's JSON schema on every model call. A fleet audit put jobCoach's fixed overhead at ~113k tokens/call, mostly schemas; agents with
github.write: truebind all 38 github tools (~33k schema chars).What
github_*@tooldocstring is now one terse paragraph: what it does, when to use it vs siblings, and the hard call-time constraints. No tool renamed; no parameter renamed / removed / reordered; types, defaults and required-ness unchanged.confirm=true+dry_run+ full-shahead guard (+ not withdelete_branch), squash-subject trap, subject/body refused on rebase; the issue body gate sections + kind/label coupling + "search first, no duplicate"; review approve/request-changes guards (CI running / unreadable / own PR) and the evidence rule;confirmon dispatch / tag / edit-release / upload-asset with why; tag-never-moved; create-label never overwrites; the 20000-char read cap, LINE-boundary cut andcontinue with start_line=paging footer;github_path_existsEXISTS / MISSING / Gap semantics; "Call github_status FIRST" on errors.github_status(always registered) and in the skill; theArgs:/Returns:blocks are folded into prose; the docstrings' 8-space continuation indentation (which shipped verbatim in the description) is gone.skills/github/SKILL.md(the host auto-loads a plugin'sskills/dir): the workflow manual that used to live in descriptions — PR review order, fix-round thread replies, CI triage, filing, merging, the release sequence (dispatch → run_jobs → tag → release → notes/assets), the paging footer shapes.Measured
Serialized OpenAI tool schema chars (
convert_to_openai_tool, host-free testkit,github.write: true):github_merge_prgithub_create_issuegithub_read_pr_filegithub_read_filegithub_create_taggithub_path_existsgithub_dispatch_workflowgithub_get_prgithub_create_labelgithub_upload_release_assetgithub_reply_threadgithub_review_threadsgithub_search_issuesgithub_review_request_changesgithub_edit_prgithub_review_approvegithub_closegithub_resolve_threadgithub_run_jobsgithub_set_assigneesgithub_issue_commentsgithub_set_labelsgithub_review_commentgithub_get_issuegithub_edit_issuegithub_releasegithub_list_prsgithub_create_prgithub_edit_releasegithub_release_assetgithub_ci_runsgithub_run_failuregithub_repo_contentsgithub_statusgithub_commentgithub_pr_diffgithub_get_commit_diffgithub_list_issuesTests
ruff check . && ruff format --check . && pytest -q— 509 passed. The description-pinning tests (capped at 20000 chars,LINE boundary,continue with start_line=,DEDUPE BEFORE FILING,duplicate) pass unchanged.No version bump (no release in this PR).
🤖 Generated with Claude Code