Skip to content

v1.0.3 - Usage Tracking Release

Choose a tag to compare

@jwadow jwadow released this 16 Dec 18:49
· 183 commits to main since this release

Introduces accurate token counting for usage tracking and improves compatibility.

✨ New Features

Added: Token counting with tiktoken for accurate usage tracking (#4)

  • New tokenizer.py module using OpenAI's tiktoken library (Rust-based, blazing fast)
  • Proper separation of prompt_tokens and completion_tokens in API responses
  • Claude correction factor (1.15x) for more accurate token estimation
  • Supports messages, tools, and multimodal content token counting
  • Graceful fallback to character-based estimation if tiktoken unavailable

🐛 Bug Fixes

Fixed: Structured JSON error responses from Kiro API

  • Error responses now return proper OpenAI-compatible JSON format instead of raw text
  • Includes error message, type, and status code for better debugging

Fixed: Windows path compatibility for KIRO_CREDS_FILE

  • Paths with backslashes (e.g., D:\Projects\file.json) no longer break due to escape sequence processing
  • Added raw .env file reading to preserve Windows paths as-is

Fixed: Cross-platform path normalization

  • KIRO_CREDS_FILE paths are now normalized for Windows/Linux/macOS compatibility

⚡ Improvements

Changed: Reduced default FIRST_TOKEN_TIMEOUT from 30s to 15s

  • Faster detection of stuck requests
  • More responsive retry behavior

Changed: Centralized version constant

  • Version is now defined in single place (config.py) and imported elsewhere
  • Follows Single Source of Truth principle

⚙️ Configuration

Updated default values:

Variable Old Default New Default
FIRST_TOKEN_TIMEOUT 30 15

📦 Dependencies

  • Added tiktoken to requirements.txt for token counting

🔄 Upgrade

After downloading and extracting the new release, install new dependencies from the project folder:

pip install -r requirements.txt

Full Changelog: v1.0.2...v1.0.3