Commit Graph

6929 Commits

Author SHA1 Message Date
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
Teknium 8d4a925c98 Merge branch 'simp/r3-18-D' into simp/integration3 2026-09-03 00:08:48 -07:00
kshitijk4poor 68cbe484a4 refactor(config): close empty-list root gap in strict check; assert tolerant returns
Review follow-ups on the final salvage stack:
- `fast_safe_load(f) or {}` collapsed a falsy non-mapping root (`[]`) to `{}`
  before the strict isinstance check, so an empty-list config evaded the
  raise the previous commit added. Only map a None document (empty file) to
  `{}`; every other non-mapping root now hits the strict branch.
- Docstring: the strict flag covers non-mapping roots too, not just parse
  failures.
- Tests: assert the tolerant call's return per shape instead of merely
  calling it; add the empty-list-root case.
2026-09-03 12:38:46 +05:30
kshitijk4poor 4d24f357a0 fix(config): strict version check also refuses non-mapping config roots
A config.yaml whose top-level value is a list or scalar parses fine, so the
strict check_config_version(raise_on_parse_error=True) from #101778 still
returned (0, latest) and migrate_config() proceeded: sanitize_env_file()
rewrote .env, then save_config()'s fail-closed guard raised RuntimeError.
Raise InvalidUserConfigError up front for that shape too, so the
"no side effect before the invalid config is surfaced" guarantee holds
for both invalid-config shapes. Tolerant callers are unchanged.

Tests: parametrize the two #101778 regression tests over malformed-yaml
and list-root; assert the tolerant call still does not raise. Also make
the test_update_autostash check_config_version mock kwarg-tolerant,
matching the author's fix in test_config.py.
2026-09-03 12:38:46 +05:30
EmanueleCornaggia a3ceee4333 fix(config): refuse migration on malformed YAML
Make validation and migration paths distinguish parse failures from current configs so invalid YAML cannot trigger .env or config-side effects.
2026-09-03 12:38:46 +05:30