Commit Graph
128 Commits
Author SHA1 Message Date
can1357 2ffb67e3c7 fix: reconciled merged tests and dead code with current main structure
- warp completion test updated to event-taking notification signature
- hindsight test config gained required timeout fields
- dropped orphaned parseBillingConfig and advisor secret-collection dupes
- deduped fixture key; formatter pass on merged files
2026-07-23 18:02:31 +02:00
can1357 c0c1622012 Merge PR #4636: feat(secrets): add friendly names to secret placeholders (@Mathews-Tom)
# Conflicts:
#	packages/ai/test/pi-native-client.test.ts
#	packages/coding-agent/src/advisor/runtime.ts
#	packages/coding-agent/src/prompts/tools/eval.md
2026-07-23 17:56:24 +02:00
can1357 735a345086 Merge PR #5902: fix(advisor): keep advise when Cursor emits ungranted native tools (@roboomp) 2026-07-18 19:57:44 +02:00
Christian Stewart c8f1972c8c fix(coding-agent): drain advisor reviews in print mode 2026-07-18 01:51:00 -07:00
roboomp 3d72284de5 fix(advisor): kept advise when cursor emits ungranted native tools
Cursor selects server-native tools (bash, grep, ...) outside the advisor's grant. Those exec-channel blocks are stamped kCursorExecResolved: they already ran server-side through the advisor-scoped CursorExecHandlers bridge, which rejects ungranted tools in-band. quarantineAdvisorUnsafeOutput was flagging them as pre-dispatch hazards and discarding the entire turn, dropping the legitimate advise emitted alongside them.

Skip exec-resolved native blocks in the unavailable-tool check so the scoped bridge stays the grant gate and the advisor can still deliver advice.

Fixes #5900
2026-07-17 19:18:42 +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 2594ae352b style: formatted conflict-resolved files with biome 2026-07-17 05:01:19 +02:00
can1357 dd84ec57ce apply PR #5468: fix(advisor): stop retrying terminal failures
Grafted the evaluator's port (ec2c1e632) onto the merged advisor
runtime: terminal provider failures classified non-retriable (and not
context overflow) drop the bounded batch after one attempt with a
single notification; fallback-chain recovery and overflow recovery
retain precedence. Includes the one-prompt regression test and tags the
rollback-retry fixture's synthetic failure as transient.
2026-07-17 05:00:06 +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 b28dd5e50a merge PR #5734 via eval/pr-5734: fix(advisor): reconcile rewritten transcript prefixes 2026-07-17 04:45:38 +02: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 4d0f9c1b66 fix(advisor): reconciled rewritten transcript prefixes
- Tracked delivered message identities alongside the numeric cursor.
- Re-primed advisor context when a live transcript prefix diverged.
- Covered accepted empty-stop pruning before the next real user turn.

Fixes #5731
2026-07-16 17:37:40 +00:00
roboomp 1824faf21e fix(advisor): recognized authorized cursor deletes
Cursor synthesizes an executed native delete as a tool call named delete. When write or edit enabled native deletion, the advisor quarantine allowlist still omitted that synthetic name and rolled back the completed turn.

Add delete to the allowlist from the same mutation-capability boolean that enables native deletion, with regression coverage for the quarantine path.

Fixes #5680
2026-07-16 10:46:42 +00:00
DarkPhilosophy 4695db1ed6 fix(advisor): preserve YAML whitespace on CI 2026-07-16 03:31:10 +03:00
roboomp 54df76be81 fix(advisor): steer late blocker after terminal answer
A late interrupting advisor note delivered after the primary ended with a
terminal text answer (no queued work) was routed to `preserve` for every
severity, so a `blocker` flagging a mistake in the final output became a
passive card that the model ignored until the next user turn.

