Commit Graph

31769 Commits

Author SHA1 Message Date
Teknium 0c62b297c6 review-fix(mcp): preserve MCP SDK 2 input schemas in the schema-cache write-through (salvaged from #91451 / #102129)
`_write_schema_cache` in the extracted owner tools/mcp_tool_registration.py
read `t.inputSchema` with a bare camelCase getattr. mcp 2.0 renamed the
model field to `input_schema` and kept `inputSchema` only as a serialization
alias, which pydantic does not apply to attribute access, so on SDK 2.x the
cache persisted `"inputSchema": {}` for every tool and a `lazy: true` server
registered from that cache was advertised to the model with all parameters
stripped. Pre-existing on BASE (tools/mcp_tool.py); fixed with the canonical
`mcp_field(t, "input_schema", "inputSchema")` helper, as both PRs do.

Adds the real-SDK regression test from #102129 (genuine `mcp.types.Tool`
driven through `_register_server_tools` -> cache write ->
`_register_from_cache_sync`), ported to the new module layout and isolated
from the module-global registration state.

Co-authored-by: mzkarami <mehrzad.karami@gmail.com>
Co-authored-by: lijinxiao1982 <120761624+lijinxiao1982@users.noreply.github.com>
2026-09-03 09:32:31 -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 eaf10c7e78 review-fix(packaging): declare every hermes_state_* root module in py-modules
The hermes_state split added 15 root-level sibling modules but
[tool.setuptools] py-modules still listed only the old set, so the built
wheel/sdist (and the uv2nix sealed venv) failed at 'import hermes_state'
with ModuleNotFoundError. hermes_state_holders and hermes_state_registry
were already missing on main (registry is imported by gateway/run.py and
hermes_state.py).

Add an invariant test that parses pyproject and walks every import in the
packaged root modules and packages, requiring any import that resolves to
a root-level *.py to be declared - so the class of bug is caught by CI
rather than by a broken install.
2026-09-03 09:31:01 -07:00
Teknium d3395cf86a review-fix(repo): drop accidentally committed fuzz corpus r318C_fuzz_new.json 2026-09-03 09:26:02 -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 b57f17bd4b fix(late-slices): restore subprocess footgun guards re-collapsed by r3-30/33/34/36 tails; telegram format_message stays self-free (staticmethod via class ref); _captured_exec explicit shell/env kwargs 2026-09-03 05:33:46 -07:00
Teknium 63279301bc fix(reasoning): retry after a mandatory-reasoning 400 resends the user's own effort
The retry must land on the same provider cache key as every prior request
in the session. Discard only the one-shot continuation disable and send
agent.reasoning_config verbatim; a config that is itself a disable is
omitted (that session never sent anything else, so nothing warm is lost).

