The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Commits on main
test(inference): address review — assertable templates, a real precondition, offline Ollama\n\nReview fixes for #5879. NOT EXECUTED LOCALLY: the no-local-builds rule landed\nmid-way, so everything below is reasoned from source and CI is the check. I have\nsaid so on each thread rather than implying these were run.\n\n**EmbeddingsSetupModal — two tests that could not fail (YellowSnnowmann).**\nThe i18n mock returned the key for every lookup, so `t('…testSuccess')` yielded\nthe literal key with no `{dims}` placeholder and the component's\n`.replace('{dims}', …)` was a no-op. `actual_dimensions: 1536`, the `?? '?'`\nfallback, and dropping the substitution entirely all rendered identically — the\ntest name promised a check it never made, and the same held for `{error}`. The\nmock now returns the real `en.ts` templates for exactly those two keys, and the\ntests assert the substituted output (`Connected: 1536 dimensions`,\n`Failed: bad key`). Added the `?` fallback case, which is now expressible.\n\n**EmbeddingsSetupModal — a name that contradicted its assertion\n(YellowSnnowmann).** "locks both buttons while testing" asserted Save is\n*enabled*. The assertion is the correct one — Save stays live so a user who has\nalready pasted a working key is not blocked behind a slow probe — so the name is\nwhat was wrong. Renamed, with the reason in a comment.\n\n**AgentInsightsPreview — a precondition that was doing no work (CodeRabbit).**\nThe "leaves errors alone" half only exercises anything if the fixture contains\nan error entry. Removing that fixture, or flipping it to success, would have\nleft the test green while it silently stopped checking preservation. Now asserts\nan error entry exists before the mapping check, and that one survives.\n\n**Rust controller suite — it was not actually offline (chatgpt-codex).** Correct\nand specific: `assets_status` and `downloads_progress` reach\n`LocalAiService::assets_status`, which probes `GET {base}/api/tags` with a\ntwo-second timeout, defaulting to localhost:11434 and honouring the ambient\n`OLLAMA_HOST`. So the suite made real socket calls and behaved differently on a\nmachine running Ollama — contradicting its own header. Both tests now pin\n`OPENHUMAN_OLLAMA_BASE_URL` to a closed loopback port (discard port 9, so\nconnect is refused instantly rather than timing out) and clear `OLLAMA_HOST`.\nThe header no longer overclaims.\n\n**One ask answered rather than implemented (CodeRabbit, credential redaction).**\n`presentProviderSetupError` performs no redaction, so a custom provider echoing\nan arbitrary-shaped key reaches the DOM. The concern is real, but redacting is a\nproduct change that would also hide diagnostics, and this is a test-only PR.\nAdded a characterisation test pinning the current behaviour with a pointer to\nthe bug list, so the gap is visible and regression-locked; the fix belongs in\nits own PR.\n M3gA-Mind committed 3 months ago
a1f87e7 test(settings): cover three inference-facing surfaces that had no tests\n\n`ProviderSetupErrorNotice`, `EmbeddingsSetupModal` and `AgentInsightsPreview`\nwere all at zero tests. Each is reached exactly when something has already\ngone wrong or when nobody is looking, which is why none of them had any.\n\nProviderSetupErrorNotice (21 tests). `presentProviderSetupError` is the\nfunction that turns a raw provider error into the one line a user reads. Covers\nthe 401/403, 404, 5xx and network branches, JSON message extraction with escape\ndecoding, the 220-character truncation, and the generic-provider fallback. One\nbehaviour is pinned because it is surprising rather than because it is right:\nthe `Could not reach X:` parse is a single-line regex, so a multi-line provider\nerror keeps the whole prefix in the summary.\n\nEmbeddingsSetupModal (17 tests). The custom-endpoint branch vs the API-key\nbranch, and the two disabled predicates on Test and Save — including that Save\nstays enabled with an empty key when the provider already has one stored, and\nthat the custom branch gates Save on the endpoint instead. This also pins a UX\ndefect as current behaviour: for a custom provider the Test button renders\nenabled but its handler no-ops, so it silently does nothing. The test says so\nand points at the fix; whoever fixes it should invert the assertion, not delete\nit.\n\nAgentInsightsPreview (8 tests). The dev-only harness behind\n`#/dev/agent-insights`, unlinked from any nav — which is why nothing notices\nwhen it breaks. It is a `ToolTimelineEntry` fixture consumer, so it breaks when\nthat type changes shape and the next person to touch the type will not open the\npage. `ToolTimelineBlock` and `AgentProcessSourcePanel` are mocked so this\ncovers the harness's own two jobs: the settled-entry derivation (errors stay\nerrors, the live `childIteration` counter is dropped for a final count) and the\npanel open/close wiring.\n\nEvery assertion was verified to fail with the behaviour reverted.\n M3gA-Mind committed 3 months ago
2778189 test(inference): controller-boundary e2e coverage for the eleven local RPCs\n\n`scripts/check-domain-e2e-coverage.mjs` reported inference at 1/11 (9.1%),\nthe worst module in the repo. Five of the ten it named were already driven\nthrough their real handlers in `tests/raw_coverage/` — the gate matches the\nwire-method string literal, and those suites look controllers up by\n`schema.function`, so it could not see them. This adds the coverage that was\ngenuinely missing rather than restating what exists.\n\nTwo things none of the existing suites assert:\n\n1. The registered wire method name. Every suite resolves a controller by\n `schema.function` ("tts"), never by the string the frontend dispatches\n ("openhuman.inference_tts"). A namespace rename would break every JS\n caller and embedder while the whole Rust suite stayed green.\n `local_inference_controllers_pin_their_registered_wire_method_names`\n pins all eleven, and the length assertion fails if a controller is added\n without one.\n\n2. The controller boundary for the five that had none: agent_chat_simple,\n transcribe, transcribe_bytes, tts and download_asset. Params\n deserialization, input trimming and error mapping all live in the handler\n and are unreachable from a direct call to the op.\n\nOffline only: temp workspaces, a temp PATH and a stub piper shell script.\nNothing starts a server or downloads an asset. The download and STT paths are\ndriven to their rejection branches on purpose — the bundled whisper.cpp\nengine was deleted, so transcribe is a hosted proxy call with no local binary\nto stub.\n\nNotable assertions, each verified to fail when the behaviour is reverted:\n- tts passes trimmed text to piper's stdin (read back from the stub)\n- the prompt guard blocks instruction-override prompts on agent_chat_simple\n- download_asset folds " TTS " to the tts capability\n- test_connection refuses file:// and ftp:// before opening a socket\n- the transcribe path reaches the filesystem trimmed (defence in depth: two\n layers trim, so this fails only when both are gone)\n\nThe gate now reports inference 11/11 (100.0%).\n M3gA-Mind committed 3 months ago
24154ae