Skip to content

feat: token efficiency — remove 4 shell-duplicate tools, trim tool descriptions - #234

Merged
jkyberneees merged 4 commits into
mainfrom
feat/token-efficiency
Sep 13, 2026
Merged

feat: token efficiency — remove 4 shell-duplicate tools, trim tool descriptions#234
jkyberneees merged 4 commits into
mainfrom
feat/token-efficiency

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Token-efficiency change from the investigation (expert panel + 3 sequential adversarial reviews + expert judge, verdict SHIP). Consolidated single feature PR: tool removals + description optimization + docs.

What changed

Tool removals (pure shell duplicates; file_info/read_file/shell cover their use cases):

  • tr, sort, count_lines, word_count — types, registrations, sandbox bindings, tests
  • Internal taint/read classification maps (internal/memory/provenance.go, internal/danger/approver.go, loop argssummary/reconcile/effects) deliberately retain the removed names so persisted past-session tool calls keep their original taint classification (verified fail-safe: a hypothetical future tool with a colliding name would only get more tainting, never less)

Description optimization (9 tools trimmed: shell, batch_read, browser, session_search, bg_start, diff, multi_grep, math_eval, checksum) + one perf-tool dedupe paragraph in the system prompt Tool-naming section replacing per-tool zero-fork boilerplate. Pinned contracts respected (Risk classes, wake-on-complete guidance).

Docs — AGENTS.md, CHEATSHEET, MCP, SECURITY, TOOL_SELECTION, WEBUI, MIGRATION (new removal section with replacements per tool), profiles.template.json cleaned.

Measured impact

Metric Before After
Tools 37 33
Tool schemas+descriptions 26,645 chars 21,892 chars
Fixed overhead per LLM call ~9,300 tok 8,200 tok (**−1,100 tok/call**)

Compatibility

  • odek continue on old sessions with removed-tool calls: registry returns tool not found, model recovers (verified)
  • WebUI renders persisted old-session calls to removed tools (legacy cases documented)
  • MCP tools/list derives from the live registry — removed tools drop out automatically

Review

  • Pre-commit adversarial review: 1 should-fix + 2 nits → fixed (e051819)
  • Round 1 (correctness): CLEAN; Round 2 (security): CLEAN; Round 3 (product): APPROVE → fixes in d7f7337
  • Expert judge: SHIP — independently verified taint-map reasoning, pinned contracts, description completeness; MIGRATION.md note added per its flag (5f29f7e)

Test evidence

  • go test ./internal/... — all 30 packages ok
  • cmd/odek non-interactive subset (all touched areas incl. pillar/ingest/MCP/session/registry) — ok
  • Interactive /dev/tty-dependent tests not runnable locally (known environmental blocker, same on main); CI runs them authoritatively

… dedupe perf-tool boilerplate, trim top tool descriptions

Removals (pure shell duplicates per expert-panel analysis; file_info/read_file cover counting needs):
- tr, sort, count_lines, word_count tools + registrations + tests
- internal taint/read classification maps intentionally RETAIN removed tool
  names so persisted past-session tool calls keep their original taint class

Descriptions:
- shell, batch_read, browser, session_search, bg_start, diff, multi_grep,
  math_eval, checksum trimmed of redundant boilerplate
- one dedupe line in the system prompt covers the perf-tool zero-fork rationale

Measured: tool schemas 26,645 → 21,892 chars (~6,700 → ~5,470 tok/call);
fixed per-call overhead (tools + system prompt) down ~1,100 tokens.

Docs updated in same change (AGENTS.md, CHEATSHEET, MCP, SECURITY,
TOOL_SELECTION, WEBUI).
…les.template.json, renumber perf_tools sections, document legacy toolviews cases
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
odek 5f29f7e Commit Preview URL

Branch Preview URL
Sep 13 2026, 04:34 PM

@jkyberneees
jkyberneees merged commit 0e03768 into main Sep 13, 2026
10 checks passed
@jkyberneees
jkyberneees deleted the feat/token-efficiency branch September 13, 2026 16:40
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