Live: user effort=high, ephemeral disable → 400 → retry carries
{enabled: true, effort: high}.
2026-09-03 05:20:11 -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 5dcd3b2620 ci: ASYNC220 ignore follows Popen to run_shutdown.py; windows-only tests patch the defining module; whatsapp taskkill kwargs explicit 2026-09-03 05:12:25 -07:00
Teknium d38bb1b3aa Merge simp/r3-33 (late tail) into hermes/simplify-codebase 2026-09-03 05:09:00 -07:00
Teknium 8ae52dd93c Merge simp/r3-30 (late tail) into hermes/simplify-codebase 2026-09-03 05:04:08 -07:00
Teknium 93cf6b3dce Merge simp/r3-37 (late tail) into hermes/simplify-codebase 2026-09-03 04:35:51 -07:00
Teknium e73598a3c3 Merge branch 'simp/r3-36' into hermes/simplify-codebase 2026-09-03 04:34:20 -07:00
Teknium 8c4012fac0 Merge branch 'simp/r3-35' into hermes/simplify-codebase 2026-09-03 04:34:20 -07:00
Teknium e010327ff7 Merge branch 'simp/r3-34' into hermes/simplify-codebase 2026-09-03 04:34:19 -07:00
Teknium 3bff2a581d Merge origin/main (562ee8ab76): fold usage-less empty-response guard, unterminated tool-call strip, skills-first memory guidance into the simplified modules 2026-09-03 04:31:46 -07:00
Teknium 7ac5a9549f Merge branch 'simp/r3-36-X2' into simp/r3-36 2026-09-03 04:22:49 -07:00
Teknium fd1a0594c1 refactor(tui_gateway): X2 wave3 — compute_host guarded frame handlers + session-build split, groups profile/kwargs folds, project_tree placement/auto-bucket compaction, projects row/policy folds, entry+oauth plumbing trims (2653->2437 LOC) 2026-09-03 04:15:06 -07:00
Teknium ffe3f8ad48 refactor(tui_gateway): hosted-room service — keep send() prepare/wakeup explicit 2026-09-03 04:10:17 -07:00
Teknium 562ee8ab76 fix(prompt): agent routes task-learned knowledge (incl. user preferences/corrections) to skills; memory is the every-session exception
The memory guidance led with 'Save proactively' and the memory tool schema
ranked 'user preferences & corrections' as top priority, while the skills
nudge was a conditional 'offer to save'. In practice that asymmetry made
the agent end sessions writing memory entries (fighting a 2,200-char
budget) and skip updating the skill it had just used, even though the
procedure was the reusable artifact. Both surfaces now state the same
rule with skills first: what you learn doing a task, including the user's
preferences and corrections for that kind of work, goes in the task's
skill; memory is only for facts that apply to every session.
2026-09-03 04:02:35 -07:00
Teknium f2e82f6208 refactor(tui_gateway): hosted-room X1 — inline one-site wrappers, drop dead PeerRunsHTTPError attrs, compact lease/cancel plumbing 2026-09-03 03:59:09 -07:00
Teknium 7b72fd1247 fix(agent): stream cut mid tool-call markup no longer persists as assistant prose (#101899)
GLM-style models serialize tool calls as XML in the text channel; when the
stream drops mid-serialization with finish_reason=stop, the orphan
<arg_key>/<arg_value> fragment (or a bare unclosed <tool_call> opener)
matched neither the complete-block stripper nor the partial-stream guard
and was stored and displayed as ordinary assistant content.

strip_think_blocks (storage boundary) and the CLI display copy now strip
an unterminated block-boundary tool-call opener, or any line carrying
stray argument markup, to end of text. The response then reads as empty
and flows through the existing empty-retry path. Complete blocks and
inline prose mentions are unchanged.
2026-09-03 03:42:15 -07:00
Teknium c3e9defd18 fix(agent): trim usage-less empty fix to guard + observability
Drop the loop-side '(empty)' rewrite (the turn-completion explainer already
owns that at delivery, and gateway/desktop match on the sentinel) and the
extra token-count persistence. Keeps: usage-absent empty streaks arm the
deterministic fast-fail after two attempts with no content or reasoning,
and every completed API call logs even when the provider omits usage
(#101898).
2026-09-03 03:41:52 -07:00
fangliquan 3755dca7d6 fix(agent): handle usage-less empty responses 2026-09-03 03:41:52 -07:00
Teknium 89fe549af4 refactor(tui_gateway): hosted-room driver/peer-http/service — fold wrappers, unify bounded-body reads, pack payloads 2026-09-03 03:39: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 7041d8ff9d Merge branch 'simp/r3-36-W1' into simp/r3-36 2026-09-03 03:26:10 -07:00
Teknium 7d48f1c5d2 Merge branch 'simp/r3-36-W4' into simp/r3-36 2026-09-03 03:20:25 -07:00
Teknium f61e0af783 Merge branch 'simp/r3-36-W2' into simp/r3-36 2026-09-03 03:20:24 -07:00
Teknium 58708befdb refactor(tui_gateway): W4 wave2 pass 21 — yolo/fast folds 2026-09-03 03:15:59 -07:00
Teknium f1d6a19873 refactor(tui_gateway): W4 wave2 pass 20 — voice.record + roster row folds 2026-09-03 03:14:09 -07:00
Teknium cf60ebbdfd refactor(tui_gateway): W4 wave2 pass 19 — readiness scope inlined, secret mirroring unified 2026-09-03 03:12:31 -07:00
Teknium c5e7d319b1 refactor(tui_gateway): W4 wave2 pass 18 — config.get profile/project/thinking folds 2026-09-03 03:09:24 -07:00
Teknium 7b52503cc5 refactor(tui_gateway): W4 wave2 pass 17 — ui_meta default-false fold 2026-09-03 03:06:56 -07:00
Teknium 5209d1d487 refactor(tui_gateway): methods_session — steer/redirect factory, one-line docstrings, final compaction (2134 -> 2099 LOC) 2026-09-03 03:06:33 -07:00
Teknium 64fd92723e Merge branch 'simp/r3-36-W5' into simp/r3-36 2026-09-03 03:05:11 -07:00
Teknium cb31284395 refactor(tui_gateway): W4 wave2 pass 16 — profile asset/configure folds, voice tts setter 2026-09-03 03:04:57 -07:00
Teknium bd0689b13e refactor(tui_gateway): W4 wave2 pass 15 — toggle setters table (density/battery/statusbar/mouse) 2026-09-03 03:03:19 -07:00
Teknium c398505e5a refactor(tui_gateway): W4 wave2 pass 14 — busy/approvals into word table 2026-09-03 03:02:44 -07:00
Teknium 9ef0c454a5 refactor(tui_gateway): W2 — _SIMPLE_RPCS table for one-expression handlers, rewind error ladder helper, complete.* walrus guards 2026-09-03 03:01:39 -07:00
Teknium 6e69a036ad refactor(tui_gateway): W4 wave2 pass 13 — word-validated config.set setters table 2026-09-03 03:01:18 -07:00
Teknium b1d541d111 refactor(tui_gateway): methods_session — fold oneshot/handoff/pet/spawn_tree ladders, resume mint prologue (2157 -> 2134 LOC) 2026-09-03 02:59:45 -07:00
Teknium db7b8c7d02 refactor(tui_gateway): W4 wave2 pass 12 — record_repos pairs comprehension, voice.tts/tts_stop folds 2026-09-03 02:57:32 -07:00
Teknium 110292b733 refactor(tui_gateway): W2 — module-handle lazy imports across handlers, goal/loop manager guard, undo notify loop, section banner squeeze 2026-09-03 02:56:05 -07:00
Teknium 6375896d4d refactor(tui_gateway): methods_session — table-drive billing write routes, fold resume/branch/title ladders (2214 -> 2157 LOC) 2026-09-03 02:55:18 -07:00
Teknium f5a3ea3686 refactor(tui_gateway): W4 wave2 pass 11 — profile mcp toggle / preview folds 2026-09-03 02:55:03 -07:00
Teknium f94a5e7358 refactor(tui_gateway): W4 wave2 pass 10 — profile ui_meta fields fold 2026-09-03 02:53:14 -07:00
Teknium 90e008098d refactor(tui_gateway): W4 wave2 pass 9 — _set_model deferred phase extracted 2026-09-03 02:52:21 -07:00