Commit Graph

4175 Commits

Author SHA1 Message Date
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
Teknium 9e3df66e95 review-fix(locks): keep the lock-free cache read only for manual codex /compress (BASE exception)
BASE's _compress_codex_app_server_session was the single cache-peek site that read
_agent_cache without a lock when _agent_cache_lock was None (tests/gateway/
test_codex_hygiene_compaction.py::_slash_host relies on it). Every other BASE caller returned
None without a lock. Model that as an explicit lockless_fallback=True at that one call site.
2026-09-03 12:42:38 -07:00
Teknium 6e2796b82d review-fix(locks): restore BASE fail-loud lock-slot reads and _is_openai_client_closed truth table
Adolanium review §3 (Medium/Low). BASE shape at every steer/redirect/persist/agent-cache
lock site was: lock = getattr(obj, "_x_lock", None); if lock is not None: with lock: <direct
attribute read>; else: <getattr fallback for object.__new__ test stubs>. The refactor rewrote
several of these as 'with getattr(...) or nullcontext(): getattr(slot, None)', which (a) turned a
missing slot under the lock from a loud AttributeError into silent None and (b) in the gateway
peek helper read the cache without any lock when the lock attribute was absent.

Restored BASE semantics at:
- agent/agent_runtime_helpers.py::_requeue_pending_steer
- agent/interrupt_control.py: steer, redirect, clear_interrupt, _has_pending_redirect,
  _drain_pending_redirect, _drain_pending_steer (new _ic_slot helper: direct read under lock)
- agent/session_persistence.py::_persist_lock (explicit None check + BASE rationale)
- gateway/slash_commands.py::_cached_agent_for (BASE callers read ONLY under the lock; no lock -> None)
- gateway/run_agent_cache.py::_evict_cached_agent (BASE: self._agent_cache direct under lock)
- agent/client_lifecycle.py::_is_openai_client_closed: BASE body + docstring verbatim (outer
  is_closed first; inner _client.is_closed only when _client exists; else False)
- agent/stream_delivery.py::_ensure_stream_writer_state: restore BASE rationale that the lock is
  created unconditionally in agent_init (_STREAM_STATE) and the lazy path is stub-only

