Commit Graph

6271 Commits

Author SHA1 Message Date
can1357 5d7b208a3e fix(coding-agent): enabled workspace-external file access using absolute paths
- Adjusted hashline header formatting to preserve absolute file paths instead of truncating them to basenames.
- Ensured absolute paths are passed through shortenPath to allow resolution while keeping home directory references concise.
- Prevented edit failures when reading files outside the workspace by ensuring tags remain resolvable.
2026-06-28 22:50:31 +02:00
can1357 a8dc036c84 feat(coding-agent): corrected payload assembly logic for terminal results
- Refactored payload assembly to distinguish between incremental sections and terminal results.
- Prevented terminal markers from being incorrectly treated as section labels to avoid payload nesting issues.
- Updated section processing to ignore non-incremental terminal items, resolving incorrectly missing data in output-schema validation.
- Improved terminal item resolution to correctly fallback to the last assistant text when no explicit data is provided.
2026-06-28 22:50:31 +02:00
can1357 4db3d68bdb feat(coding-agent): implemented git worktree detection and rendering
- Added `git.repo.linkedWorktreeSync` to identify and resolve git worktree metadata without spawning subprocesses.
- Updated `StatusLineComponent` to detect linked worktrees and resolve project/worktree context names.
- Modified path segment rendering to collapse nested git worktree paths and display the worktree name when it diverges from the active branch.
- Introduced `icon.worktree` symbol across themes to visually distinguish git worktree paths.
2026-06-28 22:50:30 +02:00
can1357 542fd65d70 Merge remote-tracking branch 'origin/farm/a0906538/codex-context-overflow-recovery' 2026-06-28 22:00:15 +02: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 d51b9693d3 style: bun run fix 2026-06-28 19:51:17 +00:00
roboomp 4394184331 fix(session): restore overflow turn when compaction skips
Drop the persisted assistant error before #runAutoCompaction so the kept region is clean, then re-append it on COMPACTION_CHECK_NONE without a fresh compaction entry — covers no-model, hook-cancel, and compaction-error paths. Same rollback for response.incomplete recovery.

Fixes #3747
2026-06-28 19:51:12 +00: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 95748061e9 Merge remote-tracking branch 'origin/farm/4965ca44/fix-autolearn-cache-bust' 2026-06-28 20:42:17 +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 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 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 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
Jeff Scott Ward 917d2834a3 fix: address todo reminder review feedback 2026-06-28 12:03:06 -04: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 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
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
Jeff Scott Ward 54f83e794e fix: preserve subagent hint API 2026-06-28 11:09:17 -04:00
Jeff Scott Ward 44ca363be0 fix: keep goal todos in context 2026-06-28 11:09:17 -04:00
Jeff Scott Ward dd917046d8 fix: anchor todo reminder HUD 2026-06-28 11:09:16 -04:00
can1357 42981154fb feat(coding-agent): deduplicated thinking signatures during persistence
- Implement cleanup logic to drop `thinkingSignature` values from assistant thinking blocks during persistence.
- Identify and drop signatures only when the underlying reasoning data is already recoverable via the `providerPayload` items.
- Ensure orphaned signatures that cannot be reconstructed from the payload are preserved during serialization.
- Add comprehensive test coverage to verify deduplication safety and edge-case handling for missing payloads.
2026-06-28 17:01:04 +02:00
can1357 4c88a6b680 feat(coding-agent): removed history URI being advertised
- Removed support for `history://` URI schemes used to read agent transcripts from system and tool prompts.
- Updated IRC tool instructions to remove references to reading agent history for peer information.
2026-06-28 16:54:37 +02:00
can1357 93f68b75a2 test(coding-agent/modes): updated controller test mocks
- Added missing `noteDisplayableThinkingContent` mock function to test fixtures.
- Included `markActivityStart` and `markActivityEnd` methods in status line mocks to match updated controller interfaces.
2026-06-28 16:53:16 +02:00
can1357 5056dc57db Merge remote-tracking branch 'origin/farm/f4bf8adf/lazy-extension-headers' 2026-06-28 16:10:08 +02:00
can1357 22d629cd7a Merge remote-tracking branch 'origin/farm/4bbbd940/ssh-transfer-shell-probe' 2026-06-28 16:10:04 +02:00
can1357 008b0bac2d Merge remote-tracking branch 'origin/farm/cff0327f/ssh-pending-preview-scrollback' 2026-06-28 16:08:13 +02:00
can1357 0501addbd2 feat(coding-agent): allowed advisors to use mutating tools
- Removed the architectural restriction limiting advisors to read-only tools.
- Updated advisor configuration to permit any built-in tool, including `edit`, `write`, and `bash`.
- Defaulted advisor toolsets to `read`, `grep`, and `glob`, while maintaining strict session isolation for each advisor.
2026-06-28 16:07:46 +02:00
roboomp 7d01f539d9 style: bun run fix 2026-06-28 14:00:45 +00:00
roboomp 1b9cd7d787 fix(providers): kept runtime headers live
Preserved extension-registered provider and model header objects so request-time reads observe later mutations instead of registration-time snapshots.

