Commit Graph
163 Commits
Author SHA1 Message Date
Jon Saad-FalconandGitHub a8569ec3a3 Merge pull request #120 from open-jarvis/feat/github-contribution-infra
feat: add take-bot workflow and update contribution docs
2026-03-25 08:49:45 -07:00
Jon Saad-FalconandClaude Opus 4.6 36554ab0d1 docs: consolidate README sections and add Contributing
- Merge Quick Start, Docker, and Development into single Quick Start
- Point to docs site for full documentation (Docker, cloud, dev setup)
- Add Contributing section with dev setup and roadmap pointer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 15:46:12 +00:00
Jon Saad-FalconandGitHub 14c81bba98 Merge pull request #115 from open-jarvis/feat/init-onboarding-and-privacy-scanner
feat: interactive model download in init + privacy environment scanner
2026-03-25 08:12:45 -07:00
Jon Saad-FalconandClaude Opus 4.6 68a8f5646c fix: add --no-download and PrivacyScanner mock to test_cli init test
The test_init_creates_config test in test_cli.py was not updated
when the download prompt and privacy hook were added to jarvis init.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 08:07:35 -07:00
Jon Saad-FalconandClaude Opus 4.6 b2152fb40e style: fix E501 line-length and unused imports in test files
Wraps long CliRunner.invoke() calls, removes unused pytest imports,
fixes import ordering, and removes unused variables in test_scan.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:38:14 -07:00
Jon Saad-FalconandClaude Opus 4.6 cbf6fe3ea2 feat: add take-bot workflow and update contribution docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 03:35:53 +00:00
Jon Saad-FalconandClaude Opus 4.6 bc2a7e5595 chore: remove spec/plan files from tracked tree
These are Claude-generated working documents that should not
be checked into the repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:31:09 -07:00
Jon Saad-FalconandClaude Opus 4.6 a934977ba8 fix: address spec review findings for privacy scanner
- Add slots=True to ScanResult dataclass
- Fix extra space in IPv6 port f-string
- Add missing tests: check_remote_access, check_icloud_sync, run_quick

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:26:05 -07:00
Jon Saad-FalconandClaude Opus 4.6 d9faa4621e style: fix E501 line length in model pull --engine option
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:24:07 -07:00
Jon Saad-FalconandClaude Sonnet 4.6 02bc36c1f8 feat: register jarvis scan command and add init privacy hook
Registers the new scan command in the CLI. Adds a lightweight
privacy check at the end of jarvis init that runs disk encryption
and cloud sync checks, with pointer to jarvis scan for full audit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 18:22:13 -07:00
Jon Saad-FalconandGitHub a5949052b6 Merge pull request #111 from open-jarvis/fix/token-counting-no-kv-cache
fix: count full prompt tokens
2026-03-24 18:21:03 -07:00
Jon Saad-FalconandClaude Opus 4.6 e2376d29d1 feat: add interactive model download and empty-model fallback to init
Prompts user to download recommended model during jarvis init.
Adds --no-download flag for CI. Shows helpful message when no
model fits available memory. Adds exo/nexa next-steps text.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:16:59 -07:00
Jon Saad-Falcon 00f71ae504 fix: update energy scaling test for linear KV-cache FLOPs model
The FLOPs formula changed from quadratic (P*N*(N+1)) to linear
(2*P*T_evaluated) with KV-cache awareness. Update the test
expectation from ~100x to ~10x for 10x token increase.
2026-03-24 18:16:11 -07:00
Jon Saad-FalconandClaude Opus 4.6 a05c2b7df6 feat: extract ollama_pull helper and add multi-engine model pull
Refactors model pull into reusable ollama_pull() function. Adds
--engine flag to support llamacpp (GGUF) and mlx (HuggingFace)
downloads via huggingface-cli, with FileNotFoundError handling.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:12:55 -07:00
Jon Saad-FalconandGitHub 5de72fb54e Merge pull request #112 from open-jarvis/revert/openai-compat-tool-call-fix
revert: remove _fix_tool_call_arguments from OpenAI-compatible engines
2026-03-24 18:12:29 -07:00
Jon Saad-Falcon 26a4e2e65e feat: KV-cache-aware FLOPs/energy with full-count dollar cost
Thread prompt_tokens_evaluated through the telemetry stack so
savings calculations use the right token count for each metric:

