Skip to content

[sol-orch] perf: trim heavyweight tool descriptions (-3k tokens/turn) - #5

Merged
0xSolace merged 1 commit into
devfrom
perf/tool-desc-trim
Jul 5, 2026
Merged

[sol-orch] perf: trim heavyweight tool descriptions (-3k tokens/turn)#5
0xSolace merged 1 commit into
devfrom
perf/tool-desc-trim

Conversation

@0xSolace

@0xSolace 0xSolace commented Jul 5, 2026

Copy link
Copy Markdown

Summary

Trims the three largest per-turn tool description files while preserving behavior-critical contracts: when to use each tool, argument/status semantics, safety rules, git/PR guardrails, and user-visible output expectations.

Byte savings

File Before After Saved
packages/opencode/src/tool/todowrite.txt 8,845 B 1,365 B -7,480 B
packages/opencode/src/tool/shell/shell.txt 6,287 B 2,100 B -4,187 B
packages/opencode/src/tool/task.txt 3,931 B 1,274 B -2,657 B
Total 19,063 B 4,739 B -14,324 B

Approximate token reduction: ~3,581 tokens/turn using the audit's 4 bytes/token rule.

Preserved

  • todowrite: use/skip criteria, status enum meanings, one in_progress item rule, immediate completion/cancellation updates, actionable task breakdown.
  • shell: temp-dir guidance, file-operation prohibition, commit/PR workflows, git safety rules, no force/destructive actions without explicit request, no secret commits, no interactive git, gh requirement for GitHub operations.
  • task: subagent_type requirement, slash-command behavior, when not to delegate, concurrent agent launches, fresh-context prompting requirements, background/task_status behavior, trusted-but-summarized outputs.

Cut

  • Repetitive motivation prose.
  • Long examples that restated the same rules.
  • Duplicate reasoning blocks and ceremonial guidance.

Verification

  • Grepped for tests/snapshots asserting description content; found no direct assertions on these .txt bodies.
  • bun run build in packages/opencode was attempted but blocked by the existing worktree dependency state: @opentui/solid/preload is missing from the available install. bun install --frozen-lockfile also fails because the lockfile would change.
  • bun run typecheck was also attempted and failed on missing workspace/dependency modules in the worktree install, not on the edited .txt content.

Reduce per-turn static prompt bytes for todo, shell, and task tool descriptions while preserving behavior-critical contracts.\n\nCo-authored-by: wakesync <shadow@shad0w.xyz>
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Hey! Your PR title [sol-orch] perf: trim heavyweight tool descriptions (-3k tokens/turn) doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant