Commit Graph

1369 Commits

Author SHA1 Message Date
roboomp 1e209caeee perf(session): gate blob-ref resolution behind synchronous precheck
resolveBlobRefsInEntries handed every non-session entry to the recursive
async resolvePersistedBlobRefs walk, allocating and awaiting child promises
even for plain-text entries with no blob:sha256: refs. On large text-heavy
histories this dominated the blob_resolve phase of session open.

Add a cheap synchronous containsBlobRef precheck that early-exits on the
first ref and allocates nothing. Interleave the precheck with per-entry
initiation so positive entries still start resolution at the same relative
point as the old filter+map schedule (a later entry that gains a ref during
an earlier BlobStore.get is still scanned after that mutation).

Blob-free N=5000 fixture: blob_resolve median 19.5ms -> 1.1ms, zero
BlobStore.get calls.

Fixes #5922
2026-07-17 23:25:16 +00:00
can1357 3df9cb12c1 Merge PR #5883: fix(agent): preserve signed thinking-only stops (@roboomp) 2026-07-17 21:22:06 +02:00
can1357 1311e6440b Merge PR #5809: fix(session): make /new an atomic boundary against queued steers (@roboomp) 2026-07-17 21:22:06 +02:00
can1357 255707426b Merge PR #5846: fix(cli): preserve carriage-return progress boundaries (@roboomp) 2026-07-17 21:22:04 +02:00
can1357 248421fdf9 fix(coding-agent): fixed xd:// mount notices triggering unsolicited model turns
- Fixed xd:// mount notices forcing their own model turn by deferring them until the next user prompt instead.
- Added `#pendingXdevMountDelta` field and `#takePendingXdevMountNotice()` to coalesce mount/unmount events and ride along with prompts.
- Mount and unmount events that cancel each other out before the next prompt are now dropped from the coalesced delta.
- Notices remain buffered during quiet startup mode (`startup.quiet`) and are delivered on the subsequent user prompt.
2026-07-17 20:36:11 +02:00
roboomp bacc24e12e fix(agent): preserved signed thinking-only stops
- Treated non-empty thinking signatures as terminal provider content.
- Added regression coverage for empty visible thinking with a valid signature.

Fixes #5881
2026-07-17 17:08:15 +00:00
vmcall d944879f21 feat(task): unified structured subagent execution
- Added per-invocation task schemas with strict and permissive validation.
- Shared task and eval agent policy, artifacts, isolation, and lifecycle handling.
- Enabled host-restricted plan-mode eval agents and persisted their capability clamp.

Fixes #5279
2026-07-17 17:36:59 +02:00
roboomp e5f65fcd5f fix(cli): preserved carriage-return progress boundaries
Normalized lone carriage returns before terminal output is buffered while retaining CRLF as a single line boundary across chunk splits.

Fixes #5845
2026-07-17 13:58:45 +00:00
roboomp 67727c8de5 fix(session): resumed queued messages after compaction reconnects
The #5800 drain guard suppressed the abort-finally stranded-message
drain while the session was disconnected from the agent event stream.
newSession/switchSession drop the agent queues on transition, so nothing
is lost there. compact() preserves the queues and only reconnected in
its finally — it never re-drained — so a steer/follow-up arriving during
compaction (async IRC, an xd:// mount notice, an SDK steer) stayed
stranded until the next explicit prompt.

Re-drain in compact()'s finally after #reconnectToAgent (and after the
compaction AbortController is cleared, so isCompacting is false and the
scheduled agent.continue() actually runs). Added a regression test that
queues a follow-up mid-compaction and asserts it resumes.

Fixes #5800
2026-07-17 08:03:03 +00:00
roboomp 4d685bf761 fix(session): made /new an atomic boundary against queued steers
newSession() disconnects the agent listener and awaits abort() before
agent.reset(). abort()'s finally clears #abortInProgress and calls
#drainStrandedQueuedMessages(), which scheduled agent.continue() on the
still-old context — starting an unsolicited provider turn (e.g. from a
queued xdev-mount hidden steer) that raced the reset and appended its
late output to the fresh session.

