Commit Graph

6933 Commits

Author SHA1 Message Date
Teknium eeb7671e69 simplify(compat): hermes_cli small facades — drop 7 re-exports/aliases (+relay_runtime alias module), repoint 12 callers/tests 2026-09-03 13:05:57 -07:00
Teknium ecf760db96 simplify(compat): plugins/memory — drop 15 re-exports + 1 alias, repoint 13 test callers
hindsight: drop _PORT_HEALTH_GRACE_ENV/_sanitize_bank_segment facade re-exports (tests -> .embedded/.settings).
honcho: drop 5 tool-schema re-exports, _credential_fingerprint (-> client_cache), _is_auth_error (-> session_auth),
and the _redact_tokens alias (callers renamed to redact_tokens).
openviking: drop 5 _setup re-exports; tests call openviking_module._setup.* directly.
2026-09-03 13:04:16 -07:00
ethernet 283c4f058c fix(packaging): derive root py-modules from the tree in setup.py
The static py-modules list in pyproject.toml drifted from the source
tree each time the root layout changed. An installed wheel then
raised ModuleNotFoundError on import: hermes_state_common, and every
gateway or CLI start failed. The list missed hermes_state_holders,
mini_swe_runner, and the 15 new hermes_state_* modules from this
branch.

setup.py now derives py_modules from the source tree at build time.
setuptools package discovery sees only directories with an
__init__.py, so root single-file modules need py_modules in every
wheel build. setup() kwargs merge with pyproject.toml, and setup.py
is the only legitimate wheel or sdist builder, so the derived list is
the single source of truth.

The nix build is the only wheel consumer. Its source filter keeps
every root .py file, so the build sandbox derives the same set as the
checkout. Editable installs do not read py_modules: build_editable
never runs bdist_wheel.

Verified: wheel and sdist built with HERMES_NIX_BUILD=1 carry all 38
root modules. The guard still blocks builds without the nix env var.
The sealed uv2nix venv from nix build .#default imports
hermes_state_holders, hermes_state_sessions, mini_swe_runner, and
hermes_startup_watchdog.

(cherry picked from commit e23d467b523d50ad088b89b578017996709589cf)

Invariant test updated to pin the derived list (no static py-modules; every root module packaged code imports ships).
2026-09-03 12:22:50 -07:00
Teknium 474eed838e review-fix(suppress-audit): patch_parser/skills_sync/update_cmd_fleet/api_server — restore BASE exception semantics 2026-09-03 09:56:39 -07:00
Teknium 2dbfd3b4aa review-fix(suppress-audit): backup/mcp_oauth/wake_word/run_notifications — restore BASE exception semantics 2026-09-03 09:50:40 -07:00
Teknium 3b963ce253 review-fix(suppress-audit): dashboard_procs ancestor walk — restore BASE per-ancestor exception semantics 2026-09-03 09:45:06 -07:00
Teknium e83816a4d1 review-fix(comments): restore lost #NNNN rationale comments across non-test source (mechanical sweep, condensed, code unchanged)
For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.
2026-09-03 09:44:26 -07:00
Teknium b8f99bfc43 review-fix(seams): late-bind facade-patched names in models_pricing, hermes_state_repair, approval_detection
Reviewer P2 (kshitijk4poor): tests patch hermes_cli.models.get_cached_nous_inference_base_url
but models_pricing.pricing_cache_scope read its own module global, so the patch never reached
the call and the test passed on the default-endpoint fallback. Same seam-erosion class audited
across /tmp/rf/patch_traps.json (777 candidates) with an AST reachability check + a per-test
call-count probe (facade vs defining module) against BASE 63279301bcb; three seams actually
bypassed their patch on HEAD but not on BASE:

- hermes_cli.models.get_cached_nous_inference_base_url  <- models_pricing.pricing_cache_scope
- hermes_state._connect_repair_durable                  <- hermes_state_repair._open_exclusive/_repair_conn/_db_opens_cleanly
- tools.approval._command_detection_variants            <- approval_detection.detect_{dangerous,hardline}_command

