* feat: add AWS Bedrock LLM provider via native Converse API
* fix: use JSON parsing for tool result error detection instead of brittle substring matching
* refactor: extract duplicated inference config builder into helper function
* fix: address review feedback — safe casts, input validation, and tests
- Safe u32→i32 cast for max_tokens using try_from with clamp
- Remove brittle string-based error detection fallback for tool results
- Validate BEDROCK_CROSS_REGION against allowed values (us/eu/apac/global)
- Validate message list is non-empty before Converse API call
- Log when using default us-east-1 region
- Update llm_backend doc comment to list all backends
- Add tests for build_inference_config and empty message handling
* fix: persist AWS_PROFILE for Bedrock named profile auth
The wizard collected the profile name but only printed a hint to set
it manually. Now it saves to settings and writes AWS_PROFILE to the
bootstrap .env, consistent with how BEDROCK_REGION and other Bedrock
settings are persisted.
* feat: gate AWS Bedrock behind optional `bedrock` feature flag
The AWS SDK dependencies (aws-config, aws-sdk-bedrockruntime,
aws-smithy-types) require cmake and a C compiler to build aws-lc-sys.
Gate them behind an opt-in `bedrock` feature flag so default builds
are unaffected.
Build with: cargo build --features bedrock
All config, settings, and wizard code stays unconditional (no AWS deps)
so users can configure Bedrock even without the feature compiled — they
get a clear error at startup directing them to rebuild.
* fix: address review feedback and adapt Bedrock provider to registry architecture (takeover #345)
- Resolve merge conflicts with main's registry-based provider system
- Add missing cache_creation_input_tokens/cache_read_input_tokens fields
- Add missing content_parts field in test ChatMessage
- Fix string literal type mismatches in wizard env_vars (.to_string())
- Remove non-functional bearer token auth (AWS_BEARER_TOKEN_BEDROCK) from
wizard and documentation per reviewer feedback from @zmanian and @serrrfirat
- Remove stale BEDROCK_ACCESS_KEY proxy entry from provider table
- Update Bedrock provider to use is_bedrock string check (LlmBackend enum removed)
- Add bedrock_profile fallback from settings in config resolution
[skip-regression-check]
Co-Authored-By: cgorski <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: use main's Cargo.lock as base to preserve dependency versions
Regenerating Cargo.lock from scratch caused transitive dependency version
drift that broke the html_to_markdown fixture test in CI.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: bedrock config bugs — spurious warning, alias normalization, profile fallback
- Move is_bedrock check before unknown-backend warning to prevent
spurious "unknown backend" log for bedrock users
- Normalize backend aliases ("aws", "aws_bedrock") to "bedrock" so
the provider factory matches correctly
- Add settings.bedrock_profile fallback for AWS_PROFILE, consistent
with region and cross_region resolution
[skip-regression-check]
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: address Copilot review feedback — bearer token cleanup, stop_sequences, model dedup
- Remove stale bearer token refs from setup README and CHANGELOG
- Remove dead bedrock_api_key secret injection mapping
- Pass stop_sequences through to Bedrock InferenceConfiguration
- Remove "API key" from wizard menu description (bearer token removed)
- Skip duplicate LLM_MODEL write for bedrock backend in wizard
- Fix cargo fmt formatting
[skip-regression-check]
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: address review feedback — async new(), remove LiteLLM entry, wizard fixes
- Remove dead LiteLLM-based bedrock entry from providers.json (native
Converse API intercepts before registry lookup)
- Make BedrockProvider::new() async to avoid block_in_place panic in
current_thread runtimes; propagate async to create_llm_provider,
build_provider_chain, and init_llm
- Document CMake build prerequisite in docs/LLM_PROVIDERS.md
- Clear bedrock_profile when user selects "default credentials" in wizard
- Fix selected_model clearing to match established pattern (conditional
on provider switch, not unconditional)
- Add regression tests for bedrock model preservation and profile clearing
Addresses review feedback from @zmanian on PR #713.
Streaming support tracked in #741.
[skip-regression-check]
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: address remaining review comments — CLAUDE.md backends, wizard UX
- Add `bedrock` to CLAUDE.md inline backend list (#10)
- Skip full setup re-run when keeping existing Bedrock config (#11)
- Clear stale bedrock_profile on empty named-profile input (#12)
- Add regression test for empty profile clearing
Co-Authored-By: Claude Opus 4.6 <[email protected]>
---------
Co-authored-by: Chris Gorski <[email protected]>
Co-authored-by: cgorski <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
* fix: harden openai-compatible tool flow and local defaults
* fix: close approval replay gaps and harden openai-compatible flow
* fix: address review feedback and code improvements (takeover #112)
- Make ChatCompletionResponse.id Optional<String> to handle providers
that omit or null the field
- Propagate HTTP client builder errors instead of silently dropping
timeout configuration (openai_compatible_chat, nearai_chat)
- Add EMBEDDING_DIMENSION env var with smart per-model defaults instead
of hardcoding 768/1536 everywhere
- Remove duplicated dimension inference logic from main.rs
Co-Authored-By: panosAthDBX <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: harden src/llm/ module from crate audit findings
- Replace 9x .expect() on RwLock with graceful poison recovery
(nearai.rs: 7, nearai_chat.rs: 2) — eliminates production panics
- Propagate HTTP client builder errors in nearai.rs instead of
silently dropping timeout config (NearAiProvider::new now returns Result)
- Make nearai_chat ChatCompletionResponse.id Optional<String>
(mirrors openai_compatible_chat.rs fix for providers that omit id)
- Make nearai_chat usage fields optional with defensive parse_usage()
helper (was required u32 fields that crash on null/missing)
- Truncate error responses to 512 chars in nearai_chat.rs error
messages to prevent log bloat and potential data leakage
- Delegate 4 missing LlmProvider methods in FailoverProvider
(model_metadata, seed_response_chain, get_response_chain_id,
calculate_cost) to last-used provider instead of trait defaults
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* refactor(llm): add RetryProvider, remove openai_compatible_chat, harden decorators
- Add composable RetryProvider decorator wrapping any LlmProvider with
exponential backoff + jitter, respecting RateLimited retry_after hints
- Remove openai_compatible_chat.rs — replaced by rig adapter + RetryProvider
- Remove internal retry loop from nearai.rs (was causing double-retry
with external RetryProvider, up to 16 attempts instead of 4)
- Remove internal retry loop from nearai_chat.rs (same issue)
- Wire RetryProvider into main.rs composition chain: each provider gets
its own retry wrapper before failover
- Move normalize_tool_name to rig_adapter.rs for all rig-based providers
- Reconcile is_retryable() vs is_transient() error classification:
ModelNotAvailable no longer retryable, Json no longer transient
- Fix unchecked Duration subtraction panic in circuit_breaker.rs
- Make failover.rs use shared is_retryable() from retry.rs
- Remove stale #[allow(dead_code)] on NearAiResponse::id (field is used)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* fix: address PR review feedback — error handling, dimension validation, libSQL warning
- Replace response.text().await.unwrap_or_default() with proper error
propagation in nearai.rs and nearai_chat.rs (4 call sites). Failures
now return LlmError::RequestFailed with context instead of silently
proceeding with an empty string.
- Add embedding dimension validation in OllamaEmbeddings::embed_batch():
returns EmbeddingError if Ollama returns embeddings with a dimension
that doesn't match the configured value.
- Add runtime warning when libSQL backend is used with non-1536 embedding
dimension, since the libSQL schema uses F32_BLOB(1536) and cannot store
different-dimension vectors.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
* Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
---------
Co-authored-by: panosAthDbx <[email protected]>
Co-authored-by: panosAthDBX <[email protected]>
Co-authored-by: panosAthDBX <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Copilot <[email protected]>