GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — feat(opencode): switch tool truncation to token-based limits by Skyline-23 · Pull Request #9648 · anomalyco/opencode Conversation
|
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate: Based on my search results, I found some related PRs that deal with output limits and truncation, but none appear to be direct duplicates of PR #9648. Here are the potentially related PRs: Related PRs (not duplicates):
These PRs address related concerns about tool output management, but none appear to be duplicate work on the same token-based truncation feature that PR #9648 implements. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This pull request switches the tool output truncation system from byte-based limits to token-based limits for more accurate context management. The token estimation uses a simple 4 characters per token approximation.
Changes:
MAX_BYTES (50KB) with MAX_TOKENS (10,000) as the default truncation limitToken.estimate() instead of Buffer.byteLength()Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/opencode/src/tool/truncation.ts | Core implementation: renamed constants, options, and variables from byte-based to token-based; replaced byte counting with token estimation |
| packages/opencode/src/tool/read.ts | Updated Read tool to use token-based truncation and updated user-facing messages to reference tokens |
| packages/opencode/src/tool/bash.ts | Updated template variable replacement from maxBytes to maxTokens |
| packages/opencode/src/tool/bash.txt | Updated help text to reference token limits instead of byte limits |
| packages/opencode/test/tool/truncation.test.ts | Updated test descriptions and assertions to use token-based expectations; added Token import |
| packages/opencode/test/tool/bash.test.ts | Updated truncation test to generate token-based test data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Updated the PR title to conventional format and added |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
d11838e to
6dd40a4
Compare
6dd40a4 to
ea7d600
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
|
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Codex model response latency increases significantly as conversation grows
There was an error while loading. Please reload this page.