Commit Graph

4068 Commits

Author SHA1 Message Date
can1357 f1063cdfbb feat(catalog): added capability flags and thinking support for Claude Sonnet 5
- Added an `isAnthropicAdaptiveGenAtLeast` utility to classify adaptive-thinking Claude generations at or above a given version threshold.
- Enabled adaptive thinking display, sampling restrictions, and mid-conversation system message flags for Claude Sonnet 5+ models.
- Updated Bedrock and OpenRouter adaptive reasoning effort maps to support five-tier scales on Sonnet 5+ models.
2026-06-30 16:41:42 +02:00
can1357 6b7d7e6e7e feat(coding-agent): injected loop-guard redirect notices during thinking loop retries
- Added a hidden system notice prompt to instruct the model to break repetitive behaviors when a thinking or response loop is detected.
- Injected the redirect notice into the retried turn's context when resetting the active context after a loop retry.
- Added unit tests to verify the custom redirect message is appended, configured as non-displaying, and visible in subsequent LLM contexts.
2026-06-30 16:36:49 +02:00
can1357 f50caede0b test(coding-agent): added integration tests for STT submit trigger behaviors
- Added comprehensive integration tests verifying Speech-to-Text submit triggers in STTController under different configuration settings.
- Cleaned up unused imports and types from the stt-controller source file.
- Documented Speech-to-Text submit trigger updates and programmatic editor submission changes in package changelogs.
2026-06-30 16:25:34 +02:00
can1357 224000ea1a Merge remote-tracking branch 'origin/farm/bfaba2dc/fix-mcp-oauth-escape-cancel' 2026-06-30 16:18:39 +02:00
can1357 ca070bf09f Merge remote-tracking branch 'origin/farm/3b8dc673/guard-v8-setflags-on-bun' 2026-06-30 16:18:00 +02:00
can1357 168bdae5da feat(coding-agent): introduced automatic dictation submission triggers
- Added `stt.submitTrigger` setting to control automatic dictation submission.
- Introduced `evaluateSubmitTrigger` to process sentence punctuation and spoken cues.
- Integrated trigger evaluation into batch and streaming `STTController` pipelines.
- Implemented trailing word trimming to strip trigger words like "submit" before sending.
- Added comprehensive unit tests for all trigger evaluation behaviors.
2026-06-30 16:16:39 +02:00
can1357 6c1152647c refactor(coding-agent): renamed the quick_task subagent to sonic
- Renamed references to the `quick_task` subagent to `sonic` across docs, agent definitions, prompts, and test files.
- Updated the parallel file analysis tool to spawn `sonic` subagents instead of `quick_task`.
- Documented the breaking change in the changelog along with additions and removals of other built-in subagents.
2026-06-30 16:16:39 +02:00
can1357 2c75ee5d38 Merge remote-tracking branch 'origin/farm/bcae1c50/fix-mcp-oauth-port-fallback' 2026-06-30 16:15:56 +02:00
roboomp 0ef430a39f fix(debug): guarded v8.setFlagsFromString call so CPU profiler works on Bun
The CPU profiler called node:v8 setFlagsFromString("--allow-natives-syntax")
unconditionally and crashed on Bun (oven-sh/bun#1702), surfacing as
"Failed to start profiler: node:v8 setFlagsFromString is not yet
implemented in Bun". The flag is only needed for ad-hoc V8 natives such
as %GetOptimizationStatus, not for the CDP Profiler session that actually
collects samples — so swallow the error and let the inspector path run.

Added a Bun-runtime regression test that would have caught the crash:
without the guard, startCpuProfile() throws before returning a session.

Fixes #3897
2026-06-30 12:47:07 +00:00
roboomp 3106a15f7d fix(mcp): raced oauth login against cancellation
Esc and wizard abort signals now race the MCP OAuth login promise directly, so cancellation wins even before OAuthCallbackFlow reaches its callback wait and registers an abort listener. OAuthCallbackFlow also checks pre-aborted signals before opening/waiting on the callback server and its wait path handles already-aborted signals.

Threaded the abort signal into MCP OAuth fetches so dynamic client registration, metadata discovery, authorization probes, and token exchange unblock promptly when the user cancels.

Added a regression test where MCPOAuthFlow.login never observes ctrl.signal, matching the pre-wait race called out in review.

Fixes #3888
2026-06-30 10:21:26 +00:00
roboomp 6f65772093 fix(mcp/oauth): preserved random-port fallback for fresh dynamic-client-registration flows
PR review pointed out that the unconditional opt-out blocks the safe case: when no static `client_id` is set, `MCPOAuthFlow.#tryRegisterClient` does DCR with whichever loopback URI we actually bound, so the provider issues a `client_id` tied to the fallback port and the authorize request is accepted. First-install users whose default port 3000 is busy could no longer authenticate.

Gate `allowPortFallback` on `staticClientIdFromConfig(config) === undefined`: pinned client ids (config-supplied or embedded in the authorization URL) keep the strict-port behavior that fixes #3887; unresolved client ids fall back as before. Factored the static client-id resolution into a module-level helper so `MCPOAuthFlow.#resolveClientId` and `resolveCallbackOptions` share the same logic.

Added an oauth-flow.test.ts case that wires a mock registration endpoint + occupies the preferred port and asserts the fallback URI is what DCR registers and what the authorize request advertises. Tightened the existing strict-port test's title to call out the static-clientId trigger.
2026-06-30 10:13:38 +00:00
roboomp 4300f46039 style: bun run fix 2026-06-30 10:08:21 +00:00
roboomp a6b2bac882 fix(mcp): made Esc cancel /mcp reauth and /mcp add OAuth flow
#handleOAuthFlow now installs an editor.onEscape hook that aborts its
AbortController, and accepts an external abortSignal so the add-wizard
can thread its own controller through (the wizard owns focus and absorbs
Esc itself). Cancellation surfaces as MCPOAuthCancelledError, which the
reauth and add catches translate into a neutral status line instead of
the generic OAuth failure banner. Disambiguated from the existing 5-min
timeout via a userCancelled flag so timeouts still read as errors.

The wizard intercepts Esc/Ctrl+C while #oauthAbort is set so its own
"Press Esc to cancel" advertisement now matches the behaviour, and
renames its error heading + tip when the failure is a user cancel. Also
fixed the misleading "(Press Ctrl+C to cancel)" message in the chat
transcript onAuth block to say "Press Esc" — Ctrl+C is bound to the
editor clear action, not interrupt.

Fixes #3888
2026-06-30 10:07:05 +00:00
roboomp d2c767507b fix(mcp/oauth): failed fast when callback port is busy instead of advertising a random one
When the MCP OAuth callback server's preferred port (default 3000) was unavailable, `OAuthCallbackFlow.#startCallbackServer` silently bound a random port and forwarded the mismatched `redirect_uri` to the authorization server. Providers that validate redirect URIs against a registered callback (e.g. Atlassian) returned an opaque HTTP 500, leaving the local flow waiting for a callback that never arrived until the 5-minute timeout fired.

Added `OAuthCallbackFlowOptions.allowPortFallback` (default `true`, preserving every existing AI-provider flow) and threaded `allowPortFallback: false` through `MCPOAuthFlow`'s `resolveCallbackOptions`. With fallback disabled, login now throws a `ConfigurationError` that names the busy port and the remediation (free the port, or set `oauth.callbackPort`/`oauth.redirectUri` in `mcp.json`) before opening the browser. The existing `oauth.redirectUri`-strict path is reworded along the same lines so callers see one consistent message family.

Fixes #3887
2026-06-30 10:05:24 +00:00
can1357 2185ec147a Merge remote-tracking branch 'origin/farm/50987903/preserve-hashline-bom' 2026-06-30 11:40:23 +02:00
can1357 5b026d304f fix(coding-agent): recovered from auto-compaction dead-ends using shake elisions
- Added a last-resort recovery step to run `shake("elide")` on oversized message tails when auto-compaction cannot otherwise free enough context.
- Re-tests the context headroom and auto-continue predicates after a successful rescue before falling back to pausing maintenance.
- Updated the dead-end warning message to suggest running `/shake images` for irreducible, image-only tails.
2026-06-30 10:48:04 +02:00
can1357 dd8b2cfbd8 Merge remote-tracking branch 'origin/farm/f07fefbd/fix-tool-args-reveal-initial-frame' 2026-06-30 10:26:01 +02:00
roboomp 8297f1a313 style: bun run fix 2026-06-30 08:05:01 +00:00
roboomp 88be72e4d4 fix(coding-agent): seed tool-args reveal with the partial JSON already in hand
ToolArgsRevealController.setTarget initialized new entries with revealed=0, so the first message_update returned { __partialJson: "" } even when the provider had already parsed a complete chunk. For renderers without exposeRawPartialJson (e.g. write), the throttled re-parse + cached displayArgs short-circuited every subsequent setTarget, leaving the preview body blank until tool_execution_end.

Seed revealed with the full incoming partialJson length on entry creation (clamped to a surrogate-safe boundary). The first frame now carries the parsed path/content immediately; subsequent message_updates extend target and the reveal ticks pace only the newly arrived bytes — no field is ever truncated because the seeded prefix is the longest the entry has seen so far.

Fixes #3881
2026-06-30 08:04:49 +00:00
can1357 fc24a70f5e Merge branch 'farm/ad81bc64/retry-anthropic-internal-server-error'
fix(compaction): cap snapcompact frame payloads (#3866)

Bound rebuilt snapcompact image payloads by a per-request base64 byte
budget so long sessions stop re-sending multi-megabyte standing image
archives on every provider request; auto-compaction falls back to
context-full summaries when snapcompact output is too large.

Resolved snapcompact.ts conflict against the main font-rendering refactor
by keeping both renderabilityProbeText and the frame-budget helpers.
Fixed historyBlocks to emit the omitted-frame notice before the kept
(newer) images, since the byte budget drops the oldest frames — keeping
reconstructed blocks oldest-to-newest (addresses Codex P2 review).

Fixes #3792
2026-06-30 09:59:03 +02:00
can1357 324941914b Merge remote-tracking branch 'origin/farm/0e3e890a/fix-review-schema-violation-overall-correctness' 2026-06-30 09:51:01 +02:00
can1357 1fdd6886b4 Merge remote-tracking branch 'origin/farm/29ae960b/grep-json-array-paths' 2026-06-30 09:50:52 +02:00
can1357 92894a7b8f Merge remote-tracking branch 'origin/farm/aa90ede0/local-llm-stream-timeout-config' 2026-06-30 09:50:37 +02:00
can1357 dcc7a1ce2c feat(coding-agent/discovery): added Go syntax and API discovery rules
- Added eight new Go-specific rules to the discovery package.
- Registered the new Go rules in the default rule source index.
- Covered the new Go AST matching conditions with test cases in `builtin-defaults.test.ts`.
2026-06-30 09:49:59 +02:00
roboomp 00b3cd3f92 style: bun run fix 2026-06-30 07:07:58 +00:00
roboomp 2c8b723083 fix(coding-agent): forwarded stream timeout settings
Forwarded persisted provider stream timeout settings into model requests so slow local LLM streams can widen or disable first-event and idle watchdogs without environment variables.

Fixes #3878
2026-06-30 07:07:41 +00:00
roboomp 695c67f21d style: bun run fix 2026-06-30 06:33:02 +00:00
roboomp 7595c8c2a4 fix(tools): accepted json-array grep paths
Normalized string-encoded JSON arrays in grep/search path handling so direct execute paths match validated tool-call behavior.

Added regression coverage for direct GrepTool.execute paths supplied as a JSON-array-shaped string.

Fixes #3873
2026-06-30 06:32:43 +00:00
roboomp 03e6763f6c style: bun run fix 2026-06-30 06:20:16 +00:00
roboomp 4810f47db9 fix(yield): validate incremental sections per-label to prevent fatal schema_violation
The yield tool's per-call schema validator was skipped entirely for incremental
yields (`type: ["<label>"]`), so when a subagent emitted a non-conforming value
for a known section (e.g. DeepSeek-v4-pro returning "Correct"/"correct."/"approved"
for the reviewer's `overall_correctness` enum), the call succeeded locally and
the model got no retry feedback. The mismatch only surfaced post-mortem in
`finalizeSubprocessOutput` as a fatal `schema_violation` — the parent agent
lost the entire result, with no recourse for the subagent to fix it.

Build a per-label sub-validator map alongside the full-schema validator: each
entry validates one section's `data` against its top-level property's sub-schema
(items schema for array-typed labels like `findings`). The yield tool runs this
map for incremental yields and routes failures through the same MAX_SCHEMA_RETRIES
budget the terminal path uses, so the model sees up to three corrective retries
and the existing schema-override safety net accepts the value with
SUBAGENT_WARNING_SCHEMA_OVERRIDDEN after exhaustion. Unknown labels remain
unconstrained so scratchpad/streaming sections still pass.

Fixes #3870
2026-06-30 06:20:03 +00:00
roboomp 7ec00a5007 fix(edit): skipped notebook bom sniffing
Skipped binary BOM detection for notebook-backed hashline reads so virtual cell text is serialized without a leading U+FEFF marker.
2026-06-30 05:58:01 +00:00
roboomp dd4eb68b37 style: bun run fix 2026-06-30 05:52:02 +00:00
roboomp d1e412eeff Revert "style: bun run fix"
This reverts commit 45d2bf8641.
2026-06-30 05:51:53 +00:00
roboomp 39688620f8 fix(compaction): kept newest snapcompact frames
When legacy snapcompact archives exceed the per-request byte budget, retain frames from the newest end of the archived middle and restore oldest-to-newest order for the kept subset.
2026-06-30 05:50:12 +00:00
roboomp 45d2bf8641 style: bun run fix 2026-06-30 05:49:41 +00:00
roboomp d7c6472824 fix(edit): preserved hashline utf-8 bom
Added binary BOM detection to the hashline patcher and filesystem adapters so edits restore BOM bytes when text decoding hides U+FEFF.

Fixes #3867
2026-06-30 05:48:37 +00:00
roboomp 156dfd8467 fix(compaction): capped unknown-window snapcompact frames
Apply the snapcompact frame byte-budget cap even when the active model has no known context window, avoiding 80-frame archives on custom vision models.
2026-06-30 05:43:17 +00:00
roboomp 88308f105f fix(compaction): capped snapcompact frame payloads
Bounded persisted snapcompact image archives by base64 byte size so large sessions stop re-sending multi-megabyte frame walls on every provider request.

Auto snapcompact now falls back to context-full summaries when rendered frame payloads exceed the byte budget, and legacy oversized archives omit over-budget frames during LLM context rebuilds.

Fixes #3792
2026-06-30 05:36:14 +00:00
can1357 09061ed801 feat(coding-agent/web): aligned duckduckgo search requests with native browser behavior
- Updated the default browser User-Agent string to emulate a modern version of Chrome.
- Added typical browser headers to the outgoing fetch request, including Sec-Ch-Ua, Sec-Fetch flags, and Referer.
- Added a blank "b" parameter to the form body to match native DuckDuckGo HTML search behavior.
2026-06-30 07:02:12 +02:00
can1357 b704ac698a chore: update changelogs 2026-06-30 06:55:13 +02:00
can1357 38d40122f9 Merge remote-tracking branch 'origin/farm/8e0a06a8/fix-buffered-double-esc-and-task-end-loader' 2026-06-30 06:43:10 +02:00
roboomp c2d6c8cf18 fix(tui): deliver buffered double-Esc as two events and re-arm loader after task completion
StdinBuffer held a bare `\x1b\x1b` chunk and timer-flushed it as one
sequence. `parseKey("\x1b\x1b")` returns undefined, so CustomEditor
fell through to the base editor and never fired the configured `onEscape` —
the double-escape gesture and the second-press single-Esc handler both went
dead whenever the terminal batched the two presses into one stdin read.

Split an exact bare `\x1b\x1b` into two ESC events only after the
flush window proves no follower arrived. If a follower does arrive, emit the
first ESC and restart parsing at the second ESC so legacy Alt chords
(`\x1bd`, `\x1b\x7f`) remain one downstream keypress. Meta-CSI/SS3
chords (`\x1b\x1b[A`, `\x1b\x1bO…`) still emit as one combined
sequence.

EventController.tool_execution_update re-armed the working loader when a
transient overlay (auto-compaction / auto-retry / handoff) had torn it down
mid-tool; tool_execution_end did not. A subagent (`task`) call only fires
_end, so a task result landing after such an overlay left the UI looking
idle even though the session was still streaming. Mirror the reconciler
call in #handleToolExecutionEnd.

Fixes #3857
2026-06-30 04:30:42 +00:00
roboomp 7871591b4a fix(coding-agent): restored working loader after subagent ends inside overlay window
`tool_execution_end` for a long-running tool (`task` subagent, async bash
poll, …) is the next streaming event on the parent session when an inner
transient overlay (auto-snapcompact, auto-context-full, auto-retry) nulled the
working loader between the tool's start and end. The overlay-end handlers are
the only loader restorers keyed off the missing reference; if the subagent's
`tool_execution_end` lands while the overlay is still active (or its end
handler errored before re-arming), the spinner stays gone for the rest of the
parent turn even though the agent keeps streaming.

`#handleToolExecutionEnd` now calls `#ensureWorkingLoaderWhileStreaming()`
at the top, mirroring `tool_execution_update` so the working loader survives
a subagent completing inside the overlay window.

Refs #3858
2026-06-30 04:09:20 +00:00
roboomp 64734021a7 fix(tui): deliver buffered double-Esc as two events and re-arm loader after task completion
StdinBuffer held a bare `\x1b\x1b` chunk (or emitted it as one when followed by
a non-CSI byte). `parseKey("\x1b\x1b")` returns undefined, so CustomEditor
fell through to the base editor and never fired the configured `onEscape` —
the double-escape gesture and the second-press single-Esc handler both went
dead whenever the terminal batched the two presses into one stdin read.

Split a bare `\x1b\x1b` into two ESC events at the buffer layer, mirroring
the existing split for ESC + SGR mouse report. Meta-CSI/SS3 chords
(`\x1b\x1b[A`, `\x1b\x1bO…`) still emit as one combined sequence.

EventController.tool_execution_update re-armed the working loader when a
transient overlay (auto-compaction / auto-retry / handoff) had torn it down
mid-tool; tool_execution_end did not. A subagent (`task`) call only fires
_end, so a task result landing after such an overlay left the UI looking
idle even though the session was still streaming. Mirror the reconciler
call in #handleToolExecutionEnd.

Fixes #3857
2026-06-30 03:41:24 +00:00
can1357 d20e6c0829 feat: migrated service tier settings to a per-model-family architecture
- Migrated global service tier settings to a per-model-family architecture (OpenAI, Anthropic, Google).
- Implemented `ServiceTierByFamily` mapping to allow independent configuration and resolution per provider.
- Added automatic migration logic for legacy service tier and fast-mode application settings.
- Updated telemetry, session management, and task execution to support provider-specific tier resolution.
2026-06-30 04:14:48 +02:00
can1357 d4be774eb2 chore: update stale tests 2026-06-30 03:35:30 +02:00
can1357 5c382e6b7e fix(coding-agent): formatted and type-fixed tiny-model download test
Reflow biome wrap and replace delete on non-optional isTTY with
Reflect.deleteProperty in #3840's text-failure test.
2026-06-30 03:06:06 +02:00
can1357 8cd23ebd15 merge #3844: 3-way dirty-context fallback for isolated branch merges
# Conflicts:
#	packages/coding-agent/src/task/worktree.ts
#	packages/coding-agent/test/task/worktree.test.ts
2026-06-30 03:03:43 +02:00
can1357 9038488cb0 merge #3845: preserve agent commit history across isolated branch merges 2026-06-30 03:01:02 +02:00
can1357 ce20cfb68e merge #3829: align /extensions MCP status with /mcp list and persist re-enable 2026-06-30 03:01:01 +02:00