Skip to content

fix: account for tool results and multimodal context - #79

Merged
grikomsn merged 1 commit into
mainfrom
codex/fix-context-overflow
Oct 20, 2026
Merged

grikomsn merged 1 commit into
mainfrom
codex/fix-context-overflow

Conversation

@grikomsn

Copy link
Copy Markdown
Owner

Summary

The token-count callback only counted top-level text, so tool results, tool arguments, thinking, and images could contribute no tokens to Copilot context budgeting. Count these input parts recursively, include message and tool framing, and show /compact recovery guidance for context-window errors.

Includes a patch Changeset for opencode-bridge-for-copilot-chat (2.1.5 → 2.1.6); the release workflow will apply the version bump.

Verification

  • npm run check — 200 tests passed.
  • npm run package — passed.
  • npm run changeset -- status — patch Changeset validated.
  • Live authenticated inference was not exercised.

Checklist

  • The change is focused and contains no unrelated churn.
  • Tests pass with npm test.
  • Packaging passes with npm run package.
  • User-visible changes include a patch Changeset.
  • Relevant documentation is updated.

@grikomsn
grikomsn merged commit f405eab into main Oct 20, 2026
3 checks passed
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