- Dollar cost: full prompt_tokens (what cloud providers charge)
- FLOPs/energy: prompt_tokens_evaluated (actual compute with KV
  cache — subsequent turns only re-evaluate new tokens)

Ollama reports both: prompt_eval_count (cache-aware) and we estimate
full count from messages. OpenAI-compat engines report full count
only (KV caching is transparent in their API).

Changes: TelemetryRecord, store schema, aggregator, engines,
savings calculation, /v1/savings route.
2026-03-24 18:12:13 -07:00
Jon Saad-FalconandClaude Opus 4.6 ced38bcba3 feat: add privacy environment scanner with platform-specific checks
New PrivacyScanner class with checks for disk encryption (FileVault/LUKS),
MDM profiles, cloud sync agents, network exposure, and screen recording.
Supports macOS and Linux with graceful skip on missing tools.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:07:54 -07:00
Jon Saad-FalconandClaude Opus 4.6 7d3b4e5ea3 fix: add MLX engine support to Qwen3.5 model catalog entries
Fixes recommend_model() returning empty string on Apple Silicon
when MLX is the recommended engine. Also adds gguf_file and
mlx_repo download metadata, and estimated_download_gb helper.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:04:25 -07:00
Jon Saad-FalconandClaude Opus 4.6 b2a88a5514 docs: add implementation plan for init onboarding and privacy scanner
6 tasks with TDD steps, covering model catalog fixes, multi-engine
pull, interactive download in init, privacy scanner, and CLI registration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:56:31 -07:00
Jon Saad-FalconandClaude Opus 4.6 d97e1dd266 revert: remove _fix_tool_call_arguments from OpenAI-compatible engines
Reverts the tool_call arguments string→dict conversion added in PR #69.

The OpenAI API spec requires tool_call arguments as JSON strings, not
dicts. vLLM with --enable-auto-tool-choice validates this and returns
400 errors when arguments are dicts. The original 400 errors were caused
by missing --enable-auto-tool-choice/--tool-call-parser flags on the
vLLM server, not by the arguments format.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 00:56:21 +00:00
Jon Saad-Falcon 3fee7e682b Merge remote-tracking branch 'origin/main' into fix/token-counting-no-kv-cache 2026-03-24 17:51:50 -07:00
Jon Saad-FalconandGitHub 45170f72a7 Merge pull request #110 from open-jarvis/feat/claude-github-actions
Add Claude GitHub Actions for PR review and issue fixing
2026-03-24 17:45:09 -07:00
Jon Saad-FalconandClaude Opus 4.6 b502441293 docs: add design spec for init model onboarding and privacy scanner
Covers two features based on user feedback:
1. Interactive model download in `jarvis init` with MLX catalog fix
2. New `jarvis scan` privacy environment audit command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:42:32 -07:00
Jon Saad-FalconandClaude Opus 4.6 3c2d9462ab fix: use correct claude-code-action input params and add id-token permission
- Replace invalid `model` input with default (action auto-selects)
- Replace `review_instructions`/`direct_prompt` with `prompt` (valid input)
- Add `id-token: write` permission required for OIDC token fetching

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:36:33 -07:00
Jon Saad-FalconandClaude Opus 4.6 9dbd172950 fix: mock config in test_init_defaults to test class-level defaults
The test_init_defaults test expected OperativeAgent class defaults
(temperature=0.3) but didn't mock load_config(), so when config loaded
successfully it returned the global default (0.7) instead.

Fix: mock load_config to raise, so the test properly validates the
class-level _default_temperature/max_tokens/max_turns fallback path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:30:46 -07:00
Jon Saad-Falcon 4ccec01784 ci: add Claude issue fixer workflow 2026-03-24 17:04:46 -07:00
Jon Saad-Falcon 620788bee1 ci: add Claude PR review workflow 2026-03-24 17:04:46 -07:00
Jon Saad-Falcon 4cdc4639bc docs: add REVIEW.md with PR review instructions for Claude 2026-03-24 17:04:46 -07:00
Jon Saad-Falcon 3777086d3a fix: count full prompt tokens without KV-cache assumption
Ollama's prompt_eval_count may exclude KV-cached tokens (system
prompt, prior conversation turns), under-counting the prompt size
used for cost/FLOPs/energy calculations and leaderboard submissions.