Guard the drain to no-op while the session is disconnected from the
agent event stream (#unsubscribeAgent === undefined): a transition owns
the queue, and there is no listener to persist or render output. A plain
user-interrupt abort() stays connected, so its legitimate stranded drain
still runs.

Fixes #5800
2026-07-17 07:43:06 +00:00
can1357 eac51b6a04 Merge: darkphilosophy/feat/advisor-per-agent-toggle
Brings the per-advisor toggle, status-line glyphs, quota display, and the
failing-advisor stall/abort fix (f4c8143) onto main's rewritten advisor
runtime. Conflict reconciliation kept main's architecture (fingerprint
prefix reconciliation, host-level onTurnError recovery + fallback chains,
terminal-failure classification) and ported the branch semantics onto it:

- #failing latch: waitForCatchup resolves immediately while an advisor is
  mid-failure; parked waiters wake the moment a turn fails, before any
  async hook or retry sleep.
- Turn-end render containment: a formatter bug restores the cursor/prefix/
  dedup snapshot and never propagates into the primary's turn-end callback
  (per-advisor try/catch boundary in AgentSession).
- Quota pause: when host recovery declines a usage-limit failure, the
  runtime latches quotaExhausted, requeues the batch, and notifies —
  cleared only by an explicit reset.
- Hard halt after a permanent rejection or three backlog-drop cycles.
- #recoverAdvisorTurn also marks usage limits for structural errors thrown
  before any assistant turn is recorded.
2026-07-17 07:37:29 +02:00
DarkPhilosophy f4c81434d0 fix(advisor): never let a failing advisor stall or abort the primary agent
A broken advisor could hold the primary agent on the per-turn catch-up
gate for its full 30s budget while retrying, and an exception thrown from
onTurnEnd propagated into the primary's turn-end callback.

- waitForCatchup resolves immediately while the advisor is mid-failure
  (new #failing latch, set at the failure catch BEFORE any async hook,
  cleared on the next successful turn or reset/seed).
- Every parked waiter is woken the moment an advisor turn fails.
- The turn-end boundary isolates advisor exceptions per advisor: a
  throwing advisor loses its delta, the primary and sibling advisors
  continue untouched.
- A failed render (poisoned message, formatter bug) restores the delta
  cursor and dedup state, so the delta is re-rendered next turn instead
  of silently lost; the size probe itself is guarded and falls back to
  the deferred renderer.
2026-07-17 07:24:30 +03:00
can1357 ac3d779fad merge PR #5592 via eval/pr-5592: feat(warp): emit native CLI-agent events 2026-07-17 05:29:29 +02:00
can1357 dee89ed5ae fix(warp): settle deferred handoffs 2026-07-17 05:25:05 +02:00
can1357 b4e46f8fc6 fix(session): tolerated partial extension runners in dispose
Managed-timer cleanup from #5667 is now optional-called so host or test
facades implementing only the dispatch surface do not throw during
dispose; aligned the selector fallback status expectation with #5586's
role-tag casing.
2026-07-17 05:23:00 +02:00
can1357 86b6265ef5 Merge branch 'sweep/2026-07-17' into eval/pr-5592
# Conflicts:
#	packages/coding-agent/test/agent-session-checkpoint-rewind-branch.test.ts
2026-07-17 05:22:52 +02:00
can1357 f36394ef55 style: fixed formatting in merged test and session files 2026-07-17 05:02:31 +02:00
can1357 11a879e993 merge PR #5463 via eval/pr-5463: fix(advisor): anchor context maintenance on provider usage
Semantic merge with #5734 (delivered-prefix reconciliation) and #5748
(fallback chains): kept the coalescing round cap and wip threading,
adopted bounded cursor-preserving maintenance resets and overflow
recovery, and gated late-arrival consumption on coalescing rounds so
both suites' backlog and preserved-updates contracts hold.
2026-07-17 04:55:49 +02:00
DarkPhilosophy 1b4c292f8f Merge remote-tracking branch 'can1357/main' into feat/advisor-per-agent-toggle 2026-07-17 05:47:09 +03:00
DarkPhilosophy 3be0663bf2 fix(advisor): halt permanently rejected advisors and chunk large delta renders
Two shared failure modes with a single misbehaving advisor:

