Commit graph

7647 commits

Author SHA1 Message Date
Rod Boev
4a7b851c8c fix(#6481): materialize pending turns without borrowed display indexes 2026-07-29 18:36:24 +00:00
Rod Boev
9b0506d31d fix(#6481): keep display ownership out of context indexes 2026-07-29 18:36:24 +00:00
Rod Boev
525edef5f7 Fix silent-result ownership for repeated prompts 2026-07-29 18:36:24 +00:00
Rod Boev
66438f07bc Settle verification turns from exact turn ownership 2026-07-29 18:36:24 +00:00
Rod Boev
920b48d709 fix(#6481): preserve repeated pending turns through verification cleanup 2026-07-29 18:36:24 +00:00
Rod Boev
5e447683f8 fix(#6481): keep verification cleanup from duplicating the current turn 2026-07-29 18:36:24 +00:00
Rod Boev
ad3770fd6e fix(#6481): restore marker-only verification cleanup 2026-07-29 18:36:24 +00:00
Rod Boev
663aec682e fix(#6481): prevent verification follow-up context contamination 2026-07-29 18:36:24 +00:00
nesquena-hermes
41321f6f70
Merge pull request #6307 from pxxD1998/fix/recover-stale-file-workspaces
fix: recover deleted session workspaces
2026-07-29 11:34:12 -07:00
pxxD1998
cc6c87903a fix(session): bound delete lock wait 2026-07-29 18:22:22 +00:00
pxxD1998
e2b052a637 fix(workspace): persist recovered session bindings 2026-07-29 18:22:22 +00:00
nesquena-hermes
7e091e09dd
Merge pull request #6488 from happy5318/fix/qwen-prefixed-reasoning-heuristic
fix: Qwen reasoning heuristic fails for prefixed model IDs
2026-07-29 11:12:13 -07:00
happy5318
a57d576805 fix: make prefixed Qwen detection positive-only to avoid shadowing hybrid IDs
Gate review found that the broadened token-prefix check caused
deepseek-r1-distill-qwen2.5-bakeneko-32b to enter the Qwen branch
(qwen2 token), return False, and prevent the DeepSeek detector from
running — a silent regression.

Fix: split into two phases:
1. Positive-only scan: any token matching qwen(\d+) with major >= 3
   immediately returns True. No False path — Qwen 2.x in hybrid IDs
   falls through to subsequent detectors.
2. Terminal guard (original behavior): standalone "qwen" token or
   normalized.startswith("qwen") still applies the 3+ gate with
   return False for 2.x, since those ARE pure Qwen models.

Add regression test for deepseek-r1-distill-qwen2.5-bakeneko-32b.
2026-07-29 18:07:55 +00:00
happy5318
90250adfb7 fix: address review — remove redundant guard, add regression tests
- Drop the now-subsumed `normalized.startswith("qwen")` guard
  (token-prefix matching already covers the bare case)
- Add test_qwen_prefixed_alias_reasoning_detection covering:
  prefixed Qwen 3+ (al-/sn-), bare Qwen 3+, and Qwen 2.x exclusion
2026-07-29 18:07:55 +00:00
happy5318
041e311f1e fix: Qwen reasoning heuristic fails for prefixed model IDs
The Qwen branch in _candidate_supports_reasoning() checks
"qwen" in token_set, but model IDs like "al-qwen3.8-max-preview"
(New-API alias prefixes) normalize to tokens ["al", "qwen3", "8", ...]
where "qwen" is not a standalone token. This causes the reasoning
effort toggle to disappear for any prefixed Qwen model.

Switch to token-prefix matching (token.startswith("qwen")), consistent
with the position-independent approach already used for DeepSeek
(tokens.index). This handles arbitrary vendor/alias prefixes while
still correctly excluding Qwen 2.x via the existing version gate.
2026-07-29 18:07:55 +00:00
nesquena-hermes
4b3fdde31b
Merge pull request #6567 from stefanpieter/fix/sigusr1-stack-dump-no-restart
fix: keep SIGUSR1 stack dumps non-terminating
2026-07-29 10:53:29 -07:00
StefanPieter
8db75f8b78 fix: keep SIGUSR1 stack dumps non-terminating 2026-07-29 17:41:46 +00:00
starship-s
d00c3332e4
ci: constrain MCP SDK to compatible 1.x releases (#6564)
Assisted-by: Hermes Agent:gpt-5.6-sol
2026-07-29 10:35:23 -07:00
nesquena-hermes
21bdd7c1f1
Merge pull request #6538 from nesquena/gate-6529-title-echo
Release exp-v0.52.153: reject trivial-echo session titles (#6529)
2026-07-26 13:27:24 -07:00
nesquena-hermes
4e1a217670 changelog: reject trivial-echo session titles (#6529) 2026-07-26 20:23:01 +00:00
nesquena-hermes
b145f59312 fix(titles): reject trivial-echo new session titles (gate-rebase of #6529)
Co-authored-by: Hermes Agent <hermes@nousresearch.com>
2026-07-26 20:22:25 +00:00
nesquena-hermes
8e3bb02e0e
Merge pull request #6537 from nesquena/gate-6527-sse-relay-close
Release exp-v0.52.152: SSE relay apperror-hang fix (#6527)
2026-07-26 13:20:11 -07:00
nesquena-hermes
10223e3145 changelog: SSE apperror relay-close fix (#6527) 2026-07-26 20:15:14 +00:00
nesquena-hermes
c6e9ad79d2 test: update legacy SSE-break regression test for SSE_RELAY_CLOSE_EVENTS (#6527 maintainer fold-in)
The R5b static-pattern test pinned the old inline ('stream_end','error','cancel')
tuple; #6527 replaced it with the named SSE_RELAY_CLOSE_EVENTS frozenset. Accept
either shape and assert behavior (cancel+apperror in the resolved close set)
rather than source syntax. Intent-preserving; non-vacuous (fails on master:
SSE_RELAY_CLOSE_EVENTS absent + apperror not in old tuple).
2026-07-26 19:58:43 +00:00
nesquena-hermes
c49568101c fix(sse): close relays on apperror terminal events (gate-rebase of #6527)
Co-authored-by: Hermes Agent <hermes@nousresearch.com>
2026-07-26 19:45:38 +00:00
Frank Song
c8d9faea29 Merge remote-tracking branch 'origin/master' into franksong2702/live-worklog-settle-no-blank 2026-07-26 11:03:04 +08:00
nesquena-hermes
a7180a8108
Merge pull request #6523 from nesquena/release/stage-6477
Release exp-v0.52.151: repair admin model reload rebinding (#6477, @mspgle-dotcom)
2026-07-25 19:13:28 -07:00
nesquena-hermes
20972409e3 docs(changelog): repair admin model reload rebinding (#6477, @mspgle-dotcom) 2026-07-26 02:08:45 +00:00
nesquena-hermes
44877274da Release exp-v0.52.151: repair admin model reload rebinding (#6477, @mspgle-dotcom) 2026-07-26 02:08:30 +00:00
Frank Song
95aa8ece36 Merge remote-tracking branch 'origin/master' into franksong2702/live-worklog-settle-no-blank 2026-07-26 09:22:09 +08:00
nesquena-hermes
dd155912a7
Merge pull request #6520 from nesquena/release/stage-5844
Release exp-v0.52.150: reap idle abandoned terminals (#5844, @ai-ag2026)
2026-07-25 18:03:47 -07:00
nesquena-hermes
f8401f3be3 docs(changelog): reap idle abandoned terminals (#5844, @ai-ag2026) 2026-07-26 00:56:42 +00:00
nesquena-hermes
5662023b10 Release exp-v0.52.150: reap idle abandoned terminals (#5844, @ai-ag2026) 2026-07-26 00:56:18 +00:00
ai-ag2026
a31cdb7765 fix(terminal): unsubscribe when the SSE header write fails after attaching
Adversarial review of the previous commit found a leak it introduced.

`attach_terminal()` subscribes and only then are the response headers written.
A client that dropped in that instant makes `end_headers()` raise
BrokenPipeError/ConnectionResetError, and because the `try/finally` started
*after* those writes, the exception escaped `_handle_terminal_output` with the
queue still in `_subscribers`. That pins `unwatched_since` at None — only
`unsubscribe()` on an empty subscriber list resets it — so the terminal became
permanently unreapable: the exact fd/thread leak (#4633) this reaper exists to
prevent, and strictly worse than the TOCTOU the previous commit fixed, since
that at least still allowed cleanup.

The try now starts immediately after the attach, so every exit path
unsubscribes. Regression test drives a handler whose `end_headers()` raises and
asserts the subscriber list is empty, `unwatched_since` is restored, and the
terminal is reapable again once the grace elapses. It fails against the
previous ordering.
2026-07-25 03:17:30 +02:00
ai-ag2026
07d110a064 fix(terminal): close the reaper's selection→reconnect→close TOCTOU
`_terminals_to_reap()` snapshots victims under `_LOCK` and then releases it,
but `subscribe()` clears `unwatched_since` and appends to `_subscribers` under
the terminal's own `_sub_lock`, which the selection pass never held. A viewer
reconnecting in that gap left object identity — all `close_terminal(expected=…)`
ever checked — still true, so the reaper killed a terminal that now had a live
viewer.

- `_claim_reap_victim()` re-establishes the *whole* selection predicate while
  holding `_LOCK` and the terminal's `_sub_lock`, and removes the registry
  entry in that same critical section: same object, no subscribers, and
  `unwatched_since` still set and still expired. A dead process is still
  reaped unconditionally — it cannot come back, and a viewer watching a corpse
  must not pin the entry forever.
- `attach_terminal()` does the registry lookup and the subscribe atomically
  under `_LOCK`, replacing `get_terminal()` + `term.subscribe()` in the SSE
  route. It takes the same two locks in the same order as the claim, so
  exactly one side wins: the viewer attaches (and the reap is refused), or the
  entry is already gone (and the route answers "terminal not running" before
  committing a 200, instead of streaming from a corpse). Registration is the
  authority — a registered-but-`closed` terminal still attaches so the viewer
  receives `terminal_closed`.
- Teardown moved to `_teardown_terminal()` and runs after both locks are
  released; `killpg`+`wait` can block ~2.5s and must not pin the registry.
- Dropped the duplicated `self.last_activity = time.time()` the rebase left in
  `put_output()`.

Tests: a barrier regression that pauses the reaper after selection, attaches a
viewer through the production path, resumes, and asserts the terminal stays
registered/live and still receives output; the inverse where the reap claims
first and the attach reports not-running; refreshed-grace and replaced-entry
claims; dead-with-viewer; and a probe that `_LOCK` is free during teardown.
Three of them fail against an identity-only claim.
2026-07-25 00:33:41 +02:00
ai-ag2026
932e858994 feat(terminal): reap idle abandoned terminals so #4633 can't accumulate
The fd-leak fix retires a terminal whose shell EXITS, and _MAX_TERMINALS bounds
the worst case, but an interactive shell abandoned by its client (tab closed
without POSTing /api/terminal/close, browser crash, network drop) keeps running
forever — there is deliberately no PDEATHSIG. A background reaper now closes any
terminal that has had zero attached output streams for longer than a 15-minute
idle grace, plus any dead-process terminal as a belt-and-suspenders for the
reader-loop retire.

Attachment is tracked on the subscriber model from the output-broadcast change:
subscribe() clears unwatched_since, the last unsubscribe() sets it. A terminal
is born unwatched, so a spawn nobody ever attaches to is reaped too; the grace
spans a tab refresh / brief drop so a real reconnect keeps the session. Eviction
uses close_terminal(sid, expected=term) so a restart replacement is never torn
down. The reaper thread is a lazily-started daemon singleton like the spawn
supervisor.

Stacked on the terminal fd-leak + output-broadcast changes (same file).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 00:30:06 +02:00
ai-ag2026
1603eb8611 fix(terminal): stop leaking fd + thread + shell on client/​shell exit
Two embedded-terminal resource leaks (#4633):

1. fd + dict entry on shell exit. When a shell exited on its own (user typed
   `exit`, the process died), _reader_loop broke out of its loop but only set
   `closed` and emitted terminal_closed — it never closed the pty master_fd nor
   removed the _TERMINALS entry. Only an explicit close_terminal / restart /
   atexit did that, so every self-exited shell leaked its master fd and dict
   entry for the rest of the WebUI's uptime. The reader loop now retires the
   session (close_terminal with an `expected=` identity guard so a restart's
   replacement is never torn down).

2. Unbounded accumulation of abandoned terminals. A client that drops its output
   stream without POSTing /api/terminal/close (tab close, crash, network drop)
   leaves the shell running (no PDEATHSIG, by design). _MAX_TERMINALS (32) now
   caps the live population, evicting a dead-proc terminal first, else the
   least-recently-active one, to make room.

Also hardens an fd-reuse TOCTOU that #1 would otherwise make reachable on the
common `exit` path: write_terminal / resize now re-check `closed` and touch
master_fd under a per-terminal io_lock that close_terminal also holds around
os.close, so input can never land on a closed-and-recycled fd number.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-25 00:30:05 +02:00
starship-s
53f9ab9a00 test(streaming): assert interim prose finalizes once
Pin the exact parser finalization count in the interim-assistant-to-tool regression.

Assisted-by: Hermes Agent:gpt-5.6-sol
Assisted-by: Codex:gpt-5.6-luna
2026-07-24 12:49:02 -06:00
starship-s
69b26c1fa5 fix(streaming): complete interim anchor prose
Treat status-less interim assistant events as complete semantic boundaries so streaming Markdown flushes its final lookahead character before tool activity. Add behavior coverage for the real interim-to-tool Anchor pipeline.

Assisted-by: Hermes Agent:gpt-5.6-sol
Assisted-by: Codex:gpt-5.3-codex-spark
2026-07-24 12:30:46 -06:00
Hermes Agent
b104abeae6 fix(admin): repair model reload rebinding 2026-07-24 18:05:17 +08:00
Frank Song
cbe353fb93 Scope preserveDom to live assistant turn only 2026-07-24 13:43:15 +08:00
Frank Song
f0ab804cc1 Remove unrelated PR screenshots 2026-07-24 13:24:41 +08:00
Frank Song
30df3ce0fe Restore completion read-state ordering 2026-07-24 13:05:01 +08:00
Frank Song
65121ca1ad Sync viewed state before live settlement cache 2026-07-24 13:03:38 +08:00
Frank Song
732ba2b774 Add Live Worklog settlement evidence 2026-07-24 12:52:14 +08:00
Frank Song
7f0099f1f6 Fix live settlement test compatibility 2026-07-24 12:50:05 +08:00
Frank Song
ae264f71a3 Preserve live Worklog through final settlement 2026-07-24 12:43:34 +08:00
nesquena-hermes
399cd7ab19
Release: credit collapsed wakeup cards (#6350, @b3nw) (#6466)
Co-authored-by: nesquena-hermes <agent@nesquena-hermes>
2026-07-23 20:54:32 +00:00
b3nw
e93b0c352a
feat: render process wakeups as collapsed summary cards (#6350)
Render structured background-process completions and watch matches as accessible collapsed cards while preserving raw fallback, verbatim output, and full watch patterns.

Co-authored-by: b3nw <b3nw@duck.com>
2026-07-23 20:52:51 +00:00
nesquena-hermes
ecc47782e3
Merge pull request #6447 from nesquena/stage/6349
Release: composer keystroke resize round-trip fix (#6349)
2026-07-22 21:24:22 -07:00