Commit Graph

7867 Commits

Author SHA1 Message Date
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
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 ec2551b60e test(coding-agent): extended event controller test fixture
- Added a mock function for noteDisplayableThinkingContent to the test fixture.
2026-06-28 16:14:15 +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
roboomp fca640d159 fix(mcp): made legacy sse drops retriable
Changed legacy SSE pending requests to reject with a transport-closed error when the persistent stream ends, preserving MCP tool reconnect-and-retry behavior.

Fixes #3710
2026-06-28 07:59:02 +00:00
roboomp 49b8401413 fix(mcp): constrained legacy sse endpoints
Rejected legacy SSE endpoint events whose resolved URL uses a different origin than the configured SSE URL, preventing configured headers from being posted cross-origin.

Fixes #3710
2026-06-28 07:56:06 +00:00
can1357 51a2a0342f test(coding-agent): implemented guest reconciliation and expanded testing for collaboration
- Introduced guest snapshot reconciliation to maintain host state consistency during session switching.
- Improved yield tool reliability by implementing incremental schema validation and strict parameter enforcement.
- Fixed a calculation edge case in the status line to prevent negative time values during activity tracking.
- Expanded the test suite with new validation for session interruption, collab state synchronization, and process error handling.
2026-06-28 09:52:44 +02:00
can1357 1190aade82 test(agent): strengthened consistency and persistence logic in integration tests
- Added regression test in `remote-compaction` to verify that concurrent v2 compaction preparation correctly reuses preserved history and avoids redundant re-expansion.
- Added mock-backend verification in `session-storage` to ensure that failed atomic title updates do not rollback newer optimistic state.
- Updated `sql-session-storage` expectations to account for the preserved fixed-width title slot header in session files.
- Expanded `remote-compaction` fetch header validation to include `x-client-request-id` assertion.
2026-06-28 09:52:44 +02:00
can1357 9c1b55dbec feat(coding-agent): centralized and atomized session title persistence
- Introduced normalization for title overrides to handle empty strings as null.
- Enabled atomic persistence for session title updates via `SessionManager`.
- Implemented conditional storage index restoration for failed title updates.
- Moved title persistence logic to a dedicated helper method to ensure consistency.
2026-06-28 09:52:44 +02:00
can1357 267926c8f7 feat(agent): enabled image attachments and draft restoration for skill commands
- Updated invokeSkillCommand to accept image and link attachments.
- Added draft restoration logic to preserve input state if command dispatch fails.
- Modified invocation path to pass image data to invokeSkillCommandFromText for processing.
- Refactored command dispatch flow to handle errors by restoring the user's composer draft.
2026-06-28 09:52:44 +02:00
can1357 2275daebaf feat(agent): prevented premature exit during extension lifecycle
- Added `process.reallyExit` to the hard-exit API patch in `withExitGuard` to prevent bypass.
- Integrated `withExitGuard` wrapper into extension and hook factory invocation sites.
- Improved `ExtensionExitError` to provide dynamic reporting of the intercepted exit method.
2026-06-28 09:52:44 +02:00
can1357 08e1ea7275 feat(agent): strengthened v2 stream integrity and replay logic
- Implement provider-native replay logic to enable reuse of remote compaction data across compatible models.
- Enhance compaction logic to re-expand and locally summarize remote history when provider-native replay is unavailable.
- Update OpenAI request setup to include session and routing identifiers for improved traceability.
- Refine token estimation for image content during truncation to ensure more accurate budget management.
- Update agent-session to resolve compaction model candidates before persistence, ensuring authentication availability.
2026-06-28 09:52:44 +02:00
roboomp 7bab084d78 fix(mcp): supported legacy sse transport
Added the MCP protocol 2024-11-05 HTTP+SSE transport so type:"sse" opens the endpoint stream, posts JSON-RPC to the announced endpoint, and correlates streamed responses.

Fixes #3710
2026-06-28 07:48:40 +00:00
can1357 77e57f8364 Merge remote-tracking branch 'origin/farm/dba8679d/fix-alt-m-default-context-gate' 2026-06-28 09:29:47 +02:00
roboomp f82086f805 refactor(coding-agent): moved Alt+M context gate into setModel
Replaced the controller-side switchActiveModel flag with a currentContextTokens hint on AgentSession.setModel, so the over-context decision is computed against the refreshed candidate metadata. setModel returns whether the live switch happened, and the Alt+M default-role path uses that to gate the live side effects.
2026-06-28 07:13:03 +00:00
can1357 2cf28f972e feat(coding-agent): added logic to assembleYieldResult to
- Added logic to `assembleYieldResult` to automatically accumulate incremental yields into arrays for schema-identified array properties.
- Updated `YieldTool` to bypass schema validation for incremental stream yields, allowing partial data emissions that don't satisfy the full output schema yet.
- Enhanced `YieldTool` parameter declaration to remove blocking top-level JSON schema combinators, ensuring compatibility with strict-mode providers (OpenAI/Codex).
- Updated `parseYieldType` to gracefully handle `null` type values emitted by strict providers for untyped final yields.
- Added regression tests for array-valued findings alignment and strict-mode tool schema compatibility.
2026-06-28 09:05:37 +02:00
roboomp 3765d80cbc fix(coding-agent): fixed alt-m default over context
Decoupled default-role persistence from live model switching when the selected model is below the current session context window.

