[GH-ISSUE #4] OpenCode Context Stats #4

Closed
opened 2026-02-27 07:17:20 +03:00 by kerem · 1 comment
Owner

Originally created by @g0dev on GitHub (Dec 16, 2025).
Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/4

Currently, the context stats on Opencode do not update at all, they always remain at 0.

Originally created by @g0dev on GitHub (Dec 16, 2025). Original GitHub issue: https://github.com/jwadow/kiro-gateway/issues/4 Currently, the context stats on Opencode do not update at all, they always remain at 0.
kerem 2026-02-27 07:17:20 +03:00
  • closed this issue
  • added the
    bug
    fixed
    labels
Author
Owner

@jwadow commented on GitHub (Dec 16, 2025):

Thanks for the report!

Fixed in v1.0.3 — now with accurate token counting using tiktoken.

To update:

  1. Download the Source code (zip) from the release
  2. Extract and replace your current gateway folder (your .env file will stay intact)
  3. Run pip install -r requirements.txt to install the new tiktoken dependency
  4. Restart the gateway

What's new:

  • 📊 Accurate token counting with tiktoken
  • Proper prompt_tokens / completion_tokens separation in API responses
Image

Here's the correct values in ~/.config/opencode/config.json

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "kiro": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "kiro",
      "options": {
        "baseURL": "http://127.0.0.1:8000/v1"
      },
      "models": {
        "claude-opus-4-5": {
          "name": "Claude Opus 4.5",
          "limit": {
            "context": 200000,
            "output": 8192
          }
        }
      }
    }
  }
}
<!-- gh-comment-id:3661946521 --> @jwadow commented on GitHub (Dec 16, 2025): Thanks for the report! Fixed in **[v1.0.3](https://github.com/jwadow/kiro-openai-gateway/releases/tag/v1.0.3)** — now with accurate token counting using tiktoken. **To update:** 1. Download the [Source code (zip)](https://github.com/jwadow/kiro-openai-gateway/archive/refs/tags/v1.0.3.zip) from the release 2. Extract and replace your current gateway folder (your `.env` file will stay intact) 3. Run `pip install -r requirements.txt` to install the new `tiktoken` dependency 4. Restart the gateway **What's new:** - 📊 Accurate token counting with tiktoken - Proper `prompt_tokens` / `completion_tokens` separation in API responses <img width="157" height="103" alt="Image" src="https://github.com/user-attachments/assets/d449db02-dca5-458b-8962-d0737bea995e" /> Here's the correct values in `~/.config/opencode/config.json` ``` { "$schema": "https://opencode.ai/config.json", "provider": { "kiro": { "npm": "@ai-sdk/openai-compatible", "name": "kiro", "options": { "baseURL": "http://127.0.0.1:8000/v1" }, "models": { "claude-opus-4-5": { "name": "Claude Opus 4.5", "limit": { "context": 200000, "output": 8192 } } } } } } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/kiro-gateway-jwadow#4
No description provided.