Scope the terminal-answer preserve rule to non-blocker severities: a
`blocker` now steers a triggered turn so the primary acknowledges and
continues before the turn is considered done, while a late `concern` still
preserves as a visible card (keeps the #4840 no-duplicate-completion path).

Fixes #5628
2026-07-15 23:12:42 +00:00
DarkPhilosophy 1d69621776 fix(advisor): preserve watchdog configuration 2026-07-16 02:07:51 +03:00
Mathews-Tom 0e3eaab137 fix(advisor): preserve history tool arguments 2026-07-16 02:08:42 +05:30
Mathews-Tom c4ef142581 fix(advisor): scan raw primary context 2026-07-16 01:54:55 +05:30
Mathews-Tom d27c9f1bbe fix(advisor): redact rendered transcript only 2026-07-16 01:42:48 +05:30
Mathews-Tom a548c44670 fix(advisor): redact only rendered tool previews 2026-07-16 01:21:53 +05:30
Mathews-Tom 41d2b40555 fix(advisor): scan only rendered tool previews 2026-07-16 01:07:09 +05:30
Mathews-Tom e8ac3b54de fix(advisor): limit execution redaction previews 2026-07-16 00:54:40 +05:30
Mathews-Tom 4fa34d07b9 fix(advisor): clear rewritten thinking signatures 2026-07-16 00:43:59 +05:30
Mathews-Tom cd2047ba81 fix(advisor): skip hidden tool result bodies 2026-07-16 00:35:04 +05:30
Mathews-Tom 39e95bdf43 fix(advisor): rescrub coalesced secret prefixes 2026-07-16 00:22:46 +05:30
Mathews-Tom 71d609d635 fix(advisor): skip hidden custom payloads 2026-07-15 23:09:45 +05:30
Mathews-Tom 93530e0cd6 fix(advisor): retain regex collision values 2026-07-15 22:16:44 +05:30
Mathews-Tom c41dc368cc fix(advisor): skip hidden file body redaction 2026-07-15 22:13:17 +05:30
Mathews-Tom 68d712be4f fix(advisor): ignore hidden file mention content 2026-07-15 21:58:52 +05:30
Mathews-Tom d294cba91c fix(advisor): skip hidden execution output 2026-07-15 21:44:38 +05:30
Mathews-Tom 95c8e5ac0e fix(advisor): ignore hidden execution output 2026-07-15 21:42:33 +05:30
Mathews-Tom 6aec4c460f fix(advisor): ignore hidden tool details 2026-07-15 21:32:19 +05:30
DarkPhilosophy 4a0ba05fe8 fix(advisor): ignore stale quota hooks 2026-07-15 04:42:37 +03:00
DarkPhilosophy a5b4832cc0 fix(advisor): align quota retry handling 2026-07-15 04:05:59 +03:00
DarkPhilosophy 0a9a5aa186 Merge remote-tracking branch 'can1357/main' into feat/advisor-per-agent-toggle
# Conflicts:
#	packages/coding-agent/src/advisor/runtime.ts
2026-07-15 03:32:11 +03:00
Mathews-Tom 17aad95abc fix(advisor): scrub colliding secret labels 2026-07-15 05:19:45 +05:30
Mathews-Tom 9a01a77c4a Merge remote-tracking branch 'upstream/main' into feat/secret-friendly-names 2026-07-15 04:48:00 +05:30
can1357 4114d280bd fix(coding-agent/advisor): treated zero-content advisor stop turns as valid review completions
- Replaced the advisor turn validation to raise errors only when a turn has no assistant response at all, instead of treating a content-less `stop` as a failure.
- Kept zero-content silent reviews from entering the retry/rollback/warn path by no longer raising "Advisor unavailable" for completed empty-stop turns.
- Updated advisor runtime tests and changelog language to assert and document that consecutive zero-usage silent turns now succeed without notifications.
2026-07-14 23:36:08 +02:00
roboomp 1a4c195017 fix(coding-agent): accepted silent advisor stops with output tokens
The advisor runtime rejected every content-less stop completion as a
failed turn, so a deliberate silent review (the documented verifier
behavior) triggered retries and a spurious "unavailable" warning. Only
treat a content-less stop as a failure when it produced no output signal
(zero output and reasoning tokens), so a token-bearing silent stop counts
as a successful silent review.

Fixes #5493
2026-07-14 20:31:21 +00:00
roboomp cc9977cce4 fix(advisor): anchored context maintenance on provider usage
- Anchored advisor compaction on provider-reported context usage (cached
  input + generated output) floored by a full local estimate including the
  advisor system prompt and tool schemas, so a near-full cached context is no
  longer undercounted by the per-message estimate.
- Rejected stale provider usage retained across advisor compaction via a
  runtime-only usage-anchor boundary recorded on the summary message.
- Recovered provider overflow by clearing only the advisor's own context at
  the current primary cursor, retrying the bounded failing batch once against
  a fresh context without replaying old primary history, and keeping later
  updates eligible.
- Threaded the selected dashboard range through the stats Recent Errors UI,
  API, and database timestamp filter before ordering and the 50-row limit.

Fixes #5282
2026-07-14 17:58:19 +00:00
can1357 5e74444c27 fix(test): repair auth-storage-rotation merge resolution and normalize changelogs 2026-07-14 18:50:47 +02:00
can1357 1dfec0d161 Merge PR #5090: fix(advisor): reduce stale advisories via delta coalescing, WIP markers, and delivery annotation (@apoc)
# Conflicts:
#	packages/coding-agent/src/advisor/__tests__/advisor.test.ts
#	packages/coding-agent/src/advisor/runtime.ts
#	packages/coding-agent/src/session/agent-session.ts
2026-07-14 18:44:57 +02:00
can1357 e96f5451db Merge PR #5216: fix(coding-agent): reject empty advisor stop completions (@roboomp) 2026-07-14 18:41:15 +02:00
can1357 b52a4cdede Merge PR #5186: fix(coding-agent): preserve late advisor notes after terminal answers (@roboomp)
# Conflicts:
#	packages/coding-agent/test/agent-session-advisor-suppression.test.ts
2026-07-14 18:40:35 +02:00
can1357 c0a0216867 fix(advisor): close quarantine containment gaps 2026-07-14 18:39:54 +02:00
DarkPhilosophy 600682d447 fix(advisor): classify switched-retry errors before pausing quota
When onTurnError signals a switched sibling credential (switched=true),
the retry error is now classified via isQuotaError:
- Second quota: marks the sibling via onTurnError, then enters quota pause
- Non-quota transient: routes through onTurnError and the generic
  failure/requeue/notify path instead of unconditionally pausing
2026-07-14 00:52:00 +03:00