10 Commits

Author SHA1 Message Date
3bc152029e chore: Bump version to 0.1.8
Some checks failed
Codespell / Check for spelling errors (push) Successful in 5s
ci / build-test (push) Failing after 4m52s
sdk / sdks (push) Successful in 11m8s
rust-release / tag-check (push) Successful in 3s
rust-release / release (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-release / Build - ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-release / Build - windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-release / Build - windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
rust-release / publish-npm (push) Has been cancelled
rust-release / Build - macos-15-xlarge - aarch64-apple-darwin (push) Has been cancelled
rust-release / Build - macos-15-xlarge - x86_64-apple-darwin (push) Has been cancelled
rust-release / Build - ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-release / Build - ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-release / Build - ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
This release includes two critical fixes:

1. fix: Accept '*** Create File:' as alias for '*** Add File:' in patch parser
   - Claude sometimes uses 'Create File' syntax instead of 'Add File'
   - Parser now accepts both markers to prevent validation failures
   - Updated error message to include both valid syntaxes

2. fix: Increase default max_tokens from 8192 to 20480
   - Claude Sonnet 4.5 was getting cut off mid-task
   - New default is 5 * 4096 = 20480 tokens
   - Claude Sonnet 4.5 supports up to 64K tokens
   - Gives Claude enough space to complete comprehensive tasks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 20:50:54 +01:00
ffbd2e38ec debug: Add extensive logging for finish_reason handling
Some checks failed
ci / build-test (push) Failing after 4m52s
Codespell / Check for spelling errors (push) Successful in 4s
sdk / sdks (push) Successful in 11m8s
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
Added debug logging to track:
- Whether assistant_item and reasoning_item exist when finish_reason is received
- Content being emitted
- Completed event transmission

This revealed the actual bug is in HTTP client layer - responses are being
consumed immediately instead of streaming, causing "Request completed" to
appear before any SSE chunks are processed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 19:27:07 +01:00
0841ba05a8 fix: Handle finish_reason 'length' to prevent hang when hitting max_tokens
Some checks failed
ci / build-test (push) Failing after 4m52s
Codespell / Check for spelling errors (push) Successful in 5s
sdk / sdks (push) Successful in 11m18s
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
When the response hits the max_tokens limit, the API returns finish_reason="length".
Previously, this fell into the catch-all case which didn't emit pending items,
causing llmx to hang with "working" status.

Now:
- Handle "length" the same as "stop" - emit assistant_item and reasoning_item
- Also made catch-all case defensive: emit pending items for any unknown finish_reason

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 18:51:48 +01:00
44dc7a3bed fix: Emit pending items before Completed when stream closes gracefully
- When SSE stream closes with Ok(None), now emits pending assistant_item and reasoning_item BEFORE sending Completed event
- Previously would send Completed immediately without emitting accumulated messages, causing UI to hang with "working" state
- This fixes the hang when API returns 200 OK but SSE stream has no events
- Added debug logging for graceful stream closure

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 18:31:24 +01:00
a3ced1f246 fix: Send Completed event when stream ends without finish_reason
Some checks failed
ci / build-test (push) Failing after 4m51s
Codespell / Check for spelling errors (push) Successful in 4s
sdk / sdks (push) Successful in 11m7s
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
- Add debug logging for finish_reason to diagnose stream completion issues
- When SSE stream ends without sending a finish_reason chunk, emit final items and Completed event
- This fixes the "working" hang when the API stream closes without proper completion signal
- Fixed duplicate max_tokens fields in test provider definitions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 18:23:12 +01:00
401b0b3935 fix: Handle empty assistant messages as turn completion
Some checks failed
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
ci / build-test (push) Failing after 4m50s
Codespell / Check for spelling errors (push) Successful in 4s
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
sdk / sdks (push) Has been cancelled
- When the API returns an empty assistant message (content: []), treat it as turn completion signal
- This fixes the "working" hang that occurs after tool calls when the API stream ends with an empty message
- Updated parse_agent_message to return None for empty content
- Fixes issue where llmx would hang indefinitely waiting for content that never comes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 18:15:24 +01:00
7237627ac7 fix: Regenerate Cargo.lock for v0.1.7
Some checks failed
ci / build-test (push) Failing after 4m52s
Codespell / Check for spelling errors (push) Successful in 7s
sdk / sdks (push) Successful in 11m7s
rust-release / tag-check (push) Successful in 3s
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
rust-release / Build - macos-15-xlarge - aarch64-apple-darwin (push) Has been cancelled
rust-release / Build - macos-15-xlarge - x86_64-apple-darwin (push) Has been cancelled
rust-release / Build - ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-release / Build - ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-release / Build - ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-release / Build - ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-release / release (push) Has been cancelled
rust-release / publish-npm (push) Has been cancelled
rust-release / Build - windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-release / Build - windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
- Regenerated lockfile with compatible dependency versions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 11:25:44 +01:00
75dda1c285 chore: Bump version to 0.1.7
Some checks failed
ci / build-test (push) Failing after 4m53s
Codespell / Check for spelling errors (push) Successful in 4s
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
sdk / sdks (push) Has been cancelled
rust-release / tag-check (push) Successful in 3s
rust-release / release (push) Has been cancelled
rust-release / publish-npm (push) Has been cancelled
rust-release / Build - macos-15-xlarge - aarch64-apple-darwin (push) Has been cancelled
rust-release / Build - macos-15-xlarge - x86_64-apple-darwin (push) Has been cancelled
rust-release / Build - ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-release / Build - ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-release / Build - ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-release / Build - ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-release / Build - windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-release / Build - windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
- Configurable max_tokens via provider config
- Comprehensive Anthropic prompt caching (tools, system, history)
- Fixed orphaned tool_use errors with per-call_id skip state tracking
- Added debug logging for troubleshooting
- Fixed all test initializations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 11:18:26 +01:00
8f79e89db2 fix: Add max_tokens field to all test ModelProviderInfo initializations
Some checks failed
ci / build-test (push) Failing after 4m50s
Codespell / Check for spelling errors (push) Successful in 4s
sdk / sdks (push) Successful in 11m17s
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
- Fixed all test files that initialize ModelProviderInfo
- Added max_tokens: None to maintain compatibility
- Ensures all tests compile with new max_tokens field

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 11:01:31 +01:00
c0775ad8a3 feat: Make max_tokens configurable via provider config
Some checks failed
ci / build-test (push) Failing after 4m51s
Codespell / Check for spelling errors (push) Successful in 10s
sdk / sdks (push) Successful in 11m9s
rust-ci / Detect changed areas (push) Has been cancelled
rust-ci / Format / etc (push) Has been cancelled
rust-ci / cargo shear (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - x86_64-apple-darwin (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04-arm - aarch64-unknown-linux-musl (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / Lint/Build — macos-14 - aarch64-apple-darwin (release) (push) Has been cancelled
rust-ci / Lint/Build — ubuntu-24.04 - x86_64-unknown-linux-musl (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-11-arm - aarch64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Lint/Build — windows-latest - x86_64-pc-windows-msvc (release) (push) Has been cancelled
rust-ci / Tests — macos-14 - aarch64-apple-darwin (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04 - x86_64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — ubuntu-24.04-arm - aarch64-unknown-linux-gnu (push) Has been cancelled
rust-ci / Tests — windows-11-arm - aarch64-pc-windows-msvc (push) Has been cancelled
rust-ci / Tests — windows-latest - x86_64-pc-windows-msvc (push) Has been cancelled
rust-ci / CI results (required) (push) Has been cancelled
- Add max_tokens field to ModelProviderInfo struct
- Read from provider config, default to 8192 if not set
- Add debug logging for max_tokens value
- Allows per-provider customization in config.toml

Example config:
```toml
[model_providers.litellm]
max_tokens = 16384
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 10:40:15 +01:00
24 changed files with 160 additions and 78 deletions

90
llmx-rs/Cargo.lock generated
View File

@@ -178,7 +178,7 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
[[package]]
name = "app_test_support"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"assert_cmd",
@@ -765,9 +765,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.5.51"
version = "4.5.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5"
checksum = "aa8120877db0e5c011242f96806ce3c94e0737ab8108532a76a3300a01db2ab8"
dependencies = [
"clap_builder",
"clap_derive",
@@ -775,9 +775,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.5.51"
version = "4.5.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a"
checksum = "02576b399397b659c26064fbc92a75fede9d18ffd5f80ca1cd74ddab167016e1"
dependencies = [
"anstream",
"anstyle",
@@ -952,7 +952,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]]
name = "core_test_support"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"assert_cmd",
@@ -2828,7 +2828,7 @@ checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
[[package]]
name = "llmx-ansi-escape"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"ansi-to-tui",
"ratatui",
@@ -2837,7 +2837,7 @@ dependencies = [
[[package]]
name = "llmx-app-server"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"app_test_support",
@@ -2872,7 +2872,7 @@ dependencies = [
[[package]]
name = "llmx-app-server-protocol"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"clap",
@@ -2890,7 +2890,7 @@ dependencies = [
[[package]]
name = "llmx-apply-patch"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"assert_cmd",
@@ -2905,7 +2905,7 @@ dependencies = [
[[package]]
name = "llmx-arg0"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"dotenvy",
@@ -2918,7 +2918,7 @@ dependencies = [
[[package]]
name = "llmx-async-utils"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"async-trait",
"pretty_assertions",
@@ -2942,7 +2942,7 @@ dependencies = [
[[package]]
name = "llmx-backend-openapi-models"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"serde",
"serde_json",
@@ -2951,7 +2951,7 @@ dependencies = [
[[package]]
name = "llmx-chatgpt"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"clap",
@@ -2966,7 +2966,7 @@ dependencies = [
[[package]]
name = "llmx-cli"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"assert_cmd",
@@ -3006,7 +3006,7 @@ dependencies = [
[[package]]
name = "llmx-cloud-tasks"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"async-trait",
@@ -3032,7 +3032,7 @@ dependencies = [
[[package]]
name = "llmx-cloud-tasks-client"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"async-trait",
@@ -3047,7 +3047,7 @@ dependencies = [
[[package]]
name = "llmx-common"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"clap",
"llmx-app-server-protocol",
@@ -3059,7 +3059,7 @@ dependencies = [
[[package]]
name = "llmx-core"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"askama",
@@ -3140,7 +3140,7 @@ dependencies = [
[[package]]
name = "llmx-exec"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"assert_cmd",
@@ -3173,7 +3173,7 @@ dependencies = [
[[package]]
name = "llmx-execpolicy"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"allocative",
"anyhow",
@@ -3193,7 +3193,7 @@ dependencies = [
[[package]]
name = "llmx-feedback"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"llmx-protocol",
@@ -3204,7 +3204,7 @@ dependencies = [
[[package]]
name = "llmx-file-search"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"clap",
@@ -3217,7 +3217,7 @@ dependencies = [
[[package]]
name = "llmx-git"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"assert_matches",
"once_cell",
@@ -3233,7 +3233,7 @@ dependencies = [
[[package]]
name = "llmx-keyring-store"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"keyring",
"tracing",
@@ -3241,7 +3241,7 @@ dependencies = [
[[package]]
name = "llmx-linux-sandbox"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"clap",
"landlock",
@@ -3254,7 +3254,7 @@ dependencies = [
[[package]]
name = "llmx-login"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"base64",
@@ -3278,7 +3278,7 @@ dependencies = [
[[package]]
name = "llmx-mcp-server"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"assert_cmd",
@@ -3305,7 +3305,7 @@ dependencies = [
[[package]]
name = "llmx-ollama"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"assert_matches",
"async-stream",
@@ -3321,7 +3321,7 @@ dependencies = [
[[package]]
name = "llmx-otel"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"chrono",
"eventsource-stream",
@@ -3342,14 +3342,14 @@ dependencies = [
[[package]]
name = "llmx-process-hardening"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"libc",
]
[[package]]
name = "llmx-protocol"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"base64",
@@ -3375,7 +3375,7 @@ dependencies = [
[[package]]
name = "llmx-responses-api-proxy"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"clap",
@@ -3391,7 +3391,7 @@ dependencies = [
[[package]]
name = "llmx-rmcp-client"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"axum",
@@ -3420,7 +3420,7 @@ dependencies = [
[[package]]
name = "llmx-stdio-to-uds"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"assert_cmd",
@@ -3431,7 +3431,7 @@ dependencies = [
[[package]]
name = "llmx-tui"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"arboard",
@@ -3496,7 +3496,7 @@ dependencies = [
[[package]]
name = "llmx-utils-cache"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"lru",
"sha1",
@@ -3505,7 +3505,7 @@ dependencies = [
[[package]]
name = "llmx-utils-image"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"base64",
"image",
@@ -3517,7 +3517,7 @@ dependencies = [
[[package]]
name = "llmx-utils-json-to-toml"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"pretty_assertions",
"serde_json",
@@ -3526,7 +3526,7 @@ dependencies = [
[[package]]
name = "llmx-utils-pty"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"portable-pty",
@@ -3535,7 +3535,7 @@ dependencies = [
[[package]]
name = "llmx-utils-readiness"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"assert_matches",
"async-trait",
@@ -3546,11 +3546,11 @@ dependencies = [
[[package]]
name = "llmx-utils-string"
version = "0.1.6"
version = "0.1.8"
[[package]]
name = "llmx-utils-tokenizer"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"pretty_assertions",
@@ -3660,7 +3660,7 @@ checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
[[package]]
name = "mcp-types"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"schemars 0.8.22",
"serde",
@@ -3670,7 +3670,7 @@ dependencies = [
[[package]]
name = "mcp_test_support"
version = "0.1.6"
version = "0.1.8"
dependencies = [
"anyhow",
"assert_cmd",

View File

@@ -43,7 +43,7 @@ members = [
resolver = "2"
[workspace.package]
version = "0.1.6"
version = "0.1.8"
# Track the edition for all workspace crates in one place. Individual
# crates can still override this value, but keeping it here means new
# crates created with `cargo new -w ...` automatically inherit the 2024

View File

@@ -138,7 +138,7 @@ impl McpProcess {
client_info: ClientInfo {
name: "llmx-app-server-tests".to_string(),
title: None,
version: "0.1.6".to_string(),
version: "0.1.7".to_string(),
},
})?);
let req_id = self.send_request("initialize", params).await?;

View File

@@ -26,7 +26,7 @@ async fn get_user_agent_returns_current_llmx_user_agent() -> Result<()> {
let os_info = os_info::get();
let user_agent = format!(
"llmx_cli_rs/0.1.6 ({} {}; {}) {} (llmx-app-server-tests; 0.1.6)",
"llmx_cli_rs/0.1.7 ({} {}; {}) {} (llmx-app-server-tests; 0.1.7)",
os_info.os_type(),
os_info.version(),
os_info.architecture().unwrap_or("unknown"),

View File

@@ -31,6 +31,7 @@ use thiserror::Error;
const BEGIN_PATCH_MARKER: &str = "*** Begin Patch";
const END_PATCH_MARKER: &str = "*** End Patch";
const ADD_FILE_MARKER: &str = "*** Add File: ";
const CREATE_FILE_MARKER: &str = "*** Create File: "; // Alias for Add File
const DELETE_FILE_MARKER: &str = "*** Delete File: ";
const UPDATE_FILE_MARKER: &str = "*** Update File: ";
const MOVE_TO_MARKER: &str = "*** Move to: ";
@@ -245,8 +246,8 @@ fn check_start_and_end_lines_strict(
fn parse_one_hunk(lines: &[&str], line_number: usize) -> Result<(Hunk, usize), ParseError> {
// Be tolerant of case mismatches and extra padding around marker strings.
let first_line = lines[0].trim();
if let Some(path) = first_line.strip_prefix(ADD_FILE_MARKER) {
// Add File
if let Some(path) = first_line.strip_prefix(ADD_FILE_MARKER).or_else(|| first_line.strip_prefix(CREATE_FILE_MARKER)) {
// Add File (also accepts Create File as alias)
let mut contents = String::new();
let mut parsed_lines = 1;
for add_line in &lines[1..] {
@@ -331,7 +332,7 @@ fn parse_one_hunk(lines: &[&str], line_number: usize) -> Result<(Hunk, usize), P
Err(InvalidHunkError {
message: format!(
"'{first_line}' is not a valid hunk header. Valid hunk headers: '*** Add File: {{path}}', '*** Delete File: {{path}}', '*** Update File: {{path}}'"
"'{first_line}' is not a valid hunk header. Valid hunk headers: '*** Add File: {{path}}', '*** Create File: {{path}}', '*** Delete File: {{path}}', '*** Update File: {{path}}'"
),
line_number,
})

View File

@@ -443,10 +443,12 @@ pub(crate) async fn stream_chat_completions(
});
// Add max_tokens - required by Anthropic Messages API
// Use a sensible default of 8192 if not configured
// Use provider config value or default to 20480 (5 * 4096, Claude Sonnet 4.5 supports up to 64K)
let max_tokens = provider.max_tokens.unwrap_or(20480);
if let Some(obj) = payload.as_object_mut() {
obj.insert("max_tokens".to_string(), json!(8192));
obj.insert("max_tokens".to_string(), json!(max_tokens));
}
debug!("Using max_tokens: {}", max_tokens);
debug!(
"POST to {}: {}",
@@ -608,7 +610,9 @@ async fn process_chat_sse<S>(
) where
S: Stream<Item = Result<Bytes>> + Unpin,
{
debug!("process_chat_sse started, idle_timeout={:?}", idle_timeout);
let mut stream = stream.eventsource();
debug!("SSE stream initialized, waiting for first event");
// State to accumulate a function call across streaming chunks.
// OpenAI may split the `arguments` string over multiple `delta` events
@@ -643,7 +647,14 @@ async fn process_chat_sse<S>(
return;
}
Ok(None) => {
// Stream closed gracefully emit Completed with dummy id.
// Stream closed gracefully emit any pending items first, then Completed
debug!("Stream closed gracefully (Ok(None)), emitting pending items");
if let Some(item) = assistant_item.take() {
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
}
if let Some(item) = reasoning_item.take() {
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
}
let _ = tx_event
.send(Ok(ResponseEvent::Completed {
response_id: String::new(),
@@ -839,6 +850,7 @@ async fn process_chat_sse<S>(
// Emit end-of-turn when finish_reason signals completion.
if let Some(finish_reason) = choice.get("finish_reason").and_then(|v| v.as_str()) {
debug!("Received finish_reason: {}", finish_reason);
match finish_reason {
"tool_calls" if fn_call_state.active => {
// First, flush the terminal raw reasoning so UIs can finalize
@@ -857,27 +869,46 @@ async fn process_chat_sse<S>(
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
}
"stop" => {
// Regular turn without tool-call. Emit the final assistant message
// as a single OutputItemDone so non-delta consumers see the result.
"stop" | "length" => {
// Regular turn without tool-call, or hit max_tokens limit.
debug!("Processing finish_reason={}, assistant_item.is_some()={}, reasoning_item.is_some()={}",
finish_reason, assistant_item.is_some(), reasoning_item.is_some());
// Emit the final assistant message as a single OutputItemDone so non-delta consumers see the result.
if let Some(item) = assistant_item.take() {
debug!("Emitting assistant_item: {:?}", item);
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
} else {
debug!("No assistant_item to emit");
}
// Also emit a terminal Reasoning item so UIs can finalize raw reasoning.
if let Some(item) = reasoning_item.take() {
debug!("Emitting reasoning_item");
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
} else {
debug!("No reasoning_item to emit");
}
}
_ => {
// Unknown finish_reason - still emit pending items to avoid hanging
debug!("Unknown finish_reason: {}, emitting pending items", finish_reason);
if let Some(item) = assistant_item.take() {
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
}
// Also emit a terminal Reasoning item so UIs can finalize raw reasoning.
if let Some(item) = reasoning_item.take() {
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
}
}
_ => {}
}
// Emit Completed regardless of reason so the agent can advance.
debug!("Sending Completed event after finish_reason={}", finish_reason);
let _ = tx_event
.send(Ok(ResponseEvent::Completed {
response_id: String::new(),
token_usage: token_usage.clone(),
}))
.await;
debug!("Completed event sent, returning from SSE processor");
// Prepare for potential next turn (should not happen in same stream).
// fn_call_state = FunctionCallState::default();
@@ -886,6 +917,22 @@ async fn process_chat_sse<S>(
}
}
}
// Stream ended without finish_reason - this can happen when the stream closes abruptly
debug!("Stream ended without finish_reason, emitting final items and Completed event");
if let Some(item) = assistant_item.take() {
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
}
if let Some(item) = reasoning_item.take() {
let _ = tx_event.send(Ok(ResponseEvent::OutputItemDone(item))).await;
}
// Send Completed event so llmx knows the turn is done
let _ = tx_event
.send(Ok(ResponseEvent::Completed {
response_id: String::new(),
token_usage: token_usage.clone(),
}))
.await;
}
/// Optional client-side aggregation helper

View File

@@ -1123,6 +1123,7 @@ mod tests {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(1000),
max_tokens: None,
requires_openai_auth: false,
};
@@ -1187,6 +1188,7 @@ mod tests {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(1000),
max_tokens: None,
requires_openai_auth: false,
};
@@ -1224,6 +1226,7 @@ mod tests {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(1000),
max_tokens: None,
requires_openai_auth: false,
};
@@ -1263,6 +1266,7 @@ mod tests {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(1000),
max_tokens: None,
requires_openai_auth: false,
};
@@ -1298,6 +1302,7 @@ mod tests {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(1000),
max_tokens: None,
requires_openai_auth: false,
};
@@ -1333,6 +1338,7 @@ mod tests {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(1000),
max_tokens: None,
requires_openai_auth: false,
};
@@ -1437,6 +1443,7 @@ mod tests {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(1000),
max_tokens: None,
requires_openai_auth: false,
};

View File

@@ -2809,6 +2809,7 @@ model_verbosity = "high"
request_max_retries: Some(4),
stream_max_retries: Some(10),
stream_idle_timeout_ms: Some(300_000),
max_tokens: None,
requires_openai_auth: false,
};
let model_provider_map = {

View File

@@ -54,7 +54,7 @@ fn parse_user_message(message: &[ContentItem]) -> Option<UserMessageItem> {
Some(UserMessageItem::new(&content))
}
fn parse_agent_message(id: Option<&String>, message: &[ContentItem]) -> AgentMessageItem {
fn parse_agent_message(id: Option<&String>, message: &[ContentItem]) -> Option<AgentMessageItem> {
let mut content: Vec<AgentMessageContent> = Vec::new();
for content_item in message.iter() {
match content_item {
@@ -69,18 +69,23 @@ fn parse_agent_message(id: Option<&String>, message: &[ContentItem]) -> AgentMes
}
}
}
// If the message has no content, return None to signal turn completion
// This happens when the API ends a turn with an empty assistant message (e.g., after tool calls)
if content.is_empty() {
return None;
}
let id = id.cloned().unwrap_or_else(|| Uuid::new_v4().to_string());
AgentMessageItem { id, content }
Some(AgentMessageItem { id, content })
}
pub fn parse_turn_item(item: &ResponseItem) -> Option<TurnItem> {
match item {
ResponseItem::Message { role, content, id } => match role.as_str() {
"user" => parse_user_message(content).map(TurnItem::UserMessage),
"assistant" => Some(TurnItem::AgentMessage(parse_agent_message(
id.as_ref(),
content,
))),
"assistant" => parse_agent_message(id.as_ref(), content)
.map(TurnItem::AgentMessage),
"system" => None,
_ => None,
},

View File

@@ -87,6 +87,10 @@ pub struct ModelProviderInfo {
/// the connection as lost.
pub stream_idle_timeout_ms: Option<u64>,
/// Maximum number of tokens to generate in the response. If not specified, defaults to 8192.
/// This is required by some providers (e.g., Anthropic via LiteLLM).
pub max_tokens: Option<i64>,
/// Does this provider require an OpenAI API Key or ChatGPT login token? If true,
/// user is presented with login screen on first run, and login preference and token/key
/// are stored in auth.json. If false (which is the default), login screen is skipped,
@@ -290,6 +294,7 @@ pub fn built_in_model_providers() -> HashMap<String, ModelProviderInfo> {
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
},
),
@@ -330,6 +335,7 @@ pub fn built_in_model_providers() -> HashMap<String, ModelProviderInfo> {
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: true,
},
),
@@ -375,6 +381,7 @@ pub fn create_oss_provider_with_base_url(base_url: &str) -> ModelProviderInfo {
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
}
}
@@ -415,6 +422,7 @@ base_url = "http://localhost:11434/v1"
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
};
@@ -445,6 +453,7 @@ query_params = { api-version = "2025-04-01-preview" }
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
};
@@ -478,6 +487,7 @@ env_http_headers = { "X-Example-Env-Header" = "EXAMPLE_ENV_VAR" }
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
};
@@ -501,6 +511,7 @@ env_http_headers = { "X-Example-Env-Header" = "EXAMPLE_ENV_VAR" }
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
}
}
@@ -534,6 +545,7 @@ env_http_headers = { "X-Example-Env-Header" = "EXAMPLE_ENV_VAR" }
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
};
assert!(named_provider.is_azure_responses_endpoint());

View File

@@ -58,6 +58,7 @@ async fn run_request(input: Vec<ResponseItem>) -> Value {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(5_000),
max_tokens: None,
requires_openai_auth: false,
};

View File

@@ -58,6 +58,7 @@ async fn run_stream_with_bytes(sse_body: &[u8]) -> Vec<ResponseEvent> {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(5_000),
max_tokens: None,
requires_openai_auth: false,
};

View File

@@ -47,6 +47,7 @@ async fn responses_stream_includes_subagent_header_on_review() {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(5_000),
max_tokens: None,
requires_openai_auth: false,
};
@@ -135,6 +136,7 @@ async fn responses_stream_includes_subagent_header_on_other() {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(5_000),
max_tokens: None,
requires_openai_auth: false,
};

View File

@@ -712,6 +712,7 @@ async fn azure_responses_request_includes_store_and_reasoning_ids() {
request_max_retries: Some(0),
stream_max_retries: Some(0),
stream_idle_timeout_ms: Some(5_000),
max_tokens: None,
requires_openai_auth: false,
};
@@ -1195,6 +1196,7 @@ async fn azure_overrides_assign_properties_used_for_responses_url() {
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
};
@@ -1272,6 +1274,7 @@ async fn env_var_overrides_loaded_auth() {
request_max_retries: None,
stream_max_retries: None,
stream_idle_timeout_ms: None,
max_tokens: None,
requires_openai_auth: false,
};

View File

@@ -72,6 +72,7 @@ async fn continue_after_stream_error() {
request_max_retries: Some(1),
stream_max_retries: Some(1),
stream_idle_timeout_ms: Some(2_000),
max_tokens: None,
requires_openai_auth: false,
};

View File

@@ -80,6 +80,7 @@ async fn retries_on_early_close() {
request_max_retries: Some(0),
stream_max_retries: Some(1),
stream_idle_timeout_ms: Some(2000),
max_tokens: None,
requires_openai_auth: false,
};

View File

@@ -144,7 +144,7 @@ impl McpProcess {
let initialized = self.read_jsonrpc_message().await?;
let os_info = os_info::get();
let user_agent = format!(
"llmx_cli_rs/0.1.6 ({} {}; {}) {} (elicitation test; 0.0.0)",
"llmx_cli_rs/0.1.7 ({} {}; {}) {} (elicitation test; 0.0.0)",
os_info.os_type(),
os_info.version(),
os_info.architecture().unwrap_or("unknown"),
@@ -163,7 +163,7 @@ impl McpProcess {
"serverInfo": {
"name": "llmx-mcp-server",
"title": "LLMX",
"version": "0.1.6",
"version": "0.1.7",
"user_agent": user_agent
},
"protocolVersion": mcp_types::MCP_SCHEMA_VERSION

View File

@@ -5,7 +5,7 @@ expression: sanitized
/status
╭───────────────────────────────────────────────────────────────────────────╮
│ >_ LLMX (v0.1.6) │
│ >_ LLMX (v0.1.7) │
│ │
│ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │
│ information on rate limits and credits │

View File

@@ -5,7 +5,7 @@ expression: sanitized
/status
╭─────────────────────────────────────────────────────────────────╮
│ >_ LLMX (v0.1.6) │
│ >_ LLMX (v0.1.7) │
│ │
│ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │
│ information on rate limits and credits │

View File

@@ -5,7 +5,7 @@ expression: sanitized
/status
╭──────────────────────────────────────────────────────────────╮
│ >_ LLMX (v0.1.6) │
│ >_ LLMX (v0.1.7) │
│ │
│ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │
│ information on rate limits and credits │

View File

@@ -5,7 +5,7 @@ expression: sanitized
/status
╭──────────────────────────────────────────────────────────────╮
│ >_ LLMX (v0.1.6) │
│ >_ LLMX (v0.1.7) │
│ │
│ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │
│ information on rate limits and credits │

View File

@@ -5,7 +5,7 @@ expression: sanitized
/status
╭───────────────────────────────────────────────────────────────────╮
│ >_ LLMX (v0.1.6) │
│ >_ LLMX (v0.1.7) │
│ │
│ Visit https://chatgpt.com/llmx/settings/usage for up-to-date │
│ information on rate limits and credits │

View File

@@ -5,7 +5,7 @@ expression: sanitized
/status
╭────────────────────────────────────────────╮
│ >_ LLMX (v0.1.6) │
│ >_ LLMX (v0.1.7) │
│ │
│ Visit https://chatgpt.com/llmx/settings/ │
│ usage for up-to-date │

File diff suppressed because one or more lines are too long