Commit graph

6 commits

Author SHA1 Message Date
Jacob Magar
cc1617a3a9 fix(gemini-cli): correct CLI invocation to match gemini v0.36 interface
The previous implementation used wrong flags (-p without value, --json,
--max-output-tokens) that don't exist in the real gemini CLI.

Correct invocation:
- Pass prompt as -p STRING value (not via stdin)
- Use --output-format json to get structured {response, stats} output
- Add --yolo to suppress interactive confirmation prompts
- Remove nonexistent --json and --max-output-tokens flags
- Parse `.response` field from JSON output, skipping MCP noise lines
- Extend timeout from 30s to 60s (agentic CLI is slower than raw API)

Smoke tested end-to-end: stdin HTML → summarize and --extract-json
both produce correct output via Gemini CLI.
2026-04-11 12:16:21 -04:00
Jacob Magar
af304eda7f docs(noxa-9fw.4): describe gemini cli as primary llm backend
- Update CLAUDE.md: provider chain, LLM modules section, CLI examples
- Update env.example: add GEMINI_MODEL, reorder providers (Gemini first)
- Update noxa-llm/src/lib.rs crate doc comment
2026-04-11 07:36:19 -04:00
Jacob Magar
993fd6c45d feat(noxa-9fw.3): validate structured extraction output with one retry
- Add jsonschema crate for schema validation in extract_json
- On parse failure (invalid JSON): retry once with identical request
- On schema mismatch (valid JSON, wrong schema): fail immediately — no retry
- validate_schema() produces concise error with field path from instance_path()
- Add SequenceMockProvider to testing.rs for first-fail/second-success tests
- Fix env var test flakiness: mark env_model_override as ignored
2026-04-11 07:34:58 -04:00
Jacob Magar
420a1d7522 feat(noxa-9fw.2): make gemini cli the primary llm backend
- ProviderChain::default() order: Gemini CLI -> OpenAI -> Ollama -> Anthropic
- Add --llm-provider gemini arm to build_llm_provider() in noxa-cli
- Update unknown-provider error to mention gemini
- Update empty-chain error messages in CLI and MCP to mention gemini CLI
- Update MCP startup warn! to list gemini CLI as first option
2026-04-11 07:32:24 -04:00
Jacob Magar
d800c37bfd feat(noxa-9fw.1): add gemini cli provider adapter
- Add LlmError::Subprocess(#[from] io::Error) and LlmError::Timeout variants
- Implement GeminiCliProvider: new(model) -> Self matching OllamaProvider pattern
- Prompts passed exclusively via stdin (Stdio::piped), never as CLI args
- 30s subprocess timeout via tokio::time::timeout to prevent hung processes
- 6-slot Semaphore to bound concurrent subprocess spawns in MCP context
- Stderr captured and included (first 500 bytes) in non-zero exit errors
- is_available(): pure `gemini --version` PATH check, no live inference
- GEMINI_MODEL env override; default model gemini-2.5-pro
- strip_thinking_tags + strip_code_fences applied to stdout output
2026-04-11 07:30:41 -04:00
Jacob Magar
8674b60b4e chore: rebrand webclaw to noxa 2026-04-11 00:10:38 -04:00