Commit Graph

28271 Commits

Author SHA1 Message Date
Teknium 55248a133f refactor(approval): unify the three human-approval gates behind one engine (_human_decision) + _GateSpec/_Unattended tables 2026-09-02 16:23:33 -07:00
Teknium e118abc61a refactor(update): lift manual-gateway restart, stuck-PID sweep and phase-abort recovery out of _restart_gateway_fleet_after_update (362 -> 154 LOC) 2026-09-02 16:23:31 -07:00
Teknium 2a9c5d8cf5 refactor(doctor_state): unify state.db repair path, memory-provider dispatch table; doctor.py header 2026-09-02 16:23:25 -07:00
Teknium f78d519e5a refactor(auth): collapse duplicate corrupt-store warning, drop dead _SUPPORTED_PREFIXES 2026-09-02 16:23:15 -07:00
Teknium 088eda22ae refactor(mcp): compact mcp_oauth module docstring, helpers and CIMD constants by hand
- config-key reference folded into the module docstring (all WHY kept)
- _park_reserved_socket / _pick_cimd_port / _is_valid_cimd_url / _can_open_browser /
  _resolve_redirect_uri / token_request_user_agent tightened, same results
- _maybe_preregister_client optional keys via dict unpacking
2026-09-02 16:23:14 -07:00
Teknium f28dfda667 refactor(web_server): flatten nested guards in auth middleware + plugin cache; module docstring describes the split 2026-09-02 16:23:06 -07:00
Teknium 55ba3cbd61 refactor(tools_config): extract MCP checklist + enable/disable command into tools_config_mcp; compact checklist/reconfigure helpers 2026-09-02 16:22:15 -07:00
Teknium 2ae3e4d6bd refactor(state): share /proc fd walker, collapse loops in generation/holder probes 2026-09-02 16:22:10 -07:00
Teknium a138533157 refactor(state): fold docstring closers (whitespace only) 2026-09-02 16:21:39 -07:00
Teknium fdaaa87ea4 refactor(browser): move session/daemon command execution to tools/browser_tool_session.py, CDP override + supervisor lifecycle to tools/browser_tool_cdp.py, vision helpers to tools/browser_tool_vision.py 2026-09-02 16:21:07 -07:00
Teknium 0048a5bc80 refactor(mcp): handlers — fold structuredContent cap + stdio-retry error tail into helpers, _pick for attr-picking entry builders 2026-09-02 16:21:00 -07:00
Teknium 975783c31e refactor(models): table-drive opencode api-mode routing; collapse copilot/anthropic catalog helpers 2026-09-02 16:20:36 -07:00
Teknium b422113061 refactor(state): compact long rationale comments (all rules kept) 2026-09-02 16:20:35 -07:00
Teknium b97e5d96db refactor(mcp): compact mcp_oauth SDK loader, callback handler, CIMD eligibility and legacy provider class
- _ensure_sdk_loaded binds SDK classes by name from the two auth modules
- _maybe_use_cimd if-ladder -> one ineligibility predicate (order and
  short-circuit preserved, comments kept)
- SSH hint bodies -> module templates; browser-open notes -> one print
- _get_hermes_oauth_provider_class builds the class via type() (same name,
  qualname, module, bases, _hermes_logger)