Fixes #3725
2026-06-28 13:59:42 +00:00
roboomp f16d618ca2 fix(ssh): recover transferShell when host marker probe fails
When csh/tcsh aborts the initial host-info marker probe before emitting
PI_HOST_PROBE=, the previous fallback returned os/shell unknown without
ever checking whether sh -lc still worked. That kept ssh:// rejecting a
POSIX-capable host (P2 from PR #3722 review).

The marker-missing fallback now runs probeTransferShell before returning.
If sh/bash/zsh round-trips the transfer marker, the fallback carries
transferShell and derives os from that probe's uname -s output. Windows
compat unames (MINGW/MSYS/Cygwin/Windows) still classify as windows so
ssh:// keeps refusing Windows hosts.

Added osFromUname coverage for Linux, GNU/Linux, Darwin, Windows compat
unames, and unknown payloads.
2026-06-28 12:01:49 +00:00
roboomp 7b937104bd fix(ssh): scan stderr for the transfer-shell marker too
The host-info probe already recovers its marker from stderr (some
remotes have dotfiles that swap fd 1/2), but `probeTransferShell` only
scanned `probe.stdout`. That left `transferShell` unset on those
hosts and made `ssh://` refuse a POSIX-capable remote (P2 from PR
#3722 review).

Extracted the both-streams scan into `findProbeMarker(stdout, stderr,
marker)` and routed the transfer probe through it: stdout first,
stderr as the rescue. Same recovery contract as the host probe.

`TRANSFER_PROBE_MARKER` exported alongside `findProbeMarker` so the
recovery branch is unit-testable without touching disk.

Tests: covers stdout-only, stderr-only, both-streams-prefer-stdout,
and neither-stream.
2026-06-28 11:57:49 +00:00
roboomp 207734e915 fix(ssh): dispatch transfer snippets through verified transferShell
The previous fix gated on a verified `transferShell` but still let
OpenSSH hand the snippet to whatever `$SHELL` happens to be on the
remote. On a fish/csh/tcsh host the new gate would accept the host,
then fail anyway because the login shell can't parse `if [ ... ]; then
...` (P1 from PR #3722 review).

Each transfer command (read, write, stat, list) is now wrapped in
`<transferShell> -c '...'` via a shared `wrapInPosixShell` helper, so
the snippet is parsed by the same shell OMP's capability probe verified
can run it. `ensurePosixRemote` returns the verified shell so each
call site can do the wrap. `ssh-executor.ts`'s identical Windows-compat
helper is consolidated onto the same primitive (`buildCompatCommand` /
`quoteForCompatShell` removed).

Stays POSIX-clean across all four call sites; `-c` (not `-lc`) since
the snippets only call absolute builtins and don't need login-profile
setup. Capability *probing* still uses `-lc` to mirror the user env.

Test additions: one case asserts every dispatch starts with
`bash -c '...'` and embeds the original POSIX snippet (read/write/stat/list)
when transferShell is bash and login shell is unknown; another covers
the `sh -c` happy path.
2026-06-28 11:52:44 +00:00
roboomp c4ed1614eb fix(ssh): gate ssh:// transfers on verified POSIX shell capability
Replace the login-shell-name allowlist in `ensurePosixRemote` with a
capability check against a newly probed `transferShell`. The host probe
runs `sh -lc` / `bash -lc` / `zsh -lc` against the remote and records
the first candidate whose printf marker round-trips; `uname -s` from the
same probe also refines the OS classification when the first probe could
not resolve it.

Three compounding problems fixed:

- The host probe parsed only the first stdout line, so login-shell
  banners or any startup noise would land ahead of the payload and
  classify the host as `shell: "unknown"`. The probe now frames its
  payload with a `PI_HOST_PROBE=` marker (see `extractProbePayload`)
  and scans both streams for the marker line.
- `shouldRefreshHostInfo` did not treat `{os: "linux", shell: "unknown"}`
  as stale, so a single bad classification stuck and kept failing
  later `ssh://` operations. It now refreshes any non-Windows cache
  entry without a verified `transferShell`.
- The transfer guard refused the host on the self-reported login-shell
  name. It now gates on `info.transferShell`, which is the shell OMP
  actually verified can run `head`/`cat`/`mv`/`test`/`ls`. The
  refusal message names the capability we couldn't confirm.

`HOST_INFO_VERSION` bumped 3 → 4 so existing caches re-probe and pick
up `transferShell`. `parseHostInfo` exported so the cache round-trip
of `transferShell` is testable without touching disk.

Fixes #3719
2026-06-28 11:45:25 +00:00
can1357 fbad280b57 feat: implemented multi-advisor concurrent runtime with tui management
- Introduced comprehensive support for multiple concurrent, independently-configured advisors via `WATCHDOG.yml` files.
- Implemented a full-screen TUI overlay for managing advisor rosters, models, tools, and instructions.
- Added session-wide advisor initialization, telemetry aggregation, and named transcript isolation.
- Enhanced advisor security and observability with secret redaction in tool results and secure XML attribute encoding.
2026-06-28 12:55:09 +02:00
roboomp 2024821d67 fix(ssh): pinned expanded pending preview commit-unstable
The SSH renderer previously declared 'provisionalPendingPreview: "collapsed"',
which only opted the COLLAPSED pending shape out of the transcript's
stable-prefix ratchet. Once the user expanded an in-flight SSH preview (ctrl+o)
and the framed block outgrew the viewport, the pending rows became
ratchet-eligible and committed to native scrollback before the result render
inserted the 'Output' section. The settled render then re-anchored the frame,
producing two distinct stranded shapes in history:

- a stale 'pending SSH: [host]' header pinned above the final '<- SSH: [host]'
  frame (header variant), and
- the pending bottom border row reused in-place as the new 'Output' separator,
  with a fresh '...' footer pushed below it (footer variant).

Flip 'provisionalPendingPreview' to 'true' so every pending shape — collapsed
or expanded — is treated as provisional and stays out of native scrollback
until the result render commits a settled frame. The 'collapsed'-only opt-out
remains correct for renderers (bash, eval) whose expanded pending preview is
top-anchored and survives the result render without re-anchoring.

Added two contract tests asserting expanded pending SSH is commit-unstable
and that bash/eval expanded pending preview is still commit-stable — keeping
the opt-in renderer-scoped.

Fixes #3714
2026-06-28 10:40:18 +00:00
can1357 6061c3278b Merge remote-tracking branch 'origin/farm/efa85bd2/fix-mcp-legacy-sse' 2026-06-28 10:02:18 +02:00
can1357 4373dde48a Merge remote-tracking branch 'origin/farm/efa85bd2/fix-mcp-legacy-sse' 2026-06-28 09:59:43 +02:00