Commit Graph

1900 Commits

Author SHA1 Message Date
Ayaan Zaidi
815c2e3052 fix(media): parse lowercase media directives
(cherry picked from commit f350bb4dfc)
2026-04-21 16:39:35 +01:00
Peter Steinberger
6ce17db11a fix: gate max thinking by model support 2026-04-21 07:02:43 +01:00
Peter Steinberger
e4adb0b0e3 fix: hide adaptive think option for GPT models 2026-04-21 06:19:29 +01:00
Peter Steinberger
f5be489266 test: add gpt-5.4 thinking visibility QA 2026-04-21 06:13:39 +01:00
Peter Steinberger
3e43306346 fix: handle webchat image-only turns (#69474) 2026-04-21 06:04:34 +01:00
Jaswir Raghoe
ca16413f3f fix(gateway): restore webchat pure-image turn handling (#69358)
eb10803691 tightened the reply-run empty-turn gate to only count
baseBodyFinal (strict user body) and to always append the '[User sent
media without caption]' placeholder to any prefix. That broke the Control
UI webchat path: images arrive via opts.images and do not stamp
sessionCtx.MediaPath (by design — see chat.directive-tags.test.ts
assertion that ctx.MediaPath stays undefined on dispatch). For pure-image
webchat turns the gate therefore returned 'I didn't receive any text in
your message', and when a caption was present the placeholder text leaked
into the Control UI user bubble on top of the inbound-context prefix.

Revert the three get-reply-run.ts hunks from eb10803691 back to the stable
2026.4.5 behavior: check baseBodyForPrompt.trim() (which includes the
inbound-context prefix) for the empty-turn gate, and fall back to the
plain '[User sent media without caption]' placeholder only when the whole
prompt body is empty.

Drop the media-only test the same commit added for metadata-only-prefix
bail-out; it encoded the exact behavior this reverts.

Fixes #69358.
Refs #69427.
2026-04-21 06:04:34 +01:00
Tak Hoffman
1303b03241 fix: add silent reply policy by conversation type (#68644)
Thanks @Takhoffman.
2026-04-21 05:17:55 +01:00
Peter Steinberger
9b42cd8728 test: fix cost snapshot PR checks 2026-04-21 03:44:25 +01:00
Dexter (Miaigi)
47bb5ddece fix(cost): snapshot estimatedCostUsd instead of accumulating (#69347)
The bug: three persist sites accumulated cost instead of snapshotting
it like tokens. This caused cost to be inflated 1x-72x on multi-persist
sessions because the same cumulative usage was added repeatedly.

Root cause: persistSessionUsageUpdate, updateSessionStoreAfterAgentRun,
and the cron isolated-agent run path all used:
  estimatedCostUsd = existingCost + runCost

But runCost was already computed from cumulative run usage, so this
added the same cost repeatedly on redundant persists.

Fix: snapshot cost directly like tokens already do:
  estimatedCostUsd = runCost

Files affected:
- src/auto-reply/reply/session-usage.ts
- src/agents/command/session-store.ts
- src/cron/isolated-agent/run.ts

Tests added:
- session-store.test.ts: verify cost is snapshotted, not accumulated
- session.test.ts: updated existing test to verify snapshot behavior

Fixes #69347
2026-04-21 03:44:25 +01:00
Sk7n4k3d
0eb6f5d8bc session: clear auto-sourced model/auth overrides on /new and /reset 2026-04-21 03:36:16 +01:00
Peter Steinberger
215d5fb320 fix: clear auto-failover model overrides (#69365) (thanks @Chevron7Locked) 2026-04-21 03:35:16 +01:00
Kevin O'Neill
dc0e966ed2 fix(model-selection): address Codex review P2 feedback on auto-heal override clearing
Three corrections to the auto-failover self-healing introduced in the prior commit:

1. Reset in-memory provider/model to configured primary after clearing auto override.
   get-reply-directives.ts preloads provider/model from the stored override before
   calling createModelSelectionState, so clearing only session state still ran the
   current turn on the fallback. Now provider/model are reset to defaultProvider/
   defaultModel so this turn retries the primary immediately, not on the next turn.

2. Remove resetModelOverride = true from the auto-heal path. That flag triggers a
   "Model override not allowed for this agent" system event in
   applyInlineDirectiveOverrides, which is incorrect: the override was valid and set
   by the fallback loop — it just expired once the primary recovered. Auto-heal is
   not an allowlist violation.

3. Add a test case that verifies the in-memory reset when the caller pre-loads the
   fallback provider/model (simulating the get-reply-directives.ts preload path).

Known limitation (noted in comment): channel model overrides (channels.modelByChannel)
are skipped on the recovery turn because hasSessionModelOverride was true when they
were evaluated at preload time. They resume on the following turn once session state
is clear. Fixing this cleanly requires changes to the get-reply-directives preload
flow and is out of scope for this PR.
2026-04-21 03:35:16 +01:00
Kevin O'Neill
f2abe28d40 fix(model-selection): clear auto-failover overrides so primary is retried on each turn
When runWithModelFallback falls back to a secondary provider it writes
providerOverride/modelOverride/modelOverrideSource:"auto" to the session.
On subsequent turns createModelSelectionState read this stored override and
passed the fallback provider directly to runWithModelFallback, so the
configured primary was never retried — the session was permanently pinned to
the fallback even after the primary recovered.

Fix: at model-selection ingress, when the direct session override has
modelOverrideSource "auto" (set by a previous automatic fallback, not a user
/model command), clear the override and retry the configured primary. If the
primary is still down runWithModelFallback will fall back and re-set the auto
override for that turn. Once the primary recovers the override stays clear.

User-selected overrides (modelOverrideSource "user" or legacy undefined+model)
are preserved unchanged.

Covered by four new unit tests in model-selection.test.ts:
- auto-failover override cleared and primary retried
- user-selected override preserved
- legacy override without source field preserved
- parent-session auto-override applied to child (not cleared by child logic)
2026-04-21 03:35:16 +01:00
Sliverp
b938e6398b feat: add tiered model pricing support (#67605)
Adds tiered model pricing support for cost tracking, keeps configured pricing ahead of cached catalog values, and includes latest Moonshot Kimi K2.6/K2.5 cost estimates.\n\nThanks @sliverp.
2026-04-21 03:02:57 +01:00
Peter Steinberger
a112903802 test: use synthetic auto reply fixtures 2026-04-21 01:49:30 +01:00
Peter Steinberger
f50202ee95 test: use synthetic auto-reply channel fixtures 2026-04-21 01:18:05 +01:00
Peter Steinberger
f5305afcfb test: speed changed lanes and channel contracts 2026-04-20 20:53:38 +01:00
Peter Steinberger
18021818ce test: avoid prototype patching in harnesses 2026-04-20 20:28:48 +01:00
Peter Steinberger
29a1c4f46c test: narrow auto-reply skill secret fixture 2026-04-20 20:12:34 +01:00
Peter Steinberger
aa52d1be42 test: share auto-reply command fixtures 2026-04-20 20:07:37 +01:00
Peter Steinberger
a2f158e5ed test: share subagent command fixtures 2026-04-20 19:57:37 +01:00
Peter Steinberger
43fa394b83 test: share get-reply edge fixtures 2026-04-20 19:55:26 +01:00
Sebastian B Otaegui
f48d040bf5 feat: send compaction start and completion notices (#67830)
Merged via squash.

Prepared head SHA: abedf6cf11
Co-authored-by: feniix <91633+feniix@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-20 11:55:17 -07:00
Peter Steinberger
1603577dfd test: share get-reply hook fixtures 2026-04-20 19:53:41 +01:00
Peter Steinberger
a74ba90196 test: share get-reply fixtures 2026-04-20 19:51:25 +01:00
Peter Steinberger
82e6501f89 test: share auto-reply session fixtures 2026-04-20 19:48:04 +01:00
Peter Steinberger
e753fc9cc7 test: fix ACP and TTS local failures 2026-04-20 18:06:45 +01:00
Peter Steinberger
6a4d633e42 perf(test): keep session init thread parsing hot path lazy 2026-04-20 17:14:42 +01:00
Peter Steinberger
f11a8ea1ee perf(test): stub acp channel binding plugins 2026-04-20 16:50:40 +01:00
Peter Steinberger
3ecb713b00 perf: speed local checks and warm builds 2026-04-20 15:08:41 +01:00
Peter Steinberger
8a4332864b fix(plugins): stop eager bundled plugin dep install (#69334)
* fix(plugins): stop eager bundled plugin dep install

* test(auto-reply): mock direct auth profile store imports
2026-04-20 14:41:18 +01:00
Peter Steinberger
b722273acb refactor: share inbound media detection 2026-04-20 14:27:26 +01:00
Peter Steinberger
510fe8b95d perf(test): speed up reply trigger hotspots 2026-04-20 14:14:55 +01:00
Peter Steinberger
91f1f881bb refactor: share channel media limit lookup 2026-04-20 13:41:39 +01:00
Peter Steinberger
ff5904f5f4 test: share subagent action fixtures 2026-04-19 02:46:08 +01:00
Peter Steinberger
346aa0ed47 perf: narrow HTML parser type surface 2026-04-19 01:31:29 +01:00
Vincent Koc
ba58bc3787 test(auto-reply): trim reply test module churn 2026-04-18 16:42:25 -07:00
Peter Steinberger
b3a97df754 refactor: cache reply and visibility runtimes 2026-04-18 20:54:30 +01:00
Peter Steinberger
712644f0d9 fix(queue): preserve pending items during drains 2026-04-18 20:37:13 +01:00
Peter Steinberger
155162a8cd chore(lint): enable additional cleanup rules 2026-04-18 20:37:13 +01:00
Peter Steinberger
4fa961d4f1 refactor(lint): enable map spread rule 2026-04-18 20:37:12 +01:00
Peter Steinberger
d1fb2d25ea refactor: cache reply understanding imports 2026-04-18 20:29:03 +01:00
Peter Steinberger
2b7b5774b6 chore: remove dead code 2026-04-18 20:27:42 +01:00
Peter Steinberger
1f1ff0567a refactor(lint): reduce map spread patterns 2026-04-18 19:27:43 +01:00
lukeboyett
c39314c14a fix(agents): prefer target agent's bound Matrix account for subagent spawns (#67508)
Merged via squash.

Prepared head SHA: 9300111038
Co-authored-by: lukeboyett <46942646+lukeboyett@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-18 14:02:53 -04:00
Peter Steinberger
df525b90f2 chore(lint): enable unnecessary type parameter rule 2026-04-18 18:31:13 +01:00
Peter Steinberger
cdaa70facb refactor: cache repeated lazy imports 2026-04-18 16:32:53 +01:00
Peter Steinberger
66385670e4 refactor: reduce unnecessary dynamic imports 2026-04-18 16:15:33 +01:00
Frank Yang
442deb0816 fix(cli): normalize reply-media paths for agent --deliver (#68516) 2026-04-18 20:05:41 +08:00
Gustavo Madeira Santana
18c4fd5678 Session: skip binding lookup for system events 2026-04-18 01:50:56 -04:00