7 Commits

Author SHA1 Message Date
Teknium
9a0fa659af refactor(agent/thread_scoped_output,stream_diag,stream_single_writer): shared fence-call helper, compact installs 2026-09-02 19:42:28 -07:00
Teknium
5b540ddbe6 refactor(agent/think_scrubber,thread_scoped_output): single partial-suffix scan, forwarded stream methods 2026-09-02 19:14:36 -07:00
Teknium
6fe8f9e76c refactor(agent/stream_diag,repetition_guard,thread_scoped_output,stream_single_writer): compact loops and docstrings 2026-09-02 18:35:30 -07:00
Teknium
624a752e79 refactor(agent/runtime): deadline/file_safety/estop/lifecycle leaf modules — dedupe result plumbing, drop dead guard code
- deadline: _result()/_abandon() replace 7 BoundedResult constructions and 2
  cancel+callback sites; timers handled as a list; dead raise_if_timed_out removed.
- file_safety: retired classify_cross_profile_target (0 refs; get_cross_profile_warning
  stub kept for external callers), _home_and_resolved/_mirror_warning shared by
  the sandbox/container mirror guards; _find_sandbox_mirror_segments inlined.
- estop: _hermes_home/_canonical_root now the file_safety helpers;
  _reset_log_state_for_tests inlined into its only test.
- subagent_lifecycle: _validate_request driven by _UNSUPPORTED_REQUEST_FIELDS table.
- turn_liveness: dead start()/_abort_message removed, _emit_warning shared.
- process_bootstrap: _enable_happy_eyeballs reused by the client variant.
- Comment/docstring compaction across the remaining leaf modules.
2026-09-02 13:29:48 -07:00
Reksely
3d73821e9d fix(agent): stop thread output descriptor leaks 2026-08-15 00:33:01 -07:00
Brooklyn Nicholson
fc05247be8 fix: preserve session history when a turn crashes 2026-08-06 23:08:23 -05:00
Teknium
b5267671f2 fix(bg-review): scope stdout/stderr silencing to the worker thread (#55966)
The background memory/skill review thread wrapped its whole body in
process-global contextlib.redirect_stdout/stderr(devnull). Those rebind
sys.stdout/sys.stderr for the ENTIRE process, so for the full duration of
the review (tens of seconds) every other thread — including a gateway
event-loop thread driving a Telegram long-poll — also wrote to devnull.
Any bare print/sys.stderr.write from those threads during the window was
silently lost (#55769 / #55925).

Replace the global redirect with thread_scoped_silence(): a per-thread
routing proxy installed once as sys.stdout/sys.stderr that sends only the
registered (bg-review) thread's writes to devnull and passes every other
thread through to the real stream. Depth-counted so nested use composes.

Verified: a concurrent thread writing while the bg-review thread is inside
the silence window keeps its output on the real stream.
2026-06-30 17:28:33 -07:00