Commit Graph

16486 Commits

Author SHA1 Message Date
Peter Steinberger 3b09b58c5d test: cover browser cleanup for cron and subagents (#60146) (thanks @BrianWang1990) 2026-04-04 20:03:57 +09:00
BrianWang1990 e697838899 style: fix import order in server-cron.ts
Move plugin-sdk import after cron/* imports per alphabetical convention.
2026-04-04 20:03:57 +09:00
BrianWang1990 72b2e413d6 fix(browser): clean up browser tabs/processes when cron tasks and subagents complete
When cron tasks or subagents use browser automation, the browser
processes were not cleaned up after the task completed. This caused
orphaned Chrome processes (PPID=1) to accumulate over time.

Root cause: closeTrackedBrowserTabsForSessions was only called during
session-reset/session-delete (via ensureSessionRuntimeCleanup), but
isolated cron runs and subagent completions never triggered these paths.

Fix: Add browser tab cleanup in two places:
1. server-cron.ts: wrap runCronIsolatedAgentTurn in try/finally to
   ensure browser tabs are cleaned up after every cron run.
2. subagent-registry-lifecycle.ts: call closeTrackedBrowserTabsForSessions
   when a subagent run completes, before the announce cleanup flow.

Both cleanup calls are best-effort (caught errors) so they never mask
the actual task result or break the completion flow.

Fixes #60104
2026-04-04 20:03:57 +09:00
Peter Steinberger 0b1c9c7057
fix: stabilize codex auth ownership and ws fallback cache 2026-04-04 20:03:15 +09:00
Jithendra d204be80af feat(tools): add MiniMax as bundled web search provider
Add native MiniMax Search integration via their Coding Plan search API
(POST /v1/coding_plan/search). This brings MiniMax in line with Brave,
Kimi, Grok, Gemini, and other providers that already have bundled web
search support.

- Implement WebSearchProviderPlugin with caching, credential resolution,
  and trusted endpoint wrapping
- Support both global (api.minimax.io) and CN (api.minimaxi.com)
  endpoints, inferred from explicit region config, model provider base
  URL, or minimax-portal OAuth base URL
- Prefer MINIMAX_CODE_PLAN_KEY over MINIMAX_API_KEY in credential
  fallback, matching existing repo precedence
- Accept SecretRef objects for webSearch.apiKey (type: [string, object])
- Register in bundled registry, provider-id compat map, and fast-path
  plugin id list with full alignment test coverage
- Add unit tests for endpoint/region resolution and edge cases

Closes #47927
Related #11399

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 19:56:04 +09:00
Peter Steinberger e4ea3c03cf fix: scope live model switch pending state (#60266) (thanks @kiranvk-2011) 2026-04-04 19:45:53 +09:00
kiranvk2011 b36a3a3295 fix: add .catch() to fire-and-forget stale-flag clear to prevent unhandled rejection 2026-04-04 19:45:53 +09:00
kiranvk2011 e8f6ceedd4 fix: clear stale liveModelSwitchPending flag when model already matches
When the liveModelSwitchPending flag is set but the current model already
matches the persisted selection (e.g. the switch was applied as an override
and the current attempt is already using the new model), the flag is now
consumed eagerly via a fire-and-forget clearLiveModelSwitchPending() call.

Without this, the stale flag could persist across fallback iterations and
later cause a spurious LiveSessionModelSwitchError when the model rotates
to a fallback candidate that differs from the persisted selection.

Also expands JSDoc on shouldSwitchToLiveModel to document the stale-flag
clearing and deferral semantics.
2026-04-04 19:45:53 +09:00
kiranvk2011 251e086eac fix: use explicit flag for live model switch detection in fallback chain
Replace the ambiguous comparison-based approach (hasDifferentLiveSessionModelSelection
+ in-memory map EMBEDDED_RUN_MODEL_SWITCH_REQUESTS) with a persisted
`liveModelSwitchPending` flag on SessionEntry.

The root cause: the in-memory map was never populated in production because
requestLiveSessionModelSwitch() was removed in commit 622b91d04e and replaced
with refreshQueuedFollowupSession(). This left the comparison-based detection
as the only path, which could not distinguish user-initiated model switches
(via /model command) from system-initiated fallback rotations.

The fix:
- Add `liveModelSwitchPending?: boolean` to SessionEntry (persisted)
- Set the flag to true ONLY when /model command applies a model override
- New `shouldSwitchToLiveModel()` checks the flag + model mismatch together
- New `clearLiveModelSwitchPending()` resets the flag after consumption
- Replace throw-site logic in run.ts to use the new flag-based functions
- Remove orphaned resolveCurrentLiveSelection helper

Only the /model command sets this flag, so system-initiated fallback rotations
are never mistaken for user-initiated model switches. This restores the
live-switch-during-active-run feature that was accidentally broken.

Fixes #57857, #57760, #58137
2026-04-04 19:45:53 +09:00
Peter Steinberger 3f042ed002
fix: stabilize async provider test types 2026-04-04 19:39:22 +09:00
Peter Steinberger 87d840e9ee
fix: tighten Teams and device typing 2026-04-04 19:39:22 +09:00
Peter Steinberger e675634eb3
fix: preserve streamed Kimi tool args on repair fallback 2026-04-04 11:35:49 +01:00
Peter Steinberger 5bef64bc31 test: harden media provider auto-registration (#56279) (thanks @Ezio0) 2026-04-04 19:35:28 +09:00
Vincent Koc 39d2a719c9 refactor(providers): add family replay and tool hooks 2026-04-04 19:33:31 +09:00
Peter Steinberger 4e099689c0
feat: stream Claude CLI JSONL output 2026-04-04 19:33:08 +09:00
Peter Steinberger 10e0592ed0
refactor: extract device token rotate target guard 2026-04-04 19:32:25 +09:00
Vincent Koc 0a3211df2d
fix(openrouter): gate prompt cache markers by endpoint (#60761)
* fix(openrouter): gate prompt cache markers by endpoint

* test(openrouter): use claude sonnet 4.6 cache model
2026-04-04 19:32:13 +09:00
Peter Steinberger ee742cec40 fix: fallback ws usage totals (#54940) (thanks @lyfuci) 2026-04-04 19:32:05 +09:00
复试资料 e955cffd32 Agents: widen WS usage aliases 2026-04-04 19:28:54 +09:00
复试资料 d166f2648e Agents: normalize WS usage aliases 2026-04-04 19:28:54 +09:00
Peter Steinberger f0d3e231ef fix: cover bundled provider picker aliases (#58819) (thanks @Luckymingxuan) 2026-04-04 19:27:26 +09:00
Mingxuan c4a903319e fix(model-picker): fallback to unfiltered list when provider filter yields empty results 2026-04-04 19:27:26 +09:00
Mingxuan 360fdaa4f2 fix(model-picker): use matchesPreferredProvider for plan variant matching 2026-04-04 19:27:26 +09:00
Mingxuan fd3b7b5ae7 fix: add augmentModelCatalog hooks to bundled providers for proper filtering 2026-04-04 19:27:26 +09:00
Mingxuan 792558de01 fix(model-picker): use preferredProvider presence for filtering instead of catalog check
When auth choice explicitly sets a preferred provider (e.g., volcengine-api-key or byteplus-api-key), the model picker should always filter by that provider. Previously, it relied on providerIds.includes(preferredProvider), which could be false if the catalog hadn't loaded that provider's models yet due to a race condition between auth choice setup and catalog loading.

This ensures that selecting a provider via auth choice consistently filters the model list to only that provider's models, rather than showing all providers.
2026-04-04 19:27:26 +09:00
Peter Steinberger 6b82140336 fix: land device token role guard follow-up (#60462) (thanks @eleqtrizit) 2026-04-04 19:27:10 +09:00
Agustin Rivera 7cda9df4cb fix(device): reject unapproved token roles 2026-04-04 19:27:10 +09:00
Peter Steinberger d58b4d7425 fix: respect MINIMAX_API_HOST in bundled minimax catalogs (#34524) (thanks @caiqinghua) 2026-04-04 19:26:12 +09:00
Peter Steinberger 01a24c20bf
refactor: expose node pairing approval scopes 2026-04-04 19:23:33 +09:00
0912078 28021a0325 fix(minimax): invert usage_percent when deriving usedPercent from remaining-only fields
MiniMax's usage_percent / usagePercent fields report the *remaining* quota
as a percentage, not the consumed quota. When count fields (prompt_limit /
prompt_remain) are also present, fromCounts already computed the correct
usedPercent and the inverted value was silently ignored. But when only
usage_percent is returned (no count fields), the code treated it as a
used-percent and passed it through unchanged, causing the menu bar to show
"2% left" instead of "98% left".

Move usage_percent and usagePercent from PERCENT_KEYS to a new
REMAINING_PERCENT_KEYS array. deriveUsedPercent now inverts remaining-percent
values to obtain usedPercent, matching the behaviour already validated by the
existing "prefers count-based usage when percent looks inverted" test. Count-
based fromCounts still takes priority over both key groups.

Fixes #60193

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 19:20:50 +09:00
Vincent Koc 5779831723 fix(agents): stabilize prompt cache followups 2026-04-04 19:17:59 +09:00
Peter Steinberger ca2fdcc45f fix: enforce node pairing approval scopes end-to-end (#60461) (thanks @eleqtrizit) 2026-04-04 19:13:48 +09:00
Agustin Rivera 0089d0e2e6 fix(pairing): require pairing scope for node approvals 2026-04-04 19:13:48 +09:00
Brad Groux fce81fccd8
msteams: add typingIndicator config and prevent duplicate DM typing indicator (#60771)
* msteams: add typingIndicator config and avoid duplicate DM typing

* fix(msteams): validate typingIndicator config

* fix(msteams): stop streaming before Teams timeout

* fix(msteams): classify expired streams correctly

* fix(msteams): handle link text from html attachments

---------

Co-authored-by: Brad Groux <bradgroux@users.noreply.github.com>
2026-04-04 04:34:24 -05:00
Peter Steinberger cd36ff7483
fix: resume explicit session-id agent runs 2026-04-04 17:48:43 +09:00
ximi 9e0cf17d0c fix(minimax): correct model pricing per official docs 2026-04-04 17:40:57 +09:00
Peter Steinberger 238fac6636 fix: cover status transcript fallback (#55041) (thanks @jjjojoj) 2026-04-04 17:38:44 +09:00
jjjojoj 97a8ba89fd fix: use transcript usage as fallback for /status token display
When using custom providers like LM Studio, Ollama, or DashScope,
token counts in /status show as 0 because the agent meta store
does not always have usage data populated for these providers.

Fix: set includeTranscriptUsage: true in both /status command and
the session_status tool. This enables the existing fallback path
that reads usage from the session transcript JSONL file when the
meta store has zero/missing token counts.

The merge logic already guards against overwriting valid data:
- totalTokens: only updated when zero or transcript value is larger
- inputTokens/outputTokens: only filled when zero/missing
- model/contextTokens: only filled when missing

Fixes #54995
2026-04-04 17:38:44 +09:00
Peter Steinberger b1e3e59429
fix(ci): align stale provider and channel tests 2026-04-04 09:35:14 +01:00
潘晓波0668000512 cca35404ea 修复:MiniMax coding_plan 将 interval/weekly usage_count 按剩余配额解析 2026-04-04 17:32:00 +09:00
陈大虾🦞 1ffbe09a6a fix(model): infer provider from allowlist for bare model IDs to prevent prefix drift (#48369) 2026-04-04 17:30:54 +09:00
xydt-610 1d8bba7e39 fix(media-understanding): auto-register image capability for config providers with image input (#51392) 2026-04-04 17:29:54 +09:00
Peter Steinberger f4855baf35
fix(ci): await async provider test registration 2026-04-04 09:28:43 +01:00
Peter Steinberger 73572e04c1 fix: preserve generic DashScope streaming usage (#52395) (thanks @IVY-AI-gif) 2026-04-04 17:25:33 +09:00
Vincent Koc cdccbf2c1c
fix(github-copilot): send IDE auth headers on runtime requests (#60755)
* Fix Copilot IDE auth headers

* fix(github-copilot): align tests and changelog

* fix(changelog): scope copilot replacement entry

---------

Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
2026-04-04 17:22:19 +09:00
Vincent Koc a50b838dc2 test(agents): annotate cache trace wrapper params 2026-04-04 17:20:23 +09:00
Vincent Koc 1a13c34f5b fix(agents): close cache boundary transport gaps 2026-04-04 17:20:23 +09:00
Peter Steinberger d1a4363783
fix(runtime): restore gateway watch on legacy state 2026-04-04 09:18:28 +01:00
Peter Steinberger 21ca006eca
fix(infra): restore approval account binding compatibility 2026-04-04 09:13:11 +01:00
Peter Steinberger af7c6f4c68 fix: harden kimi web search setup (#59356) (thanks @Innocent-children) 2026-04-04 17:11:47 +09:00