- A permanently rejected request (invalid_request_error, e.g. a model the
  account no longer supports) retried forever: one notice, then silent
  re-attempts on every turn, rebuilding heavy context each cycle. Quota
  exhaustion already paused with a notice; this class now hard-stops the
  runtime after a permanent rejection or three consecutive backlog-drop
  cycles, with a visible notice. An explicit reset (/new, config rebuild,
  restart) re-enables it, and waitForCatchup resolves while halted so the
  primary agent never parks on a runtime that cannot drain.

- The delta render ran synchronously on the event loop; replaying a
  multi-MB transcript after a reset blocked it for 600ms+ per render
  (measured 675ms at ~54MB). Large deltas now render in size- and
  count-bounded chunks that yield between slices (675ms -> single-digit
  ms stalls). Tool call/result pairing survives chunk boundaries via a
  shared whole-delta result index in formatSessionHistoryMarkdown; small
  per-turn deltas keep the synchronous fast path.
2026-07-17 05:47:01 +03:00
can1357 6f42a4375f merge PR #5748 via eval/pr-5748: fix(advisor): apply configured fallback chains 2026-07-17 04:45:46 +02:00
can1357 05e1314bd9 merge PR #5760 via eval/pr-5760: fix(coding-agent): restored xdev for explicit tool sessions
Resolved plan-mode exit overlap with #5662 (kept restore/rollback
structure, routed pending-switch clearing through
clearPendingPlanModelSwitch) and unioned additive test blocks with
#5672/#5662.
2026-07-17 04:42:10 +02:00
can1357 658438b352 merge PR #5747 via eval/pr-5747: fix(session): retained bash ownership across session/branch transitions 2026-07-17 04:40:04 +02:00
can1357 fd6f2e0b94 merge PR #5721 via eval/pr-5721: fix(coding-agent): stop post-turn maintenance turns
Resolved sdk.ts overlap with #5651 (kept getCursorTools alongside the
extracted transformToolCallArguments) and beginDispose overlap with
#5668 (kept both title-generation and autolearn-capture aborts).
2026-07-17 04:40:03 +02:00
can1357 2104c16ec2 merge PR #5686 via eval/pr-5686: fix(cursor): wire advisor tools through the cursor exec bridge
Union-resolved test conflict with PR #5651's mounted-tool bridge tests;
extended the local BlockState helper with resolvedMcpToolCallIds added
by #5651's exec-resolved stamping.
2026-07-17 04:39:06 +02:00
can1357 57ff8a8d25 merge PR #5683 via eval/pr-5683: style(session): satisfy xdev rewind checks 2026-07-17 04:37:12 +02:00
can1357 3489ac46ca merge PR #5672 via eval/pr-5672: fix(session): honored quiet startup for xdev notices 2026-07-17 04:37:11 +02:00
can1357 5903894e66 merge PR #5668 via eval/pr-5668: fix(session): preserved provider session for titles 2026-07-17 04:37:10 +02:00
can1357 e56ac80b1d merge PR #5667 via eval/pr-5667: fix(extensions): isolated self-scheduled callbacks from killing the session 2026-07-17 04:37:10 +02:00
can1357 f5a52963a7 fix(coding-agent): isolate auto-learn capture lifecycle 2026-07-17 04:07:05 +02:00
can1357 5b781090ae fix(cursor): resolve advisor deletes from live cwd 2026-07-17 04:05:39 +02:00
can1357 1424cae066 feat(coding-agent): added id-prefixed wildcard support to retry fallback chains
- Implemented parsing of id-prefixed wildcard keys and entries, allowing provider-specific prefixes in retry fallback configuration.
- Added logic to re-prefix failing model IDs and to match id-prefixed keys, with validation of provider existence.
- Updated settings schema description and changelog, and added tests covering the new behavior.
2026-07-17 03:49:43 +02:00
Victor Araújo 51ac313a63 fix(coding-agent): rolled back failed tool refreshes 2026-07-16 21:17:28 -03:00
Victor Araújo 0a4b26570f fix(coding-agent): made tool restoration transactional 2026-07-16 20:51:40 -03:00
Victor Araújo c01faf1cf5 fix(coding-agent): gated startup xdev mounts 2026-07-16 20:36:06 -03:00
Victor Araújo c60c182d8b fix(coding-agent): preserved mounted tool safeguards 2026-07-16 20:23:32 -03:00
Victor Araújo 68d905af04 fix(coding-agent): required built-in xdev reader 2026-07-16 20:09:39 -03:00
Victor Araújo 0f5ba296b8 fix(coding-agent): cleared PlanYolo state before restore 2026-07-16 19:57:28 -03:00
Victor Araújo 8d06327127 fix(coding-agent): preserved xdev mode transitions 2026-07-16 19:45:01 -03:00
Victor Araújo 5704c75081 fix(coding-agent): required built-in xdev transport 2026-07-16 19:40:12 -03:00
Victor Araújo 63886e8e2a fix(coding-agent): respected runtime tool selection 2026-07-16 19:30:05 -03:00
Victor Araújo 2f6316319f fix(coding-agent): preserved xdev transport capabilities 2026-07-16 19:16:21 -03:00
Victor Araújo 2e95b90366 fix(coding-agent): centralized xdev transport lifecycle 2026-07-16 19:10:37 -03:00
Victor Araújo 6e86dc7b19 fix(coding-agent): preserved xdev presentation state 2026-07-16 19:01:18 -03:00
Victor Araújo 323ef8ec73 fix(coding-agent): restored xdev for explicit tools 2026-07-16 18:41:58 -03:00
roboomp 203b959056 fix(advisor): restored primary after fallback cooldown
- Retained the advisor's original selector and thinking level while progressing through fallback candidates.
- Restored the configured primary before later advisor turns once its selector cooldown expired.
- Covered quota fallback restoration under the default cooldown-expiry policy.
2026-07-16 20:08:51 +00:00
roboomp e6de8142fe fix(session): retained bash ownership across session/branch transitions
Late user-initiated bash results and minimized-output artifacts were
recorded against whichever session or branch was active when execution
finished, not the one that started it. executeBash() awaited the result
then wrote through the mutable live sessionManager, while pending bash
messages carried no session/branch ownership and the minimized-output
callback used the live manager. A session change during execution
redirected transcript entries and artifacts to the replacement session
or branch, and a dropped session could be recreated by a straggler.