Engine changes:
- Add estimate_prompt_tokens() helper in engine/_base.py that
  computes cache-agnostic token count from message content
- Ollama + OpenAI-compat engines now use max(reported, estimated)
  to ensure system prompt and full context are always counted

Savings/leaderboard changes:
- Add TOKEN_COUNTING_VERSION=2 to savings.py so frontends can
  tag Supabase submissions (old=v1, corrected=v2)
- Desktop + web frontends forward version in leaderboard submissions
- Add POST /v1/telemetry/reset endpoint to clear stale telemetry

Active users auto-correct via upsert on next session; no manual
Supabase migration required.
2026-03-24 16:55:26 -07:00
Jon Saad-FalconandGitHub 033ced67e6 Merge pull request #109 from open-jarvis/fix/agent-config-defaults-103
fix: agent constructor defaults resolve from config.toml
2026-03-24 16:54:44 -07:00
Jon Saad-FalconandClaude Opus 4.6 9624f53c18 style: apply ruff format to changed files
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:43:51 -07:00
Jon Saad-FalconandClaude Opus 4.6 1fe75b2807 refactor: move agent defaults to class attrs, accept Optional params (issue #103)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:33:33 -07:00
59dad5eddf fix: address installation failures and SDK bugs (#100)
Bug 1 — Document Rust toolchain requirement:
- Add `maturin develop` step to README, installation docs (all 3
  sections), and quickstart.sh
- Note PYO3_USE_ABI3_FORWARD_COMPATIBILITY for Python 3.14+

Bug 2 — Fix namespace package conflict:
- Move force-include targets from openjarvis/ to _node_modules/ in
  pyproject.toml to prevent editable-install namespace shadowing
- Add fallback path resolution in claude_code.py and
  whatsapp_baileys.py for wheel installs

Bug 3 — Fix trace debugger "No traces yet":
- Enable traces by default (TracesConfig.enabled = True)
- Fix api_routes.py: use store.list_traces() not .recent(),
  dataclasses.asdict() not .to_dict(), get store from app.state
- Wire TraceStore into app.state in app.py

Bug 4 — Fix thinking models returning empty responses:
- Remove hardcoded enable_thinking: False from _openai_compat.py
  that suppressed Qwen3/DeepSeek-R1 output on OpenAI-compatible
  engines (vLLM, SGLang, llama.cpp)

Closes #100

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:29:26 -07:00
Jon Saad-FalconandClaude Opus 4.6 cc4621a840 fix: resolve agent defaults from config with class-level fallbacks (issue #103)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:15:59 -07:00
Jon Saad-FalconandClaude Opus 4.6 7b5f078b4b test: add failing tests for agent config-based default resolution (issue #103)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:14:31 -07:00
Jon Saad-FalconandClaude Opus 4.6 0481f32129 perf: cache load_config() with lru_cache to avoid repeated hardware detection
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:12:47 -07:00
406c115a52 fix: register all tool modules so they appear in web UI (#99) (#107)
Eight tool modules (file_write, apply_patch, git_tool, db_query,
pdf_tool, image_tool, audio_tool, knowledge_tools) were missing from
openjarvis/tools/__init__.py. Their @ToolRegistry.register() decorators
never fired, so the /v1/tools endpoint never returned them and the
web UI agent wizard showed an incomplete tool list.

Add the missing imports and a regression test that checks all expected
tool names are in the registry after package import.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:12:36 -07:00
Jon Saad-FalconandGitHub 228eff7c35 Merge pull request #106 from mricharz/feat/managed-agent-streaming
feat: add SSE streaming support for managed agent messages
2026-03-24 15:57:12 -07:00
Jon Saad-FalconandClaude Opus 4.6 601942c9ce style: wrap long logger.warning line to fix E501 lint error
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:52:14 -07:00
555e982f51 feat: query complexity analyzer for local/cloud routing (#102)
* feat: add query complexity analyzer with CLI and UI integration

Classify incoming queries by difficulty (trivial→very_complex) to
suggest appropriate token budgets for local vs. cloud routing.

- Add score_complexity() with weighted signals (length, code, math,
  reasoning, multi-step, creative) and token tier mapping
- Wire into `jarvis ask`: auto-suggest max_tokens when not set by user,
  show complexity in --profile output, log at DEBUG level
- Add complexity metadata to /v1/chat/completions API response
- Display complexity tier and score in frontend XRayFooter
- Extend RoutingContext with complexity_score, suggested_max_tokens,
  has_reasoning fields
- Update HeuristicRouter to route on complexity_score instead of
  raw query_length
- Remove duplicated regex patterns from router.py (use complexity
  module as single source of truth)
- Add 30 unit tests for complexity module
- Fix existing router tests for new complexity-based routing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: pass temperature and max_tokens from UI settings to backend

The settings page stores temperature and max_tokens in the frontend
store, but these values were never included in the chat API request.
The backend Pydantic model defaults max_tokens to 1024 when the field
is absent, which is too low for thinking models like qwen3.5 — they
consume all tokens on reasoning and return empty content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: pass UI settings to backend and auto-bump max_tokens from complexity

- Pass temperature and max_tokens from frontend Settings store to the
  backend API (cherry-picked from fix/ui-max-tokens-passthrough)
- Server-side: bump max_tokens when the complexity analyzer suggests a
  higher budget (e.g. for thinking models on complex queries), never
  reduce below the client-requested value
- Fixes empty responses with thinking models (e.g. qwen3.5) that
  consumed all tokens on internal reasoning

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: raise token budget tiers to prevent empty responses on thinking models

Double all tier budgets (trivial: 512→1024, simple: 1024→2048, etc.)
so that thinking models like qwen3.5 have enough headroom for internal
chain-of-thought plus visible output, even on simple queries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: CI lint and test failures

- Break long lines in routes.py to satisfy 88-char limit (E501)
- Add intelligence.max_tokens and temperature to mocked config in
  test_ask_router.py so complexity analyzer can compare against int
  instead of MagicMock

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: line too long in test_complexity.py (E501)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 15:27:23 -07:00
Jon Saad-FalconandGitHub 52d72fc87f Merge pull request #105 from jbergant/fix/wire-trace-store-to-executor
fix: wire TraceStore into AgentExecutor when traces.enabled is true
2026-03-24 15:23:41 -07:00
manuel.richarz b7ad2d2c12 feat: add SSE streaming support for managed agent messages
Add `stream: bool` parameter to `POST /v1/managed-agents/{id}/messages`.
When `stream=true`, the agent processes the message synchronously and
returns an SSE stream (OpenAI-compatible format) with token-by-token
response, tool result events, and usage metadata.

This enables real-time voice assistants and chat UIs to receive agent
responses as they are generated, rather than polling for completion.

- Extend SendMessageRequest with `stream` field (default: false)
- Add _stream_managed_agent() helper using asyncio.to_thread()
- Build AgentContext from conversation history for multi-turn support
- Emit tool_results as named SSE events
- Persist agent response in DB after streaming completes
- Add 6 new tests covering streaming behavior
- Update agents.md documentation with streaming examples
2026-03-24 14:56:58 +01:00
Jana BergantandClaude Opus 4.6 f1aaed0895 fix: wire TraceStore into AgentExecutor when traces.enabled is true
SystemBuilder.build() constructed AgentExecutor without a trace_store,
so traces were never recorded even when config.traces.enabled = true.
The traces.enabled flag was parsed but never read during executor
construction.

Now reads config.traces.enabled and creates a TraceStore instance
that is passed to AgentExecutor, enabling trace recording for
jarvis agents ask/run and the agent scheduler daemon.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 14:36:19 +01:00
16f601c7d7 feat: NVIDIA GPU Docker support with compose override (#93)
* feat: nvidia gpu config for docker

* refactor: split NVIDIA GPU support into compose override

Address review feedback:
- Revert --engine ollama from base Dockerfile CMD (breaks non-Ollama users)
- Keep bookworm pin and OLLAMA_HOST fix in base config
- Move GPU-specific config (/proc, /sys mounts, deploy.resources.reservations)
  into new docker-compose.gpu.nvidia.yml override, matching the existing ROCm
  pattern (docker-compose.gpu.rocm.yml)
- Restore Ollama port to standard 11434
- Remove commented-out GPU blocks from base docker-compose.yml
- Add Ollama healthcheck with depends_on condition to base compose
- Remove run.sh from repo root
- Rewrite README Docker section to document CPU, NVIDIA, and ROCm patterns

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Jon Saad-Falcon <41205309+jonsaadfalcon@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 01:53:13 -07:00
04c28ef7ed feat: add CLI commands: config, registry, tool (#98)
* feat: add CLI commands: config, registry, tool

* fix: address review feedback on CLI config/registry/tool commands

- Replace non-existent `create_config_template` with `generate_default_toml`
  to fix ImportError when config file is missing
- Deduplicate registry maps into shared `_load_registry_map()` helper
- Remove dead `_get_registry_class()` function and its tests
- Route JSON output to stdout for pipeability (`jarvis config show json | jq`)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Jon Saad-Falcon <41205309+jonsaadfalcon@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 01:38:23 -07:00
8468f08c41 fix: correct O(N²) energy/FLOPs savings calculation (#95) (#97)
The energy_wh_saved and flops_saved values were orders of magnitude too
high because a scaling factor that grows linearly with N was applied to
the energy calculation, making it scale as O(N³) instead of O(N²).

Replace the buggy scale-factor approach with a direct FLOP-to-energy
conversion using each provider's per-token constants. Add regression
tests to prevent recurrence.

Closes #95

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:52:18 -07:00
Prathap PandGitHub c2756964a7 fix(channels): wire channel→agent handler and fix Telegram send pipeline (#94)
* fix(channels): wire channel→agent handler and fix Telegram send pipeline

* format code

* add supported tests
2026-03-20 18:35:18 -07:00
62eaa70736 feat: add MiniMax as cloud inference provider with M2.7 default (#85)
* feat: add MiniMax as cloud inference provider

Add MiniMax M2.5 and M2.5-highspeed as a 5th cloud provider alongside
OpenAI, Anthropic, Google, and OpenRouter. Uses the OpenAI-compatible
API at api.minimax.io/v1 via the existing openai SDK dependency.

Changes:
- Add MiniMax client init, generate, and streaming in CloudEngine
- Add MiniMax models to model catalog with correct pricing
- Add MINIMAX_API_KEY environment variable support
- Add temperature clamping (0.01-1.0) per MiniMax API constraints
- Add 19 unit tests and 3 integration tests
- Update docs and README with MiniMax provider info

* feat: upgrade MiniMax default model to M2.7

- Add MiniMax-M2.7 and MiniMax-M2.7-highspeed to model list
- Set MiniMax-M2.7 as default model (first in list)
- Keep all previous models (M2.5, M2.5-highspeed) as alternatives
- Update pricing table with M2.7 entries
- Update model catalog with M2.7 specs
- Update docs to list all available MiniMax models
- Update unit tests (23 passing) and integration tests (3 passing)

---------

Co-authored-by: Octopus <octo-patch@users.noreply.github.com>
2026-03-20 04:16:33 -07:00
Jon Saad-FalconandGitHub cbdb720e06 Merge pull request #83 from TeemuSailynoja/fix/duckduckgo-fallback
feat: add DuckDuckGo fallback to web_search tool
2026-03-20 04:02:18 -07:00
Teemu Säilynoja 806067a002 fix: simplify web search error handling and improve test mocks
- Catch any Exception from Tavily (not just specific error types)
- Fall back to DuckDuckGo for any error, making the tool more robust
- Fix test mocks to use builtins.__import__ for proper local import mocking
- Simplify test_execute_tavily_error to test generic exception handling
2026-03-17 10:34:45 +02:00