2026-09-02 16:20:30 -07:00
Teknium 7b30652d8f refactor(auth): explicit-config check table, _store_section helper, docstring repairs, move orphaned section comments to their modules 2026-09-02 16:20:00 -07:00
Teknium 44e37bc7e3 refactor(gateway/hosted_rooms): table-driven task transitions in hosted_room_driver; fold replica schema init, share leaf helpers (-40% LOC, parity-neutral) 2026-09-02 16:19:39 -07:00
Teknium d482bd534d refactor(hermes_cli/main): split select_provider_and_model + cmd_dashboard into named helpers; drop unused imports 2026-09-02 16:19:17 -07:00
Teknium 8b34d23366 refactor(web_server): move skills-hub action helpers to web_server_profiles; trim fastapi import block to what web_server still uses 2026-09-02 16:19:10 -07:00
Teknium acb12608e4 refactor(state): squeeze blank-line runs between constants (AST-neutral) 2026-09-02 16:19:09 -07:00
Teknium 95804887c1 refactor(doctor): tighten platform + tools checks — shared helpers, backend dispatch table, compact docstrings 2026-09-02 16:19:08 -07:00
Teknium 84d04094e3 refactor(cli): compact seven long narrative comment blocks (WHY kept, prose trimmed) 2026-09-02 16:19:03 -07:00
Teknium bd30c9b6ac refactor(browser): move cloud-provider/backend selection to tools/browser_tool_cloud.py and agent-browser/Chromium discovery+install to tools/browser_tool_install.py 2026-09-02 16:18:57 -07:00
Teknium c3d789893f refactor(computer_use): compact cua_backend docstrings/comments (WHYs preserved) 2026-09-02 16:18:47 -07:00
Teknium 6517b2d1c4 refactor(mcp): rewrap re-export blocks (formatting only) 2026-09-02 16:18:43 -07:00
Teknium 1b3f37b3eb Merge branch 'simp/r2-rooms-w4' into simp/r2-gw-rest-rooms 2026-09-02 16:18:42 -07:00
Teknium 0686f3fdae Merge branch 'simp/r2-rooms-w3' into simp/r2-gw-rest-rooms 2026-09-02 16:18:40 -07:00
Teknium 4d8d479e41 refactor(tools_config): split _get_platform_tools into explicit/composite resolvers; compact header comments 2026-09-02 16:18:39 -07:00
Teknium 3fefdd879b refactor(computer_use): collapse redundant locals and branches in cua_backend_session 2026-09-02 16:18:32 -07:00
Teknium b1d29ecf87 refactor(mcp): unify connect success/failure bookkeeping (3 sites -> 2 helpers) 2026-09-02 16:18:06 -07:00
Teknium a8a7b7b849 refactor(doctor_config): model/provider validation -> helpers; config drift -> ordered step table 2026-09-02 16:18:03 -07:00
Teknium 79aeb22886 refactor(cli): unify duplicated model-switch staging and last-assistant-text blocks
cli_model_switch_mixin: the identical snapshot->stage->agent.switch_model->rollback
block in _apply_model_switch_result and _confirm_and_apply_cli_model_switch (2x47
lines) -> _stage_and_swap_model(result, old_model) -> bool. cli_loops_mixin: the
identical reversed-history assistant-text extraction in the loop-tick and goal
post-turn hooks -> _last_assistant_response_text(). Four _StubCLI test doubles bind
the new helper to the real implementation.
2026-09-02 16:17:31 -07:00
Teknium f4e6ccc5f5 refactor(state): unify db-generation halt guard, hoist _is_no_more_rows, collapse flag inits 2026-09-02 16:17:27 -07:00
Teknium 96280b4cc7 refactor(mcp): split register_mcp_servers/discover_mcp_tools into candidate/lazy/discovery-pass/summary helpers 2026-09-02 16:17:20 -07:00
Teknium 865d77a166 refactor(gateway/status): drop dead is_gateway_running/clear_planned_stop_marker, unify PID-record liveness, marker-write, JSON-parse and stale-lock helpers, table-drive runtime-status field writes 2026-09-02 16:16:59 -07:00
Teknium d2add66648 refactor(computer_use): tool.py — verdict-field table, payload merge, stub/record cleanups 2026-09-02 16:16:54 -07:00
Teknium e94cc545d5 refactor(mcp): unify HTTP/SSE/legacy transport serve+teardown into _serve_transport; split _run_stdio into ledger/preflight helpers 2026-09-02 16:16:45 -07:00
Teknium 18946a781f refactor(state): join short adjacent string literals (AST-neutral) 2026-09-02 16:16:37 -07:00
Teknium 2086987cdc refactor(computer_use): route unknown-outcome results directly through _outcome_unknown 2026-09-02 16:16:30 -07:00
Teknium f9f21dcf25 refactor(web_server): decompose start_server (544 -> 106 LOC) into auth-gate, uvicorn-build, post-start, and runner helpers 2026-09-02 16:15:52 -07:00
Teknium 26129a1fca refactor(state): repair — strategy table + _apply loop, lock/unlink/sidecar/offline-access helpers, _repair_skip, backup split into free-space + publish helpers; dbfile — shared /proc fd scan, quarantine lock unified, compact stats 2026-09-02 16:15:49 -07:00
Teknium d7bdf2788d refactor(gateway/session): split SessionStore into persistence/recovery/lifecycle/transcript mixins by call-graph cohesion; compact wire helpers 2026-09-02 16:15:42 -07:00
Teknium 70282b6baf refactor(browser): lifecycle module imports hermes_constants directly; drop origin imports left unused by the move 2026-09-02 16:15:20 -07:00
Teknium 4cf35a68f2 Merge branch 'simp/r2a-mcp-reg' into simp/r2a-mcp 2026-09-02 16:15:20 -07:00
Teknium b9ec602392 refactor(mcp): update mcp_tool module map for the new siblings 2026-09-02 16:15:11 -07:00
Teknium 40fe17f83b refactor(state): fold adjacent string fragments that fit one line (AST-identical) 2026-09-02 16:14:54 -07:00
Teknium ffed5b1503 refactor(tools_config): split tools_command into flow helpers; drop unused imports 2026-09-02 16:14:49 -07:00
Teknium 369dbe4320 refactor(browser): move session lifecycle cluster (janitor, orphan reaper, teardown, atexit cleanup) to tools/browser_tool_lifecycle.py 2026-09-02 16:14:39 -07:00
Teknium a09512c3ad refactor(mcp): move loop start/stop + reconnect signalling into mcp_tool_loop.py (writes via origin module) 2026-09-02 16:14:37 -07:00
Teknium 9a066f7374 refactor(mcp): split _make_hermes_provider_class into module-level _HermesRuntimeProviderMixin
- 322-LOC factory body -> _HermesRuntimeProviderMixin (largest method now
  async_auth_flow ~70 LOC); returned class keeps name, MRO tail, attributes
- invalid_client token-endpoint match -> _is_invalid_client_at_token_endpoint
- three non-fatal debug logs -> _log_nonfatal (same message shapes)
- handle_401's _do_handle closure -> MCPOAuthManager._recover_401
- HermesProviderMixin imported at module top (leaf module; no cycle);
  tools.mcp_tool.sdk_httpx stays lazy
2026-09-02 16:14:36 -07:00
Teknium 5340109e61 refactor(state): compact verbose docstrings (rules/invariants kept) 2026-09-02 16:14:33 -07:00