Each now looks the name up through its facade at call time (the pattern hermes_state_repair
already used in live_writer_holds_db), restoring BASE's patchability.
2026-09-03 09:43:13 -07:00
Teknium 34abf954bd review-fix(public-api): restore get_session_activity, latest_user_message_row_id, resolve_multiple_toolsets, has_provider, nous_token_has_billing_scope, curated_models_for_provider, clear_edit_approval_requester + tests
All public on BASE 63279301bc, dropped by the simplify refactor (their tests were deleted or
rewritten to the replacement API). Restore each with BASE signature/body as a thin wrapper over the
surviving implementation, and restore the tests at the original call sites: test_message_reactions
again asserts the role=user contract (a newer assistant message is never the default target);
test_hermes_state / test_watchdog_review_76354 go back to get_session_activity(); toolsets, acp auth,
edit_approval, billing-scope and curated-models tests restored/extended.
2026-09-03 09:40:49 -07:00
Teknium 5a0efda992 review-fix(comments): restore reviewer-named rationale blocks (#4926, #81335, #54220/#56747, #100436, #5057/#6252/#10370/#4665) 2026-09-03 09:32:25 -07:00
Teknium fb14bc4e11 review-fix(whitespace): strip trailing whitespace and EOF blank lines introduced by this PR
Trailing-whitespace-only edits so 'git diff --check BASE HEAD' is clean
(16 diagnostics across 11 files). No code changes.
2026-09-03 09:31:54 -07:00
Teknium aec50eb597 fix(live-qa): nous_subscription managed table indexes only selectable features (KeyError 'modal' crashed status/tools/dashboard toolsets); restore PluginManager public API (has_portable_mcp_servers, get_telegram_handler_factories, register_approval_transport), extract_json_candidate public name, canonical_whatsapp_identifier main semantics 2026-09-03 08:16:44 -07:00
Teknium 022785a541 Merge origin/main (63279301bc): reasoning-mandatory 400 recovery folded into turn_recovery/error_classifier/models_reasoning_caps 2026-09-03 05:36:21 -07:00
Teknium f6bd1633f7 fix(reasoning): GLM-5.3 on Nous/OpenRouter no longer 400s when thinking is disabled
Reasoning-mandatory routes answer reasoning: {enabled: false} with HTTP 400
"Reasoning is mandatory for this endpoint and cannot be disabled". Hermes
sends that disable for /reasoning none, agent.reasoning_effort: none, and the
one-shot thinking-exhaustion continuation override (which GLM-5.3-flash
triggers on its own). The Nous profile's catalog guard swallows the disable
only when its per-process capability cache already says mandatory; a gateway
that warmed the cache before the route flipped kept sending it, and the 400
was classified as a non-retryable format_error that aborted the turn.

- error_classifier: new reasoning_mandatory reason (retryable, no fallback,
  no compression), matched before the request-validation branch.
- conversation_loop: one-shot recovery — set agent._reasoning_disable_rejected,
  queue a catalog refresh for the provider, retry.
- chat_completion_helpers: _reasoning_config_for_wire drops every disable
  (configured or ephemeral) once the route has rejected one.
- hermes_cli/models: refresh_reasoning_caps_async(provider) forces a
  background re-fetch of the Nous/OpenRouter catalog.
- openrouter profile: omit a disable when the catalog marks the route
  mandatory (parity with the Nous profile).

Live: z-ai/glm-5.3-flash on the Portal with a poisoned mandatory:false cache.
Before: turn aborted with the 400. After: one retry, thinking stays on, turn
completes.
2026-09-03 05:20:11 -07:00
Teknium 0071ba9965 Merge origin/main (561b053f79) into simp/forwardport: forward-port 220 main commits into the simplified tree 2026-09-03 03:31:03 -07:00
Teknium 23b9ffc4fa fix(integration): restore subprocess stdin=DEVNULL / utf-8 encoding guards and windows-footgun gates dropped by round-3 compaction
Repo scanners (check_subprocess_stdin, check-windows-footguns --all) flagged 21 sites where
the r3 single-line collapses lost stdin=DEVNULL, encoding='utf-8'/errors='replace', the
'# windows-footgun: ok' same-line marker, or the getattr(os, 'geteuid') gate. Each guard is
restored at the call site (real portability/hang fixes, not suppressions).
2026-09-03 02:46:19 -07:00
Teknium 5540860ca6 fix(integration): bang_shell builds its env via build_subprocess_env()
Compaction moved run_bang_command's Popen within the env-guard scanner's
proximity window of _bang_env's os.environ.copy(). Route through the single
factory (build_subprocess_env() == _sanitize_subprocess_env(os.environ.copy()))
and allowlist the file for the import-failure fallback copy with justification.
2026-09-03 02:07:33 -07:00
Teknium 0fc204042d fix(integration): sessions CLI — close db via try/finally, complete test doubles
cmd_sessions used 'with db:' which breaks test doubles lacking the context
manager protocol (13 reds in test_sessions_pin/delete/export). Restore the
explicit try/finally db.close() (same semantics for real SessionDB). Add
get_session/count_prune_matches to the FakeDB doubles in test_sessions_delete
instead of re-adding getattr guards to production code.
2026-09-03 02:06:29 -07:00
mr-r0b0t 7e60d0c042 feat(models): add Meta Muse Spark 1.3 family to picker
Add meta/muse-spark-1.3 and meta/muse-spark-1.3-contributor to the
OpenRouter curated list, the meta-ai provider fallback, the
opencode-zen / opencode-free / opencode-go floors, the setup-wizard
shortlist, and regenerate the hosted model catalog.
2026-09-03 00:57:55 -07:00
Christian Reyes 7f2aa70add feat(models): add Muse Spark contributor to OpenRouter 2026-09-03 00:57:55 -07:00
kshitijk4poor b9dc790332 fix(inventory): reword pending-entitlement warning to avoid Windows footgun false positive
The naive line scanner's open() regex matched the human-readable phrase
"next picker open (or refresh)." inside the warning string, tripping the
Windows footgun gate. Reword to "next picker open or refresh."
2026-09-03 13:08:31 +05:30
kshitijk4poor fb723084be fix(inventory): explain the locked Nous list while entitlement is pending
With the picker served from resident caches only, a cold Nous row renders
every model locked (free_tier_pending) until the background prewarm lands.
Surface why on the row's existing warning slot so the user isn't left with
an unexplained greyed-out list; never override an auth warning.
2026-09-03 13:08:31 +05:30
fangliquanflq 401ac7e1f8 fix(gateway): keep first model picker open responsive on cold pricing cache
Picker opens use only process-resident pricing (cached_only) and start a
single-flight daemon prewarm keyed by (profile, endpoint scope); explicit
refresh stays synchronous. Nous fails closed (free_tier_pending) until the
entitlement is known so a free account cannot briefly select paid models.
Free-tier cache becomes per-profile.

Squash of the 5-commit PR #92253 branch (d5b2070ef8..28313ff963), applied
via diff on current main; two adjacent-insertion conflicts resolved by
keeping both sides.
2026-09-03 13:08:31 +05:30
Teknium 011bbf0cd6 Merge branch 'simp/r3-22-B2-small' into simp/integration3 2026-09-03 00:12:19 -07:00
Teknium 063ca416b3 Merge branch 'simp/r3-00-mix2' into simp/integration3 2026-09-03 00:12:00 -07:00
Teknium 894352b96f Merge branch 'simp/r3-24-X2' into simp/integration3 2026-09-03 00:11:40 -07:00
Teknium e6c2f81c51 Merge branch 'simp/r3-24-X1' into simp/integration3 2026-09-03 00:11:38 -07:00
Teknium 9bb09ec596 Merge branch 'simp/r3-23-h3' into simp/integration3 2026-09-03 00:11:35 -07:00
Teknium e7be554f65 Merge branch 'simp/r3-23-h2' into simp/integration3 2026-09-03 00:11:33 -07:00
Teknium 725ec21b28 Merge branch 'simp/r3-23-g2' into simp/integration3 2026-09-03 00:11:29 -07:00
Teknium 06c8ececb7 Merge branch 'simp/r3-22-F2' into simp/integration3 2026-09-03 00:11:27 -07:00
Teknium 8b21165e8e Merge branch 'simp/r3-22-B2' into simp/integration3 2026-09-03 00:11:25 -07:00
Teknium 0e8aca67ac Merge branch 'simp/r3-22-A2' into simp/integration3 2026-09-03 00:11:23 -07:00
Teknium 4fb89ca026 Merge branch 'simp/r3-19-W4' into simp/integration3 2026-09-03 00:11:19 -07:00
Teknium dba0e05db7 Merge branch 'simp/r3-19-W3' into simp/integration3 2026-09-03 00:11:17 -07:00
Teknium 0c26446e15 refactor(hermes_cli): inline _try_poll, hoist datetime import, share _kv/_detail and _header/_lines 2026-09-03 00:11:01 -07:00
Teknium d4904b8327 refactor(hermes_cli): foreign_sessions _block_text/_message_turn fold, heartbeat/dingtalk/gitlock/install_identity compaction 2026-09-03 00:10:28 -07:00
Brooklyn Nicholson 3373e97693 [verified] fix(cron): preserve active runs across gateway restart 2026-09-03 12:40:26 +05:30
Teknium 9e7b941940 refactor(hermes_cli): plugins_cmd — partial-based enabled/disabled accessors, shared _table builder, compact composite UI (nav table + color-pair loop), fold small helpers 2026-09-03 00:10:13 -07:00
Teknium fe79f06ce0 refactor(hermes_cli): doctor_state — memories/ on ensure_dir, warn_on_error sweep, profile parts comprehension 2026-09-03 00:09:59 -07:00
Teknium 2651e735d0 refactor(hermes_cli): compact plugin manifest/loader/discovery/ledger/state helpers (-100 LOC) 2026-09-03 00:09:39 -07:00
Teknium fc5e5a1491 Merge branch 'simp/r3-25-L' into simp/integration3 2026-09-03 00:09:19 -07:00
Teknium ecc23d5c32 Merge branch 'simp/r3-25-K' into simp/integration3 2026-09-03 00:09:17 -07:00
Teknium eeaf3e9a11 Merge branch 'simp/r3-25-J' into simp/integration3 2026-09-03 00:09:15 -07:00
Teknium 439ceb51ed refactor(hermes_cli): drop dead generate_bot_username/slug + DEFAULT_MANAGER_BOT (tests only) 2026-09-03 00:09:14 -07:00
Teknium 58b4cefa3d Merge branch 'simp/r3-25-I' into simp/integration3 2026-09-03 00:09:13 -07:00
Teknium c3cdb4d8bf Merge branch 'simp/r3-25-G' into simp/integration3 2026-09-03 00:09:10 -07:00
Teknium 635aaed141 Merge branch 'simp/r3-22-C' into simp/integration3 2026-09-03 00:09:01 -07:00
Teknium 0034093df3 refactor(hermes_cli): compact nous_subscription probes, unify Y/n prompt, flatten signatures 2026-09-03 00:08:57 -07:00
Teknium cebbc9ef97 Merge branch 'simp/r3-18-E' into simp/integration3 2026-09-03 00:08:51 -07:00