Updated the model selector regression coverage so the Alt+M Default action remains selectable and advances to thinking selection.

Fixes #3708
2026-06-28 07:04:31 +00:00
can1357 da07a3ac5f feat(coding-agent/session): preserved signed thinking blocks during demotion
- Updated the demotion logic to treat complete, signed thinking blocks as stable content that terminates an interrupted stream.
- Protected signed thinking runs from being stripped when processing interrupted agent messages.
2026-06-28 08:26:36 +02:00
can1357 670d60fa60 feat(tui): added file-path completion support to autocomplete provider
- Added `getForceFileSuggestions` and `shouldTriggerFileCompletion` to `AutocompleteProvider` interface.
- Updated `Editor` to invoke file completion logic dynamically when providers support it.
- Corrected log viewer scroll offset calculation to account for viewport height.
- Added comprehensive unit test for log row selection and expansion.
2026-06-28 08:25:32 +02:00
can1357 2fd5fd55f2 release(docs): updated package changelogs
- Add V2 streaming remote compaction support across agent and catalog packages.
- Implement improved debug log viewers, idle recap generation, and citation marker unwrapping in the coding-agent.
- Enable D-Bus desktop notification fallbacks for Linux terminals and resolve numerous UI and session management issues.
2026-06-28 08:22:23 +02:00
can1357 5fbe887697 feat(coding-agent/debug): added mouse support to log and SSE viewers
- Implemented mouse wheel scrolling and click interaction for log entries.
- Added cursor navigation and expansion toggling via click in the log viewer.
- Updated help text to reflect available mouse controls.
2026-06-28 08:20:28 +02:00
can1357 512c8c5ce7 feat(coding-agent/session): updated convertToLlm to detect and strip
- Updated `convertToLlm` to detect and strip trailing thinking runs from user-interrupted assistant messages.
- Retained original thinking content on the persisted assistant message to ensure UI state (render, reload, and rebuild) remains intact.
- Added `followedByInterruptedThinking` helper to verify continuity message presence before stripping for the provider request.
- Updated persistence tests to confirm thinking remains in the session state but is excluded from LLM context headers.
2026-06-28 08:19:01 +02:00
can1357 da12bf418a feat(coding-agent/debug): migrated debug viewers to overlay rendering
- Migrated `DebugLogViewerComponent` and `RawSseViewerComponent` to use overlay rendering for improved visibility.
- Replaced custom frame drawing logic with standardized `overlay-box` components.
- Enhanced UI headers and footers with updated color coding and controls information.
- Updated `DebugSelectorComponent` to manage viewer lifecycle via overlay handles rather than editor container clearing.
2026-06-28 08:18:52 +02:00
can1357 96a1aed196 feat(coding-agent/modes): replaced static idle recap with LLM-generated summary
- Replace the static "Goal/Next" status line with an ephemeral LLM-generated summary triggered after idle periods.
- Hook the recap into the agent's side-channel pipeline, using live goal and task state as context anchors for meaningful recaps.
- Implement abort logic so that active user interactions immediately cancel pending recaps and discard late-arriving responses.
2026-06-28 08:15:24 +02:00
can1357 b299a59f88 feat(coding-agent/prompts): updated interrupted thinking system notice
- Refined the language used in the interrupted thinking system notice.
- Simplified the internal guidance for handling preserved reasoning.
2026-06-28 08:10:56 +02:00
can1357 1852329c8c feat(coding-agent): added compact status line thinking level setting
- Added `statusLine.compactThinkingLevel` setting to render the thinking level as a leading icon.
- Replaced the verbose ` · <level>` suffix with a single glyph when compact mode is enabled.
- Updated the status line controller and component to resolve and propagate the new configuration.
2026-06-28 08:04:55 +02:00
can1357 9437896d8a chore: normalize merged changelog headings 2026-06-28 08:00:45 +02:00
can1357 dac6e4976c test(coding-agent): locate session entry past title slot in handoff test 2026-06-28 07:56:37 +02:00
can1357 da528b22cd merge #3661: fall back from auto-snapcompact on local blockers 2026-06-28 07:52:49 +02:00
can1357 61474abbee test(coding-agent): stub markActivity on error-banner statusLine mock 2026-06-28 07:52:36 +02:00
can1357 2592b9dfe3 merge #3684: track active processing time for time_spent segment
# Conflicts:
#	packages/coding-agent/src/modes/controllers/event-controller.ts
2026-06-28 07:52:36 +02:00
can1357 5cdbf67cf3 fix focused stream preservation on rebuild 2026-06-28 07:49:55 +02:00
can1357 a3f4abd777 merge #3658: preserve in-flight assistant turn across /shake rebuilds 2026-06-28 07:49:49 +02:00
can1357 00f6468e9b merge #3672: allow thinking toggle after streamed reasoning 2026-06-28 07:49:41 +02:00
can1357 443195a81f merge #3700: preserve queued skill invocations during compaction
# Conflicts:
#	packages/coding-agent/src/session/messages.ts
#	packages/coding-agent/test/session-messages.test.ts
2026-06-28 07:49:33 +02:00