A/B (/tmp/rf/rev/ab_lock_fallbacks.py, ab_client_closed.py) is byte-identical BASE vs HEAD on
the reviewer's inputs + edge cases. tests/agent/test_lock_fallback_base_semantics.py pins it
(7 of 25 cases fail on the pre-fix tree).
2026-09-03 12:29:52 -07:00
Teknium fd333a67cd review-fix(suppress-audit): langfuse/run_agent_cache/openviking — restore BASE exception semantics 2026-09-03 10:03:17 -07:00
Teknium 4749300508 review-fix(suppress-audit): run_turn_runner/browser_control_artifacts — restore BASE exception semantics 2026-09-03 10:01:40 -07:00
Teknium e7a0f4695b review-fix(suppress-audit): skill_usage hub-lock walk, watchdog tick finally, session.create cwd — restore BASE exception semantics 2026-09-03 10:00:07 -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 e1d4211e90 review-fix(suppress-audit): gateway/run_turn.py — restore BASE exception semantics (proxy key UnscopedSecretError-only fallback) 2026-09-03 09:52:47 -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 81984a7ebd review-fix(suppress-audit): bedrock_adapter/run_turn_runner/self_repo_guard — restore BASE exception semantics 2026-09-03 09:48:45 -07:00
Teknium d9141c425f review-fix(suppress-audit): run_shutdown/browser_tool_cdp/tui server — restore BASE exception semantics 2026-09-03 09:48:37 -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 fe03731efd review-fix(suppress-audit): codex_runtime/relay_runtime/shutdown_watchdog — restore BASE exception semantics 2026-09-03 09:41:59 -07:00
Teknium 96c104c903 review-fix(public-api): restore from_platform_entry, SessionManager.remove_session/cleanup, is_relay_media_url, SessionTurnLeaseRegistry.__len__ + tests
BASE exposed these public names; the simplify refactor dropped them (and deleted/removed their
tests) although plugins/connectors import them. Restore each with BASE's signature and body
(download() again routes its auth decision through is_relay_media_url), and restore the covering
tests ported to the new layout, plus DB-only/task-cwd coverage for remove_session/cleanup, the
zero->4096 chunking normalization for from_platform_entry, and len() on empty/populated registries.
A/B vs 63279301bc: /tmp/rf/rev/ab_publicapi.py identical output on both trees.
2026-09-03 09:32:40 -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 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 6a1d96c346 Merge branch 'simp/r3-12-w2b' into simp/integration3 2026-09-03 00:11:57 -07:00
Teknium ea6083dbfc Merge branch 'simp/r3-12-w2a' into simp/integration3 2026-09-03 00:11:56 -07:00
Teknium 4ad49247e1 Merge branch 'simp/r3-11-2d' into simp/integration3 2026-09-03 00:11:10 -07:00
Teknium e88ebcb0c7 Merge branch 'simp/r3-11-2c' into simp/integration3 2026-09-03 00:11:08 -07:00
Teknium 3bda2a263d Merge branch 'simp/r3-10-b2' into simp/integration3 2026-09-03 00:11:01 -07:00
Teknium 413a6af629 refactor(gateway): run_turn — _hmwa_prepare_turn owns session open + env setup, tuple outcome replaces nested carrier, hugged docstring closers 2026-09-03 00:10:30 -07:00
Brooklyn Nicholson 83efdf5e5e [verified] fix(cron): close restart handoff races 2026-09-03 12:40:26 +05:30
Brooklyn Nicholson 29e5172487 [verified] fix(cron): harden gateway restart handoff 2026-09-03 12:40:26 +05:30
Brooklyn Nicholson 3373e97693 [verified] fix(cron): preserve active runs across gateway restart 2026-09-03 12:40:26 +05:30
Teknium 792960cba1 refactor(gateway): compact run_* inline comments by hand (keep every WHY/invariant) 2026-09-03 00:09:38 -07:00
Teknium f9fcceb574 refactor(gateway): reflow hosted-room module/function docstrings to <=120 cols (every sentence kept) 2026-09-03 00:09:14 -07:00
Teknium 579b1ded22 Merge branch 'simp/r3-13' into simp/integration3 2026-09-03 00:07:38 -07:00
Teknium 4987f27fde refactor(gateway): slash_commands_session — inline single-use lifecycle-hook helper, compact docstrings, fold calls 2026-09-03 00:07:29 -07:00
Teknium bb9c83f47e refactor(gateway): run_turn — fold fence-cancel poll and status metadata into their single callers, unify streamed-message edit, MCP change table, misc collapses 2026-09-03 00:04:44 -07:00
Teknium 3a2dabd734 refactor(gateway): status.py — fold start-time guards, reuse _pid_from_record/parse_active_agents, pack record literals 2026-09-03 00:04:21 -07:00
Teknium df75ccc47a Merge branch 'simp/r3-13-E' into simp/r3-13 2026-09-03 00:04:04 -07:00
Teknium b3ba9d6285 refactor(gateway): shared logged-send helper for shutdown and cron-interrupt notices 2026-09-03 00:03:17 -07:00
Teknium 4c7847d59b refactor(gateway): drop blank after dataclass docstrings and section headers in hosted-room modules (AST-neutral) 2026-09-03 00:01:28 -07:00
Teknium e0a146c6b0 refactor(gateway): session_transcript — reuse _spool_dropped, assistant-only key table, suppress-based tip lookup 2026-09-02 23:59:14 -07:00
Teknium fcb0ff29d6 refactor(gateway): AST-neutral string-fragment rewrap to 110 cols 2026-09-02 23:58:47 -07:00
Teknium 9eb77d3542 refactor(gateway): fenced_update in hosted_rooms_common shared by rooms/driver/checkpoint CAS sites; trim section-header blank runs 2026-09-02 23:57:39 -07:00
Teknium c0217c0792 refactor(gateway): slash_commands — inline restart dedup payload builder, pack arg tables, compact docstrings, fold calls 2026-09-02 23:57:12 -07:00
Teknium 506796fc81 refactor(gateway): fold secondary-reconnect release branches; drop redundant fast path in startup-reconnect handoff 2026-09-02 23:57:09 -07:00
Teknium 308ae97d50 refactor(gateway): _multiplex_on predicate, inline single-use locals in adapter/notification/shutdown seams 2026-09-02 23:54:36 -07:00
Teknium baa22741fc refactor(gateway/platforms): base.py — wrap remaining >100-col lines 2026-09-02 23:54:28 -07:00
Teknium 8ac06a3fd9 refactor(gateway): session_persistence — nullcontext lock guard in _save_entry, fold trivial ternaries 2026-09-02 23:53:43 -07:00
Teknium 551733d28d Merge branch 'simp/r3-10-b2-w2' into simp/r3-10-b2 2026-09-02 23:52:16 -07:00
Teknium e7e4aa2eed refactor(gateway/platforms): base.py — final rewrap of remaining multi-line statements 2026-09-02 23:50:40 -07:00
Teknium 158fcfe13a refactor(gateway): route quiet runtime-status writes through gateway.run._write_runtime_status_quiet 2026-09-02 23:50:14 -07:00
Teknium 159562aa02 refactor(gateway): run_turn — compact restating comments/docstrings (docstring-stripped AST identical) 2026-09-02 23:49:47 -07:00
Teknium 16b588dd8a Merge branch 'simp/r3-10-b2-w3' into simp/r3-10-b2 2026-09-02 23:49:19 -07:00
Teknium b1287d9b49 refactor(gateway/hosted_room_*): _lease_window folds ttl/clock/expiry, _run_fence tuple (5 sites), _load_task(required=) reused by admit_task, closing() replica init, dict-comprehension backfill 2026-09-02 23:49:19 -07:00