Capture a bash ownership target when execution starts and transition it
whenever the active session or transcript leaf changes. Late results and
minimized artifacts route to the originating session/branch (via a
detached clone when the file changed, or an off-leaf branch append when
the leaf moved), are discarded for an intentional drop, and ownership is
released on failed transitions. RPC dispatch concurrency and immediate
abort_bash behavior are unchanged.

Fixes #5743
2026-07-16 19:56:27 +00:00
roboomp 777e5e0982 fix(advisor): applied configured fallback chains
- Switched advisor turns to the next configured model after provider quota or rate-limit failures.
- Emitted fallback applied and succeeded lifecycle events without reporting advisor unavailability after recovery.
- Added an end-to-end advisor quota fallback regression test.

Fixes #5740
2026-07-16 19:56:24 +00:00
roboomp e518bc22c4 fix(coding-agent): stopped post-turn maintenance turns
- Prevented compaction from reopening a settled terminal answer unless queued work or an active goal remains.
- Ran auto-learn capture in an abortable detached agent with constrained tools and isolated provider state.
- Replaced primary-turn capture coverage with private-capture regression tests.

Fixes #5715
2026-07-16 14:55:27 +00:00
robomp-bot 06f1f092a0 fix(coding-agent): mark TTSR and rewind continuations 2026-07-16 22:14:53 +09:00