Commit Graph

844 Commits

Author SHA1 Message Date
Mathews-Tom b95155423a Merge remote-tracking branch 'upstream/main' into feat/error-notify 2026-07-06 03:03:47 +05:30
can1357 3458b037ae chore: update tests 2026-07-05 16:53:07 +02:00
can1357 76e21e9364 test(eval): cover JS worker exits 2026-07-05 13:39:09 +02:00
can1357 caef81cf0b Merge PR #4409: docs(tool): document bash timeout clamp (@roboomp) 2026-07-05 13:10:27 +02:00
can1357 535e8256b0 fix(lsp): avoid watched-file side effects 2026-07-05 13:10:26 +02:00
can1357 9a319b8a89 Merge PR #4462: fix(lsp): notify servers about harness file writes (@roboomp) 2026-07-05 13:10:26 +02:00
can1357 661a8794ef Merge PR #4529: fix(tui): handle invalid path render args (@roboomp) 2026-07-05 13:03:06 +02:00
can1357 7101527e60 fix(providers): skip borrowed xai env after oauth fallback 2026-07-05 13:03:06 +02:00
can1357 942ca7ce06 Merge PR #4539: fix(providers): prefer xAI OAuth for web search (@roboomp) 2026-07-05 13:03:06 +02:00
can1357 1dcab092d3 Merge PR #4538: fix(providers): remove xAI web_search search_parameters (@roboomp) 2026-07-05 13:03:05 +02:00
roboomp 281a01a2a0 fix(tool): removed unused bash fixup wrapper
Deleted the coding-agent wrapper and tests for the stripTrailingHeadTail command rewrite now that BashTool executes pipelines as written.

Fixes #4562
2026-07-04 20:16:30 +00:00
roboomp 6a1ea9bf27 fix(tool): preserved bash pipeline output
Removed the bash tool execution-path rewrite that stripped trailing head/tail pipeline stages before running commands.

Added regression coverage for short-reading final pipeline stages.

Fixes #4562
2026-07-04 19:40:31 +00:00
roboomp 4654125023 fix(providers): avoided borrowed xai env for oauth web search
Tightened xAI web_search's xai-oauth preference so lower-priority xai-oauth api_key or fallback credentials do not get shadowed by the shared XAI_API_KEY fallback.

Added regression coverage for the stored xai-oauth API-key plus shared XAI_API_KEY case, preserving explicit xai runtime credential routing.

Refs #4536
2026-07-04 17:40:35 +00:00
roboomp b59a4050d2 fix(providers): gated xai oauth preference on dedicated credential
Restricted the xai-oauth preference in web_search to dedicated credentials (hasNonEnvCredential("xai-oauth") or XAI_OAUTH_TOKEN) so an XAI_API_KEY-only environment no longer routes an explicit xai runtime/config credential through the xai-oauth resolver.

Added regression tests covering the shared-env case and the xai-only availability check.

Refs #4536
2026-07-04 17:30:37 +00:00
roboomp fd9bf38ebd fix(providers): preferred xai oauth for web search
Fixed xAI web_search credential resolution to try xai-oauth before xai API-key auth.

Added regression coverage for xai-oauth-only availability and precedence.

Fixes #4536
2026-07-04 17:22:51 +00:00
roboomp 1e6782af13 fix(providers): removed xai web search parameters
- Stopped adding Responses Agent Tools-incompatible search_parameters to xAI web_search requests.
- Kept limit and numSearchResults enforcement as a local cap over parsed sources and citations.
- Added regression coverage for limit, numSearchResults, recency, and local cap request shapes.

Fixes #4537
2026-07-04 17:19:29 +00:00
roboomp 0b7f4865a7 fix(tui): handled invalid path render args
Validated path-like renderer inputs before calling path helpers so provider-supplied arrays or objects cannot crash TUI rendering before schema validation reports the bad tool call.

Added renderer regression coverage for read, write, and edit call/result components with array and object path arguments.

Fixes #4525
2026-07-04 15:47:52 +00:00
can1357 6b90d34924 Merge remote-tracking branch 'origin/farm/96461c96/fix-browser-cmux-pending-unhandled-rejection' 2026-07-04 11:27:29 +02:00
can1357 42fc4e6b0a refactor(agent): unified transcript block finalization logic
- Replaced commit-based stability checks with a unified `isTranscriptBlockFinalized` tracking mechanism.
- Removed deprecated provisional rendering configuration and flags across tool and renderer interfaces.
- Standardized native scrollback boundary logic to pin at the first unfinalized block using settled row verification.
- Updated and refactored test suites to validate block finalization and settled row boundaries instead of deprecated commit stability methods.
2026-07-04 11:22:05 +02:00
roboomp 8bd40a6db9 test(browser): restored cmux release mocks after each test
The cmux release regression tests install spies on CmuxSocketClient.prototype. Bun keeps those spies active across later browser-* files unless the file restores them explicitly, so browser-cmux-socket.test could stop exercising the real socket client depending on order.

