WHAT:
- Refactored ResponsesAPIAdapter to support async generator streaming pattern
- Added parseStreamingResponse() method that yields StreamingEvent incrementally
- Maintained backward compatibility with parseStreamingResponseBuffered() method
- Updated UnifiedResponse type to support both string and array content formats
WHY:
- Aligns Responses API adapter with Kode's three-level streaming architecture (Provider → Query → REPL)
- Enables real-time UI updates with text appearing progressively instead of all at once
- Supports TTFT (Time-To-First-Token) tracking for performance monitoring
- Matches Chat Completions streaming implementation pattern for consistency
- Resolves architectural mismatch between adapter pattern and streaming requirements
HOW:
- responsesAPI.ts: Implemented async *parseStreamingResponse() yielding events (message_start, text_delta, tool_request, usage, message_stop)
- base.ts: Added StreamingEvent type definition and optional parseStreamingResponse() to base class
- modelCapabilities.ts: Updated UnifiedResponse.content to accept string | Array<{type, text?, [key]: any}>
- parseResponse() maintains backward compatibility by calling buffered version
- All 14 tests pass with no regressions
WHAT: Fix critical CLI crash with content.filter() error and implement OpenAI Responses API integration with comprehensive testing
WHY: CLI was crashing with 'TypeError: undefined is not an object (evaluating "content.filter")' when using OpenAI models, preventing users from making API calls. Additionally needed proper Responses API support with reasoning tokens.
HOW:
• Fix content extraction from OpenAI response structure in legacy path
• Add JSON/Zod schema detection in responsesAPI adapter
• Create comprehensive test suite for both integration and production scenarios
• Document the new adapter architecture and usage
CRITICAL FIXES:
• claude.ts: Extract content from response.choices[0].message.content instead of undefined response.content
• responsesAPI.ts: Detect if schema is already JSON (has 'type' property) vs Zod schema before conversion
FILES:
• src/services/claude.ts - Critical bug fix for OpenAI response content extraction
• src/services/adapters/responsesAPI.ts - Robust schema detection for tool parameters
• src/test/integration-cli-flow.test.ts - Integration tests for full flow
• src/test/chat-completions-e2e.test.ts - End-to-end Chat Completions compatibility tests
• src/test/production-api-tests.test.ts - Production API tests with environment configuration
• docs/develop/modules/openai-adapters.md - New adapter system documentation
• docs/develop/README.md - Updated development documentation
WHAT: Add support for OpenAI Responses API in Kode CLI adapter
WHY: Enable GPT-5 and similar models that require Responses API instead of Chat Completions; fix HTTP 400 errors and schema conversion failures
HOW: Fixed tool format to use flat structure matching API spec; added missing critical parameters (include array, parallel_tool_calls, store, tool_choice); implemented robust schema conversion handling both Zod and pre-built JSON schemas; added array-based content parsing for Anthropic compatibility; created comprehensive integration tests exercising the full claude.ts flow
AFFECTED FILES:
- src/services/adapters/responsesAPI.ts: Complete adapter implementation
- src/services/openai.ts: Simplified request handling
- src/test/integration-cli-flow.test.ts: New integration test suite
- src/test/responses-api-e2e.test.ts: Enhanced with production test capability
VERIFICATION:
- Integration tests pass: bun test src/test/integration-cli-flow.test.ts
- Production tests: PRODUCTION_TEST_MODE=true bun test src/test/responses-api-e2e.test.ts
WHAT: Implement Responses API adapter with full SSE streaming support to enable Kode CLI working with GPT-5 and other models that require OpenAI Responses API format
WHY: GPT-5 and newer models use OpenAI Responses API (different from Chat Completions) which returns streaming SSE responses. Kode CLI needed a conversion layer to translate between Anthropic API format and OpenAI Responses API format for seamless model integration
HOW: Created ResponsesAPIAdapter that converts Anthropic UnifiedRequestParams to Responses API format (instructions, input array, max_output_tokens, stream=true), added SSE parser to collect streaming chunks and convert back to UnifiedResponse format. Fixed ModelAdapterFactory to properly select Responses API for GPT-5 models. Updated parseResponse to async across all adapters. Added production tests validating end-to-end conversion with actual API calls
Added update log section announcing Windows support via Git Bash, Unix subsystems,
or WSL (Windows Subsystem for Linux) for all Windows users.
- Added Update Log section to English README
- Added 更新日志 section to Chinese README
- Dated announcement as 2025-08-29
This is a major license change to better encourage open source contributions
and accelerate the global advancement of AI agent development.
Changes:
- Replace AGPLv3 LICENSE file with Apache 2.0 license text
- Update package.json license field from ISC to Apache-2.0
- Add prominent announcement in both README files about the license change
- Update license badges in README files
The Apache 2.0 license allows free use in both open source and commercial projects
with only attribution requirements, removing barriers to innovation and collaboration.
- Add WebSearchTool with DuckDuckGo integration for web search
- Provides titles, snippets, and links for current information
- Add URLFetcherTool for AI-powered web content analysis
- Fetches and converts HTML content to markdown
- Processes content using AI with user-provided prompts
- Includes 15-minute caching for efficiency
- Uses queryQuick for fast content analysis
- Register both tools in the tools registry
- Update documentation to reflect new web capabilities
- Added a new function to split PATH entries correctly for both Windows and POSIX environments.
- Improved shell detection logic to utilize the new PATH splitting function, ensuring accurate path handling across different platforms.
- Implemented shell detection for POSIX, MSYS, and WSL environments.
- Added functions for quoting strings and converting paths for Bash compatibility.
- Updated command execution to handle different shell types and ensure proper path handling.
- Improved initialization by sourcing ~/.bashrc when available and managing file paths for stdout, stderr, and cwd.
- Change debugLogger to use ~/.kode as the base directory for all logs
- API error logs now save to ~/.kode/logs/error/api/
- Debug logs save to ~/.kode/<project-dir>/debug/
- Remove dependency on env-paths cache directory for logs