Commit Graph

11287 Commits

Author SHA1 Message Date
roboomp fe00a9f3c4 style: bun run fix 2026-06-28 21:13:05 +00:00
roboomp 9599689af3 fix(compaction): routed summary oneshots through provider cap
Compaction issued summarization HTTP requests via the default
`completeSimple` transport, bypassing
`wrapStreamFnWithProviderConcurrency` which was only wired into
`Agent.streamFn` / `sideStreamFn`. With the per-LLM-turn bracket
introduced in this PR, multiple ollama-cloud subagents that auto- or
manually compact could issue uncapped summary requests in parallel
and exceed `providers.ollama-cloud.maxConcurrency` (chatgpt-codex
review on #3751).

Added an optional `completeImpl` transport override to
`SummaryOptions` and `GenerateBranchSummaryOptions` and threaded it
into every `instrumentedCompleteSimple` call in compaction +
branch-summarization. Wired `AgentSession.#compactWithFallbackModel`
and the `generateBranchSummary` caller to route through
`#sideStreamFn` — the same limiter-wrapped transport the handoff path
already uses.

Pinned with a coding-agent regression that drives `compact()` end to
end against the wrapped sideStreamFn at maxConcurrency=1 and asserts
peak in-flight stays at 1 across a concurrent unrelated side request.

Fixes #3749
2026-06-28 21:11:48 +00:00
roboomp edaaec398c fix(task): routed side requests through provider cap
Passed the provider-capped stream wrapper into AgentSession side-channel requests so /btw, /omfg, IRC auto-replies, and handoff generation share the same per-provider concurrency limit as normal turns.

Added focused coverage for runEphemeralTurn and handoff generation using the configured side stream function.
2026-06-28 20:57:13 +00:00
roboomp febbc26f28 fix(task): scoped provider concurrency cap to each LLM turn
The per-provider semaphore (e.g. `providers.ollama-cloud.maxConcurrency`) was acquired before `SessionManager.open` and released only after `driveSessionToYield` returned, so it bracketed the whole subagent lifecycle. Any spawn tree wider than `maxConcurrency` deadlocked: parents held every slot while waiting for children that were queued on the same cap — symptoms matched zero LLM requests and tokens=0/requests=0 cancellations.

Moved the bracket into a `StreamFn` wrapper. The wrapper acquires the slot just before each provider HTTP request and releases it the moment the response stream produces 'done'/'error', so a parent's slot is free between turns and child subagents can acquire while their parent's tool calls run. Wraps both the main agent and the advisor (both consume `settingsAwareStreamFn`).

Fixes #3749
2026-06-28 20:36:40 +00:00
can1357 c178ceaea5 Merge remote-tracking branch 'origin/farm/a0906538/codex-context-overflow-recovery' 2026-06-28 21:51:25 +02:00
can1357 6e3d401239 Merge remote-tracking branch 'origin/farm/04d319fb/ctrl-q-follow-up-queue-sends-the-literal' 2026-06-28 21:51:22 +02:00
roboomp 9f79d09a8d fix(session): preserve overflow error when no recovery runs
Split active-context vs persisted-history removal in #checkCompaction so the persisted assistant error stays on the branch unless context promotion or compaction is actually scheduled.

Fixes #3747
2026-06-28 19:40:51 +00:00
roboomp dd57ee85bf fix(session): dropped recovered overflow error turns
Removed recoverable context-overflow and incomplete-response assistant errors from both active context and persisted session history before compaction/promotion schedules the retry.

Fixes #3747
2026-06-28 19:34:33 +00:00
can1357 7bbaebda24 chore: bump version to 16.2.4 2026-06-28 20:43:59 +02:00
can1357 4c3c2fc3e3 chore: update chanelogs 2026-06-28 20:43:32 +02:00
can1357 95748061e9 Merge remote-tracking branch 'origin/farm/4965ca44/fix-autolearn-cache-bust' 2026-06-28 20:42:17 +02:00
can1357 82a5ba5d47 fix(cross-cutting): caught and recover from utility panics
- Switch build profile to `panic = "unwind"` to allow catching panics in vendored uutils code.
- Add `run_caught` to wrap utility execution in `catch_unwind`, converting panics into non-zero exit codes.
- Update `pi-natives` to distinguish between recoverable utility panics and fatal process crashes, preventing recovered panics from appearing in user-facing crash reports.
2026-06-28 20:42:04 +02:00
can1357 6a39d4d3fc fix(vendor/uu-tail): prevented panic on broken pipe during bounded tail
- Propagated IO errors from the bounded tail internal logic to avoid panics.
- Updated `print_target_section` to return `io::Result` instead of unwrapping.
- Added a test case to verify that `BrokenPipe` is correctly surfaced when the consumer closes the pipe.
2026-06-28 20:37:36 +02:00
roboomp 45f60657d5 fix(agent): seeded startup learned memory snapshot
Use the pre-session memory prompt snapshot as the learned.md baseline when startup consolidation refreshes before a session-scoped cache exists. This keeps active-session learn writes out of the refreshed prompt while still surfacing the new consolidated summary.

Refs #3743
2026-06-28 18:35:01 +00:00
can1357 5f5007d49d Merge remote-tracking branch 'origin/farm/4965ca44/fix-autolearn-cache-bust' 2026-06-28 20:27:06 +02:00
roboomp d883e50c06 fix(agent): preserved learned snapshot during memory refresh
Refresh the startup consolidation summary without rereading learned.md for the active session, so lessons captured while startup is still running remain deferred to the next session.

Refs #3743
2026-06-28 18:27:06 +00:00
can1357 f5c3cd9268 Merge remote-tracking branch 'origin/farm/e24f4a34/collab-large-session-disconnect' 2026-06-28 20:27:00 +02:00
roboomp 261234cb22 fix(agent): invalidated memory prompt cache after consolidation
Background memory startup writes memory_summary.md after the initial system-prompt build has already cached an empty value for the session. Drop the cached snapshot before refreshBaseSystemPrompt so the active session actually picks up the freshly consolidated summary instead of returning the stale cached one.

Refs #3743
2026-06-28 18:18:57 +00:00
roboomp afcb198c5b fix(agent): kept autolearn memory prompts cache-stable
Stopped passive autolearn from adding hidden conversation messages and froze local memory developer instructions per session so learn writes land in future sessions instead of mutating the active Anthropic prompt prefix.

Fixes #3743
2026-06-28 18:10:57 +00:00
roboomp 378bc1aeca fix(collab): clip oversized arrays alongside strings in shrinkForReplication
Per #3740 review: many short strings (e.g. a tool result whose content array holds thousands of small text blocks) could sum past MAX_REPLICATED_PAYLOAD_BYTES without any individual field crossing the per-string floor, so the helper exited the truncation loop and shipped an oversized frame — the relay close/reconnect loop the helper was meant to prevent.

Replace the string-only truncation pass with a single walker that head-truncates strings AND head-clips arrays in one descent, driven by a concrete SHRINK_PASSES schedule that tightens both axes together. The final pass clamps every string to 64 B and every array to one element, so any payload converges. Add direct unit tests for shrinkForReplication covering: identity for small values, single-giant-string clamp, many-short-strings array clamp (no field above floor), and discriminator preservation on a fully-shrunk payload.
2026-06-28 17:18:10 +00:00
roboomp 0f3ee8d107 style: bun run fix 2026-06-28 17:11:28 +00:00
roboomp c577ffebdc fix(collab): cap replicated host frames so oversized entries do not loop the relay
CollabHost shipped the first entry of every snapshot-chunk batch unconditionally, and broadcast live entry/event frames verbatim, so a single multi-megabyte tool result (read/bash/search) overflowed the relay's per-frame maxPayloadLength. The relay closed the host's WebSocket with 1006 ("Received too big message"), CollabSocket treated 1006 as non-fatal and reconnected, the next guest hello triggered the same oversized send, and the host status line cycled "Collab relay connection lost, reconnecting…" indefinitely.

Add shrinkForReplication: any host->guest payload whose JSON exceeds MAX_REPLICATED_PAYLOAD_BYTES (1 MB) is deep-cloned with long strings head-truncated and an "[…N chars elided for collab session]" marker; otherwise the original reference passes through. Apply it to snapshot chunk entries, live entry broadcasts, and live event broadcasts (including large tool_execution_end results). Regression test stands up a Bun.serve relay with 8 MB maxPayloadLength and a snapshot containing a 5 MB entry; asserts the host stays connected, the snapshot train finalizes, and the guest sees the entry with the elision marker.

Fixes #3739
2026-06-28 17:10:41 +00:00
can1357 122ed689e4 chore: normalize changelogs after merge sweep 2026-06-28 18:55:49 +02:00
can1357 6dab2b3196 Merge PR #3604: fix stale todo HUD rows (@jeffscottward) 2026-06-28 18:55:26 +02:00
can1357 0ffe6c8e1f Merge PR #3675: keep moved sessions resumable (@riverpilot)
# Conflicts:
#	packages/coding-agent/src/modes/controllers/command-controller.ts
2026-06-28 18:46:19 +02:00
can1357 21ed419aeb fix(coding-agent): keep registry-qualified bun cache markers 2026-06-28 18:45:12 +02:00
can1357 1ca6213018 Merge PR #1716: prune stale bun update cache (@dragonbaba)
# Conflicts:
#	packages/coding-agent/test/update-cli.test.ts
2026-06-28 18:45:12 +02:00
roboomp 7c8b77deee style: bun run fix 2026-06-28 16:43:25 +00:00
roboomp 404a43e02b fix(coding-agent): expand paste markers in Ctrl+Q follow-ups
InputController.handleFollowUp read raw editor text via getText(),
bypassing the paste-store expansion the Enter path applies through
Editor.getExpandedText(). A large paste collapsed into a [Paste #N, +X
lines] marker was therefore sent verbatim to the model when queued with
Ctrl+Q / Ctrl+Enter, silently dropping the pasted content.

Switch the follow-up path to getExpandedText() so queued submissions
match the Enter path. Image markers are untouched; pendingImages
forwarding is unchanged.

Updated existing input-controller stubs (skill-queue, followup-image,
keybindings) to implement getExpandedText, matching the production
CustomEditor surface.

Fixes #3737
2026-06-28 16:42:39 +00:00
can1357 037c528e54 Merge PR #3350: increase Julia prelude test timeout to fix CI flake (@oldschoola)
# Conflicts:
#	packages/coding-agent/src/eval/__tests__/julia-prelude.test.ts
2026-06-28 18:41:29 +02:00
can1357 4e77d591a4 fix(ai): normalize Z.AI weekly quota window 2026-06-28 18:41:08 +02:00
Wolfgang Schoenberger 544013a24c fix(ai): preserve Z.AI usage quota windows 2026-06-28 18:41:07 +02:00
can1357 de9a1f79f9 fix-stats-large-jsonl-parse 2026-06-28 18:41:07 +02:00
can1357 e170bb1110 Merge PR #3694: recover completed tool calls after transient stream read errors (@cexll)
Includes evaluator cleanup removing unrelated stacked fixture churn.
2026-06-28 18:40:53 +02:00
can1357 40d64ce0c8 test(ai): clarify zero-limit contract name 2026-06-28 18:40:13 +02:00
can1357 9725f037de Merge PR #3326: contract tests for resolveUsedFraction (@oldschoola) 2026-06-28 18:40:13 +02:00
can1357 dab245a30a Merge PR #3678: show Antigravity weekly usage limits (@riverpilot) 2026-06-28 18:40:02 +02:00
can1357 0a1fac7347 test: drop unrelated fixture changes 2026-06-28 18:22:08 +02:00
can1357 19ac2813ec Revert "test(coding-agent): align fixtures with session title slot"
This reverts commit fdf85803fe.
2026-06-28 18:21:23 +02:00
Jeff Scott Ward 917d2834a3 fix: address todo reminder review feedback 2026-06-28 12:03:06 -04:00
can1357 2622ab13fe test(coding-agent/tools): removed invalid regex test cases
- Removed tests covering invalid regex patterns.
- Deleted the dedicated grep-invalid-regex test suite.
2026-06-28 17:46:10 +02:00
can1357 96be45c3bf chore: bump version to 16.2.3 2026-06-28 17:29:35 +02:00
can1357 b5544b3f19 feat(coding-agent): implemented path recovery for mismatched section tags
- Added `recoverSectionPathFromTag` to reconcile bare or mismatched `[basename#tag]` paths using existing session snapshots.
- Implemented `readSectionForPreview` to fallback to recovered file paths when the authored path is absent.
- Updated `computeHashlineSectionDiff` to use the path recovery logic during preview content acquisition.
- Removed obsolete regression test file `issue-1765-repro.test.ts`.
2026-06-28 17:28:53 +02:00
can1357 469046fbcb chore: implemented parallel execution for test scripts
- Added a worker pool mechanism to run independent test chunks concurrently in local environments.
- Introduced `OMP_TEST_CONCURRENCY` to allow manual control over parallel worker counts.
- Retained sequential, fail-fast execution for CI environments to ensure stability within memory-constrained runner jobs.
- Consolidated environment variable scrubbing into a shared helper function.
2026-06-28 17:23:31 +02:00
can1357 6d11f705e9 test(coding-agent): standardized temporary file path naming conventions
- Updated temporary directory prefixes to include an @ symbol in multiple test suites.
- Standardized file paths for temporary agent storage across test environments.
2026-06-28 17:23:16 +02:00
can1357 3e06557c2a feat(ai): enabled universal thinking tag healing for text streams
- Enabled the `ThinkingInbandScanner` by default for all text-based streaming patterns.
- Updated `StreamMarkupHealing` to pipe tool-call grammar outputs through the thinking healer to prevent leaking reasoning idioms into the visible text channel.
- Added suppression logic in the Ollama provider to prevent double-counting reasoning when a model produces both native structured thinking and leaked thinking tags.
- Added regression tests to ensure Gemini and other models correctly lift leaked thinking fences from the visible channel.
2026-06-28 17:22:44 +02:00
can1357 4534b8c80d fix(coding-agent/mcp): prevented unhandled promise rejections in sse transport
- Synchronously observed the response promise to prevent unhandled rejections during concurrent pending request failures.
2026-06-28 17:18:19 +02:00
can1357 8f6fbafe08 chore: added support for semantic version bumping
- Added logic to automatically calculate versions based on major, minor, or patch keywords.
- Updated the release script input validation to accept semantic bumps in addition to explicit version strings.
- Improved version parsing by adding radix parameters to integer conversion.
2026-06-28 17:17:18 +02:00
Jeff Scott Ward 9a9dc88f43 fix: address todo HUD review feedback 2026-06-28 11:16:30 -04:00
can1357 8185fdbfa9 feat(coding-agent): queued tool argument updates to prevent edit loss
- Implemented a queueing mechanism in `ToolExecutionComponent` to prevent starvation of edit previews during high-frequency argument updates.
- Replaced eager cancellation of in-flight diff computations with a drain loop that ensures every update is processed once the current compute settles.
- Added `partialJsonOf` helper to safely narrow streamed JSON buffers from tool arguments.
- Added regression test to verify that slow diff computations are not aborted by incoming stream chunks and instead queue a subsequent re-run.
2026-06-28 17:11:43 +02:00