Restore all Bun test mocks in afterEach after draining any test tabs, preserving mocked cleanup while preventing cross-file pollution.

Fixes #4499
2026-07-04 06:29:41 +00:00
roboomp a6a8258945 fix(browser): propagate cmux tab-close into the run body, not only the caller
Codex review of #4502 flagged that a bare `.catch(() => undefined)`
neutralizes the unhandledRejection but leaves the affected `runInTab`
call blocked inside `runCmuxCode` until timeout when the in-flight
code does not make another cmux socket request (e.g. `await
wait(60_000)`). `releaseTab` was signaling the run only by rejecting
an orphaned promise.

Wire the tab-close event all the way into the cmux run body:

- `PendingRun` gains a `closeAc: AbortController` that `releaseTab`
  aborts BEFORE calling `pending.reject`. `wait(...)` (via
  `waitForBrowserRun` -> `untilAborted`), in-flight cmux socket calls
  (via CmuxTab's `#request` -> `untilAborted`), and facade proxies
  (via `bindBrowserRunFacade`) all consume the composed signal, so
  the run body unwinds within a microtask instead of blocking to its
  own timeout.
- `runInTabWithSnapshot`'s cmux branch composes `closeAc.signal` into
  the run's signal (`AbortSignal.any([opts.signal, closeAc.signal])`)
  and now publishes `runCmuxCode(...)`'s outcome to the shared
  `promise` via `.then(resolve, reject)` and returns `await promise`.
  Both branches thus await the same promise, so `pending.reject`
  always has an attached handler (removing the original crash) AND
  the caller sees `Tab "..." was closed` immediately instead of
  waiting on the run's timeout.
- Drop the defensive `promise.catch(() => undefined)` — the promise
  is now actively consumed on both backends.

The new regression test adds a second case that exercises the
reviewer's exact scenario (`await wait(60_000);`) and asserts:
1. `pending.closeAc.signal.aborted` flips from `false` to `true`
   across `releaseTab`, with the tab-close error as its reason.
2. The awaited `runInTab(...)` rejects with `Tab "..." was closed`.
3. No `unhandledRejection` fires.

Verified locally by temporarily removing `closeAc.abort(...)` in
`releaseTab` — the new assertions fail; restoring it makes them pass.

Fixes #4499
2026-07-04 06:24:45 +00:00
roboomp 3622094e91 fix(browser): swallowed cmux tab-close rejection to prevent session crash
The cmux branch of `runInTabWithSnapshot` awaits `runCmuxCode(...)`
directly and never awaits/`.catch`es the `Promise.withResolvers()`
promise it stashes on `tab.pending`. When `releaseTab` walks pending
runs and calls `pending.reject(new ToolError("Tab ... was closed"))`
(a sibling subagent's `browser close --all`, session-scoped reap, etc.),
that orphaned promise had zero handlers and Bun surfaced the rejection
as `unhandledRejection`, which the CLI's top-level handler treats as
fatal — killing every other tab and subagent sharing the process, not
just the affected run.

Attach a no-op `.catch(() => undefined)` to the promise immediately
after creation. Inert for the worker branch (which still awaits the
same promise via `raceWithTimeout`, and attaching a second handler is
safe) and neutralizes the orphan on the cmux branch.

Adds a regression test that drives real `acquireBrowser` /
`acquireTab` / `runInTab` / `releaseTab` against a mocked
`CmuxSocketClient`, races `releaseTab` against an in-flight cmux run,
and asserts no `unhandledRejection` fires.

Fixes #4499
2026-07-04 06:06:18 +00:00
can1357 6f8e060419 Merge remote-tracking branch 'origin/farm/d78d878e/lsp-duplicate-edits' 2026-07-04 05:14:37 +02:00
can1357 98e450f0c4 Merge remote-tracking branch 'origin/farm/2dfff794/suppress-orphan-lsp-noise' 2026-07-04 05:13:55 +02:00
roboomp 2b8c8cadfb fix(read): kept raw artifact chunks verbatim and broadened path-only resolution
Skipped the workflow notice on raw selectors so bounded raw reads stay byte-for-byte, and taught resolveToolSearchScope to request pathOnly resolution so ast_grep/ast_edit scope-only calls no longer trip the inline-content cap on large artifacts.

Fixes #4482
2026-07-03 23:36:57 +00:00
roboomp 8d60e361eb fix(lsp): bounded watched-file notifications during writes
Watched-file notifications sent from the LSP writethrough now use the same bounded operation signal as sync/save notifications, so a stalled server cannot hang the write after disk commit.

Extended the freshness regression to assert a bounded signal reaches watched-file notification sends.

Refs #4459
2026-07-03 23:27:10 +00:00
roboomp 7497e68189 fix(read): shortened artifact paths in user-visible notices
shortenPath() the artifact.path leaked into the read-tool 'Artifact storage' and 'Unbounded raw read blocked' notices so $HOME never appears verbatim; details.resolvedPath keeps the absolute path for tooling.

Fixes #4482
2026-07-03 23:20:20 +00:00
roboomp a9bb4c7d59 fix(read): guarded large artifact raw reads
Resolved artifact:// reads to backing files before selector handling, streamed bounded reads, and blocked unbounded raw reads for large artifacts with recovery guidance.

Fixes #4482
2026-07-03 23:08:18 +00:00
roboomp 75fc4d65bb fix(lsp): notified servers about harness file writes
Announced harness-authored create, change, and delete operations to active LSP clients with workspace/didChangeWatchedFiles before edit-time diagnostics are read.

Added regression coverage for non-LSP sibling files in a batched write so diagnostics see the workspace state the harness just produced.

Fixes #4459
2026-07-03 15:48:48 +00:00
roboomp cf908b1727 fix(lsp): deduped identical replacement edits
Collapsed duplicate byte-identical non-empty LSP text edits before overlap validation so rename_file accepts idempotent server output while still rejecting real conflicts.

Fixes #4458
2026-07-03 15:40:21 +00:00
roboomp 712d4e423b docs(tool): documented bash timeout clamp
Documented the 1-3600 second bash timeout clamp in the schema, model-facing prompt, and tool docs, including the async timeout behavior.

Added coverage that the shipped schema and rendered prompt expose the contract.

Fixes #4408
2026-07-03 06:13:52 +00:00
roboomp 136bda2399 fix(lsp): suppressed orphan ts project diagnostics
Filtered TypeScript project-resolution diagnostics for files with no root marker ancestor while preserving syntax diagnostics. Added regression coverage for Bun scratch files outside project roots.\n\nFixes #4401
2026-07-03 05:54:49 +00:00
can1357 98338d0c55 Merge remote-tracking branch 'origin/farm/6f458e03/configurable-gemini-search-model' 2026-07-02 23:43:08 +02:00
can1357 b9ce7ef103 Merge remote-tracking branch 'origin/farm/b15f12c7/ssh-repaint-topology'
# Conflicts:
#	packages/coding-agent/src/tools/renderers.ts
2026-07-02 23:42:59 +02:00
can1357 e73a25489c feat(coding-agent/tools): migrated path input from array to semicolon-delimited string
- Changed the `path` property from an array of strings to a single semicolon-delimited string across tool definitions and tests.
- Updated validation error messages to reflect the new `path` input format.
- Adjusted all relevant test cases to provide path targets as semicolon-separated strings.
2026-07-02 17:48:46 +02:00
Mathews-Tom b7ce6050da fix(coding-agent): migrate stale multi-path tool tests to the path field
Upstream's grep/glob/ast_grep breaking change (replaced the paths array
input with a single semicolon-delimited path string) missed two test
files: multi-path-missing.test.ts and search-url-paths.test.ts. Both
still called tool.execute() with the removed paths array, which the
new schema silently ignores, so the tools fell back to scanning the
workspace root instead of the intended (and in several cases
external-URL) targets.

Migrate every call site to path, and adjust the one assertion whose
prior guarantee is no longer reachable: when every semicolon-joined
glob pattern is missing, the delimiter splitter cannot tell a literal
path from several missing globs (it requires at least one segment to
resolve before it will split), so the error now names only the first
pattern instead of all of them.
2026-07-02 19:20:02 +05:30
roboomp cc97fada73 fix(tui): repainted ssh topology flips
- Added renderer hooks for first-result placeholder replacement and partial-result settle repaints.\n- Enabled the hooks for SSH and covered the streamed-placeholder and settle seams.\n\nFixes #4314
2026-07-02 13:01:24 +00:00
roboomp 289ea08a39 fix(providers): made gemini search model configurable
Added providers.webSearchGeminiModel and GEMINI_SEARCH_MODEL so Gemini web_search requests use a selected grounding model while keeping gemini-2.5-flash as the fallback.

Covered OAuth, Developer API, and missing modelVersion fallback paths in Gemini web search tests.

Fixes #4312
2026-07-02 12:44:55 +00:00
can1357 95b91c7f73 feat(coding-agent/tools)!: replaced paths arrays with path strings
- Replaced `grep`, `glob`, and `ast_grep` `paths` inputs with optional single `path` strings while preserving default workspace-root behavior.
- Added shared `toPathList` normalization for legacy arrays and JSON-encoded arrays across tool execution and TUI renderers.
- Updated prompts, fixtures, shims, transcript summaries, and tests to send and display the new `path` argument.
- Updated collab-web search tool cards to read `path` while falling back to legacy `paths` for historical transcripts.
- Recorded the contiguous coding-agent changelog run for the tool-path breaking change and adjacent TTS entries.
2026-07-02 08:30:33 +02:00
can1357 51684b4b1d refactor(coding-agent): streamlined codebase by deduplicating helper logic and shims
- Consolidated duplicated inline thinking level comparisons into a unified `concreteThinkingLevel` helper.
- Enhanced legacy tool shims to respect isolated session settings and support legacy options.
- Cleaned up redundant UI render requests and extra status-line updates.
- Refactored `grep` tool shim to configure context dynamically via isolated settings.
- Disabled platform-incompatible shell shim tests on Windows environments.
2026-07-02 02:40:08 +02:00
can1357 978b950804 fix(coding-agent): resolved path resolution and fetch errors for fuzzy urls
- Fixed grep and ast-grep tools rejecting fuzzy url-shaped paths like schemeless www. or collapsed-scheme spellings.
- Applied the extra-CA wrapper to the model registry default fetch to respect the NODE_EXTRA_CA_CERTS environment variable.
- Moved isReadableUrlPath utility to path-utils to share recognition logic between reading and searching pipelines.
- Implemented a fallback that checks if a directory matching a fuzzy URL path exists locally before resolving it as an external URL.
- Added explicit errors for unsupported URL schemes to replace misleading local-path errors.
2026-07-02 01:51:09 +02:00
can1357 efbdb23581 fix(coding-agent): enabled closed union validation for yield labels
- Extends output schema validation to support `oneOf` and `anyOf` closed union schemas.
- Prevents unknown section label submissions when all union variants constraint allowed properties.
- Permits arbitrary yield labels when at least one union variant remains open.
- Supports JTD discriminator output schemas by treating union constraints disjunctively.
2026-07-02 01:51:09 +02:00
can1357 0823892295 fix(coding-agent): repaired type errors from merge sweep
- Restored CustomInputRow.priority field dropped in 3b80dc01d ask row budgeting.
- Narrowed dereferenced schema properties via isRecord in yield-assembly and output-schema-validator instead of untyped object access.
- Renamed stale advisorReadOnlyTools to advisorTools in advisor parity test.
- Narrowed AgentMessage content access in session-loader-stream test.
- Reformatted browser-schema test to satisfy biome.
2026-07-01 23:49:32 +02:00
can1357 1b3bcb98db refactor(coding-agent/tools): consolidated browser tool schemas into a single schema
- Consolidated `browserOpenSchema`, `browserCloseSchema`, and `browserRunSchema` into a single `browserSchema`.
- Simplified the `action` type definition to accept `'open' | 'close' | 'run'`.
- Updated schema validation tests to reflect the unified schema definition.
2026-07-01 23:18:17 +02:00
ben 510ed57712 fix(coding-agent): harden local ci isolation review fixes 2026-07-01 22:25:04 +02:00
can1357 021d4fc1e3 Merge PR #4161: fix(agent): interrupt waits for IRC delivery (@roboomp) 2026-07-01 21:53:19 +02:00
can1357 c982cb34e9 Merge PR #3987: fix(eval): keep agent progress commit-unstable while partial (@metaphorics) 2026-07-01 21:50:55 +02:00
can1357 aee8b091ee fix(agent): honor closed schema label edge cases 2026-07-01 21:50:54 +02:00
can1357 88e3e77f3e Merge PR #3927: fix(agent): reject stale yield labels for override schemas (@roboomp) 2026-07-01 21:50:54 +02:00
can1357 52003878b5 Merge PR #3865: fix(web-search): clarify DuckDuckGo bot detection failures (@roboomp) 2026-07-01 21:47:55 +02:00