Skip to content

Raise the default graph-answer token budget from 2000 to 20000 - #11

Merged
Azeem1985 merged 1 commit into
v8from
feat/query-budget-20k
Aug 24, 2026
Merged

Azeem1985 merged 1 commit into
v8from
feat/query-budget-20k

Conversation

@Azeem1985

Copy link
Copy Markdown

What

The default token budget for graph answers changes from 2000 to 20000 — one more zero — everywhere the default lives.

Why

Owner's direct order, 2026-08-24: "This can limit the amount of information retrieved." The 2000-token default starved multi-node answers: a scoped subgraph of any real size was cut to a fraction before it reached the caller, and every consumer had to know to pass --budget to get a whole answer.

Changed sites

  • CLI: graphify query --budget default (graphify/cli.py), help text (graphify/__main__.py)
  • MCP (graphify/serve.py): query_graph / get_neighbors / get_community schema defaults and their handler fallbacks (arguments.get("token_budget", ...)), plus the _query_graph_text / _subgraph_to_text signature defaults
  • Skills/docs: skillgen fragments (references/query/default.md, core/aider.md, core/devin.md), all rendered per-platform references and the aider/devin monoliths, and the blessed expected/ snapshots — regenerated with python -m tools.skillgen + --bless; --check is clean
  • skillgen guard: a new sanctioned change-class predicate in tools/skillgen/gen.py so the monolith v8 round-trip accepts exactly this renumbering and nothing else
  • path / explain carry no budget defaults — nothing to change there

Truncation notices derive from the live token_budget value (f-strings), so no message text pinned the old number. --budget N / token_budget still override.

Tests

  • test_query_cli.py: CLI parse default is 20000 and --budget 1500 still overrides
  • test_serve.py: _query_graph_text / _subgraph_to_text signature defaults are 20000 (no mcp package needed)
  • test_serve_http.py: tools/list advertises default: 20000 on every token_budget schema (exactly query_graph, get_neighbors, get_community)
  • Suite run offline: test_serve.py test_serve_http.py test_query_cli.py test_query_induced_edges.py test_query_names_its_graph.py test_querylog.py test_skillgen.py → 256 passed, 1 skipped (the mcp-dependent module skips where mcp isn't installed); py_compile and ruff check clean on all touched Python files

🤖 Generated with Claude Code

Owner's order 2026-08-24: "This can limit the amount of information
retrieved." The 2000-token default starved multi-node answers, cutting
most of a scoped subgraph before it reached the caller.

Changed everywhere the default lives:
- CLI `graphify query` --budget default (cli.py) and its help text
  (__main__.py)
- MCP schema defaults for query_graph / get_neighbors / get_community
  and the three handler fallbacks (serve.py)
- _query_graph_text / _subgraph_to_text signature defaults (serve.py)
- skillgen fragments (references/query/default.md, core/aider.md,
  core/devin.md), all rendered skill references and monoliths, and the
  blessed expected/ snapshots (python -m tools.skillgen + --bless;
  --check clean)
- new sanctioned change-class predicate in skillgen gen.py so the
  monolith v8 round-trip accepts the renumbering and nothing else

Truncation notices derive from the live token_budget value, so no
message text pinned the old number. --budget N / token_budget still
override.

Tests: new pins for the CLI parse default (test_query_cli.py, including
--budget override), the Python signature defaults (test_serve.py), and
the MCP schema advertisement over tools/list (test_serve_http.py).

Co-Authored-By: Claude Fable 5 <[email protected]>
@Azeem1985
Azeem1985 merged commit 57fb5e8 into v8 Aug 24, 2026
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.

1 participant