mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-25 14:53:34 +00:00
c148dd2b5bd4ec7fb75a0e54d463fffd2bb9da60
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8cd9b4bcfd |
chore: sync main into staging (#855)
* fix(ci): secrets can't be used in step if conditions [skip-regression-check] (#787) GitHub Actions step-level `if:` doesn't have access to `secrets` context. Replace `if: secrets.X != ''` with `continue-on-error: true` and let the Set token step handle the fallback. Co-authored-by: Claude Sonnet 4.6 <[email protected]> * fix(ci): clean up staging pipeline — remove hacks, skip redundant checks [skip-regression-check] (#794) - Remove continue-on-error from staging-ci.yml app token steps (secrets are configured) - Skip test.yml and code_style.yml on PRs targeting staging (staging-ci.yml already runs tests before promoting, promotion PR gets full CI on main) - Allow ironclaw-ci[bot] in Claude Code review for bot-created promotion PRs Co-authored-by: Claude Opus 4.6 <[email protected]> * fix(ci): run fmt + clippy on staging PRs, skip Windows clippy [skip-regression-check] (#802) - Remove branches:[main] filter from code_style.yml so it runs on all PRs - Gate clippy-windows with `if: github.base_ref == 'main'` (skip on staging PRs) - Update rollup job to allow skipped clippy-windows - Simplify claude-review.yml to only trigger on labeled event (avoids duplicate runs) Co-authored-by: Claude Opus 4.6 <[email protected]> * feat: persist user_id in save_job and expose job_id on routine runs (#709) * feat: persist worker events to DB and fix activity tab rendering In-process Worker (used by Scheduler::dispatch_job) now persists events via save_job_event at key execution points: plan creation, LLM responses, tool_use, tool_result, and job completion/failure/stuck. Event data shapes match the container worker format so the gateway activity tab renders them correctly. Frontend: tool_result errors now show a red X icon with danger styling instead of a silent empty output. The result event falls back to the error field when message is absent. Co-Authored-By: Claude Opus 4.6 <[email protected]> * feat: wire RoutineEngine into gateway for direct manual trigger firing Replace the message-channel hack in routines_trigger_handler with a direct call to RoutineEngine::fire_manual(), ensuring FullJob routines dispatch correctly when triggered from the web UI. Inject the engine into GatewayState from Agent::run after construction. Also persists user_id in save_job for both PG and libSQL backends, removes the source='sandbox' filter so all jobs are visible, and exposes job_id on RoutineRunInfo for the frontend job link. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: remove stale gateway_state argument from Agent::new test call sites The gateway_state parameter was removed from Agent::new during rebase (replaced by post-construction set_routine_engine_slot), but three test call sites still passed the extra None argument. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: address PR review — restore sandbox source filter, remove blank lines - Revert removal of `source = 'sandbox'` filter in all SandboxStore queries (8 sites across PG and libSQL). Sandbox-specific APIs should stay scoped to sandbox jobs; unified job listing for the Jobs tab should use a separate query path. - Remove extra blank lines in agent_loop.rs and worker.rs that caused formatting CI failure. [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: address review — regenerate Cargo.lock, add user_id regression test - Regenerate Cargo.lock from main's lockfile to eliminate dependency version downgrades (anyhow, syn, etc.) that were churn from rebase. - Add regression test verifying user_id round-trips through save_job and get_job in the libSQL backend. Co-Authored-By: Claude Opus 4.6 <[email protected]> * style: remove trailing blank line in libsql jobs.rs [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * test: add Postgres-side regression test for user_id persistence in save_job Mirrors the existing libSQL test (test_save_job_persists_user_id) for the Postgres backend. Gated behind #[cfg(feature = "postgres")] + #[ignore] since it requires a running PostgreSQL instance (integration tier). Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]> * feat(llm): per-provider unsupported parameter filtering (#749, #728) (#809) Add declarative `unsupported_params` field to provider definitions in providers.json. Parameters listed are stripped from requests before sending, preventing 400 errors from providers that reject them (e.g. gpt-5 family and kimi-k2.5 rejecting custom temperature values). - Add `unsupported_params` to ProviderDefinition and RegistryProviderConfig - Propagate from registry through config resolution - Generic strip helpers handle temperature, max_tokens, stop_sequences - Apply filtering in RigAdapter and AnthropicOAuthProvider - Mark openai and tinfoil providers as unsupporting temperature - Update openai default model to gpt-5-mini Co-authored-by: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]> Co-authored-by: Illia Polosukhin <[email protected]> |
||
|
|
d73e35cfb0 |
feat: add AWS Bedrock LLM provider via native Converse API (#713)
* 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]> |
||
|
|
12ba79ffc3 |
feat(llm): add Google Gemini, AWS Bedrock, io.net, Mistral, Yandex, and Cloudflare WS AI providers (#676)
* feat(llm): add Google Gemini and AWS Bedrock providers * feat(llm): add io.net, Mistral, Yandex, and Cloudflare WS AI providers |
||
|
|
5c2ba44f12 |
feat(llm): declarative provider registry (#618)
* feat(llm): declarative provider registry, replace hardcoded provider configs Replace the hardcoded LlmBackend enum and per-provider config structs with a declarative JSON registry. Adding a new OpenAI-compatible provider now requires zero Rust code changes -- just add an entry to providers.json. - Add providers.json with 14 providers (openai, anthropic, ollama, openai_compatible, tinfoil, openrouter, groq, nvidia, venice, together, fireworks, deepseek, cerebras, sambanova) - Add src/llm/registry.rs with ProviderProtocol, SetupHint, ProviderDefinition, and ProviderRegistry types - Rewrite src/config/llm.rs: remove LlmBackend enum and 5 per-provider config structs, replace with generic RegistryProviderConfig - Simplify src/llm/mod.rs: remove 5 create_*_provider functions, dispatch on ProviderProtocol (3 code paths for all providers) - Dynamic setup wizard: menu built from registry.selectable(), generic credential collection dispatched by SetupHint kind - Dynamic secret injection: inject_llm_keys_from_secrets() discovers secret-to-env mappings from registry instead of hardcoded list - Users can extend with ~/.ironclaw/providers.json (no recompile) - Subsumes open provider PRs: Groq #570, NVIDIA NIM #576, Venice.ai #451 (Gemini #476 excluded -- not OpenAI-compatible) [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * feat(llm): self-sufficient provider auth, onboard --provider-only, extract SessionConfig - NearAiChatProvider handles its own session auth lazily in resolve_bearer_token() instead of requiring main.rs to pre-check. Triggers OAuth/API-key login on first request when no token exists. - Add `ironclaw onboard --provider-only` to reconfigure just the LLM provider and model selection without re-running the full wizard. - Extract auth_base_url and session_path from NearAiConfig into LlmConfig::session (SessionConfig). Callers now use config.llm.session directly instead of reaching into nearai fields. [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(llm): address PR review comments on provider registry - Use registry.selectable() instead of registry.all() for secret injection to avoid duplicates from user provider overrides. - Fix selectable() dedup bug: check setup hint on the final (overridden) definition, not the first occurrence. User overrides that add a setup hint are now included correctly. - Only store openai_compatible_base_url for providers that actually use LLM_BASE_URL, preventing base URL pollution for groq/nvidia/etc. - Normalize provider_id to canonical registry def.id instead of using the raw user-supplied alias string. - Add comment explaining why .completions_api() is used over the default Responses API path. [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(docker): copy providers.json into build context The declarative provider registry uses `include_str!("../../providers.json")` at compile time, so the file must be present in the Docker builder stage. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(llm): address second-round PR review comments (#618) - Make --channels-only and --provider-only mutually exclusive via clap conflicts_with (Copilot: cli/mod.rs) - Add 5s timeout to fetch_openai_compatible_models(), matching the other three model-fetch helpers (Copilot: wizard.rs) - Apply models_filter from setup hints when listing models, so Groq's "chat" filter actually excludes non-chat models (Copilot: wizard.rs) - Normalize LlmConfig.backend to the canonical provider ID instead of the raw user-supplied alias string (Copilot: llm.rs) - Add models_filter() accessor to SetupHint with regression test Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(test): relax flaky parallel speedup timing threshold The test_parallel_speedup test asserted <500ms but CI runners can be slow enough to exceed that while still proving parallelism. Bumped to 800ms which still validates parallel execution (sequential would be ~600ms minimum) while tolerating CI jitter. [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(llm): handle api_key_login path in resolve_bearer_token, warn on missing keys - resolve_bearer_token() now checks NEARAI_API_KEY env var after ensure_authenticated(), handling the case where the user entered an API key via the interactive login flow (which sets the env var but not a session token) - Add tracing::warn when creating an OpenAI-compatible provider without an API key, making 401 errors easier to diagnose - Add regression test for resolve_bearer_token auth paths Co-Authored-By: Claude Opus 4.6 <[email protected]> * style: fix formatting in nearai_chat test [skip-regression-check] Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix(llm): correct bearer token priority, handle setup-less providers (#618) - resolve_bearer_token(): session token now takes priority over NEARAI_API_KEY env var, preventing unexpected auth mode switches. The env var fallback only triggers after ensure_authenticated() when no session token was stored (api_key_login path). - run_provider_setup(): providers with setup: None no longer error, allowing env-var-only providers to be kept during re-onboarding. - Split bearer token test into 3 focused tests: config api_key path, session token path, and session-beats-env-var precedence test. - Add test for wizard handling of providers without setup hints. Co-Authored-By: Claude Opus 4.6 <[email protected]> * test(llm): comprehensive tests for provider registry, config, and auth Add 13 new tests covering the critical paths in the provider system: Bearer token auth priority (nearai_chat.rs): - config api_key wins over session token and env var - session token wins over env var (prevents mid-run auth mode switches) - config api_key path works in isolation - session token path works in isolation Config resolution (config/llm.rs): - backend alias normalization (open_ai → openai) - unknown backend falls back to openai_compatible - nearai aliases (nearai, near_ai, near) all resolve correctly - base URL resolution priority (env > settings > registry default) Registry dedup (registry.rs): - user override adds setup hint → appears in selectable() - user override removes setup hint → excluded from selectable() - selectable() preserves insertion order during dedup - all built-in ApiKey providers have api_key_env set Wizard (wizard.rs): - setup: None providers don't error during re-onboarding Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]> |