Commit Graph

7851 Commits

Author SHA1 Message Date
can1357 c655db4e3c fix(session): added #prunedTerminalRefusal field to store the
- Added `#prunedTerminalRefusal` field to store the pruned refusal for post-settle consumers.
- Modified `getLastAssistantMessage()` to return the pruned refusal before active-context lookup.
- Reset `#prunedTerminalRefusal` on `agent_start` so a fresh run supersedes the settled refusal.
- Updated test mock helpers to include `getLastAssistantMessage` for consistency.
2026-07-18 17:51:48 +02:00
can1357 127cca511a refactor(modes): removed scrollback compaction from TranscriptContainer
- Removed `#compactedChildStart` state, `compactable` segment field, and `#compactCommittedPrefix()` method, stopping the local-frame pruning of committed finalized rows.
- Post-finalize mutations now surface on every render via version tracking, instead of requiring a destructive replay to rehydrate the compacted block.
- Changed `print-mode.ts` to use `session.getLastAssistantMessage()` instead of array tail read, fixing access to terminal assistant messages after compaction removal.
2026-07-18 17:51:45 +02:00
Can Bölük e44ecdc699 Merge pull request #4843 from iacore/mnemopi
fix(mnemopi): lighter dispose consolidation so /quit returns quickly
2026-07-18 06:27:08 +02:00
can1357 f6a11c1bd1 Merge remote-tracking branch 'origin/farm/c26c6f43/flatten-transcript-compose-after-commit' 2026-07-18 06:24:37 +02:00
can1357 c8e166d5fe Merge branch 'farm/af10fef0/fix-task-boolean-schema' 2026-07-18 06:23:47 +02:00
can1357 7e77e44ea8 Merge remote-tracking branch 'origin/farm/a11d37e8/session-load-blob-ref-precheck' 2026-07-18 06:21:44 +02:00
can1357 ef02c0a9c3 Merge remote-tracking branch 'origin/farm/ce83ac1f/fix-stt-static-ffmpeg-linux-capture' 2026-07-18 06:20:55 +02:00
roboomp 83bfb6dbd8 fix(task): avoided boolean output subschemas
Represent task output schema inputs as explicit JSON-compatible types so ArkType emits object-form subschemas accepted by llama.cpp grammar generation.

Fixes #5957
2026-07-18 04:11:26 +00:00
iacore cd98f6a610 Merge remote-tracking branch 'origin/main' into mnemopi 2026-07-18 11:05:24 +08:00
roboomp 84c6b6aa58 fix(tui): compact committed finalized transcript history
TranscriptContainer gated committed-prefix compaction on version === undefined, so version-tracked AssistantMessageComponent history never compacted and every stream tick re-walked all N sealed blocks (depth-linear compose).

Compact fully-committed finalized blocks regardless of post-finalize version tracking: their rows are immutable native scrollback the terminal owns. A post-commit mutation no longer recommits on ordinary frames (no duplication) and rehydrates on the next destructive full replay (no loss). Adds the permanent bench/transcript-compose.bench.ts fixture; ratio(N5000/N500) drops 2.30 -> 0.90.

Fixes #5930
2026-07-18 00:52:57 +00:00
DarkPhilosophy e6d3064bef fix(mnemopi): compose cache heals and route the embed worker through them
Review follow-ups:
- The corruption retry now goes THROUGH the sidecar heal, so a cache
  broken in both ways (truncated model blob AND stale/missing
  config/tokenizer sidecars) recovers in one pass instead of the retry
  escaping with a sidecar error.
- defaultLocalModelInitializer is exported from core as the shared
  initializer and the coding-agent embed worker now uses it instead of
  calling FlagEmbedding.init directly, so omp's subprocess embeddings
  inherit both heals; fastembed/onnxruntime still load only in the
  child address space.
2026-07-18 02:35:39 +03:00
roboomp 1e209caeee perf(session): gate blob-ref resolution behind synchronous precheck
resolveBlobRefsInEntries handed every non-session entry to the recursive
async resolvePersistedBlobRefs walk, allocating and awaiting child promises
even for plain-text entries with no blob:sha256: refs. On large text-heavy
histories this dominated the blob_resolve phase of session open.

Add a cheap synchronous containsBlobRef precheck that early-exits on the
first ref and allocates nothing. Interleave the precheck with per-entry
initiation so positive entries still start resolution at the same relative
point as the old filter+map schedule (a later entry that gains a ref during
an earlier BlobStore.get is still scanned after that mutation).

Blob-free N=5000 fixture: blob_resolve median 19.5ms -> 1.1ms, zero
BlobStore.get calls.

Fixes #5922
2026-07-17 23:25:16 +00:00
roboomp 26e75b251c fix(stt): selected supported linux ffmpeg input
- Probed Linux ffmpeg demuxers and fell back to ALSA when PulseAudio input is unavailable.
- Preserved recorder stderr so immediate capture failures report their real cause.
- Added regressions for ALSA selection and stderr diagnostics.

Fixes #5907
2026-07-17 20:25:21 +00:00
can1357 8577371187 Merge PR #5896: fix(kimi-code): preserve K3 native effort contract (@roboomp) 2026-07-17 21:22:08 +02:00
can1357 8c546bda77 Merge PR #5816: fix(tools): recognize zip-family archives and prune unconvertible extensions (@roboomp) 2026-07-17 21:22:07 +02:00
can1357 089eec18e6 Merge PR #5811: fix(read): refresh URL responses on each invocation (@roboomp) 2026-07-17 21:22:07 +02:00
can1357 3df9cb12c1 Merge PR #5883: fix(agent): preserve signed thinking-only stops (@roboomp) 2026-07-17 21:22:06 +02:00
can1357 1311e6440b Merge PR #5809: fix(session): make /new an atomic boundary against queued steers (@roboomp) 2026-07-17 21:22:06 +02:00
can1357 357d683007 Merge PR #5894: fix(mcp): process-group kill and SIGKILL escalate on stdio transport close (@Mathews-Tom) 2026-07-17 21:22:06 +02:00
can1357 0422357bff Merge PR #5880: fix(extensions): restore legacy Kimi provider compatibility (@roboomp) 2026-07-17 21:22:05 +02:00
can1357 3de62abccb Merge PR #5878: fix(tui): keep active todo visible in collapsed views (@roboomp) 2026-07-17 21:22:05 +02:00
can1357 940855608e Merge PR #5865: fix(hub): restore persisted peers after resume (@roboomp) 2026-07-17 21:22:05 +02:00
can1357 3e006c8a70 Merge PR #5855: fix(mcp): stop reauth after failed dynamic client registration (@roboomp) 2026-07-17 21:22:05 +02:00
can1357 255707426b Merge PR #5846: fix(cli): preserve carriage-return progress boundaries (@roboomp) 2026-07-17 21:22:04 +02:00
can1357 0b1e794545 Merge PR #5844: fix(tui): drop stale hidden-lines footer on expanded bash/eval output (@roboomp) 2026-07-17 21:22:04 +02:00
can1357 4e71615f8f Merge PR #5840: docs: narrow history:// contract to current session tree (@roboomp) 2026-07-17 21:22:04 +02:00
can1357 80544edabb Merge PR #5826: fix(lsp): support pull diagnostics (@roboomp) 2026-07-17 21:22:03 +02:00
can1357 754195f5e7 Merge PR #5814: fix(read): support history URL selectors (@roboomp) 2026-07-17 21:22:03 +02:00
can1357 261ce6c370 fix(prompting): preserved direct tools sharing xd names
Kept top-level custom tool descriptors when a retained xd device uses the same name. Added compact and inline inventory coverage for mounted-only and dual-presentation tools.
2026-07-17 20:44:34 +02:00
can1357 e1e2a868b1 merge pull request #5799 2026-07-17 20:40:39 +02:00
can1357 248421fdf9 fix(coding-agent): fixed xd:// mount notices triggering unsolicited model turns
- Fixed xd:// mount notices forcing their own model turn by deferring them until the next user prompt instead.
- Added `#pendingXdevMountDelta` field and `#takePendingXdevMountNotice()` to coalesce mount/unmount events and ride along with prompts.
- Mount and unmount events that cancel each other out before the next prompt are now dropped from the coalesced delta.
- Notices remain buffered during quiet startup mode (`startup.quiet`) and are delivered on the subsequent user prompt.
2026-07-17 20:36:11 +02:00
Mathews-Tom 224796b13a fix(mcp): sweep group SIGKILL after a cooperative detached leader exit
terminateStdioProcess() treated a detached leader's cooperative SIGTERM
exit as proof the whole process group was gone, so close() skipped the
group SIGKILL and left a SIGTERM-trapping/ignoring grandchild running as
an orphan — exactly the process tree this change set out to reap. A
detached transport now always sweeps the group SIGKILL after SIGTERM,
even when the leader itself already exited.

waitForProcessExit() also left its losing Bun.sleep() timer running
after Promise.race settled from the other side, holding the event loop
open for up to the full grace window on every close(). It now uses a
cancellable setTimeout cleared in a finally block.

Adds a regression test spawning a non-trapping leader with a
SIGTERM-trapping grandchild to cover the gap the first fix closes.
2026-07-18 00:02:21 +05:30
roboomp 913ec0baae fix(kimi-code): preserved k3 native effort contract
- Parsed live named efforts, mandatory-thinking state, and model protocol metadata.

- Sent native Kimi named efforts and adaptive Anthropic override efforts without generic token budgets.

Fixes #5893
2026-07-17 18:19:00 +00:00
roboomp f662d79ffd fix(tui): keep hidden-pending summary when actives fill the todo cap
selectCollapsedTodos took the active-overflow branch at active.length >= cap, so exactly cap actives plus trailing pending returned the cap rows with an empty summary — the pending work vanished with no '… N more' indicator.

Use a strict '> cap' guard so equality falls through to the normal branch, which counts every hidden row.

Fixes #5873
2026-07-17 18:06:47 +00:00
roboomp 939d6761f7 fix(tui): shared walking-viewport policy for collapsed todos
The first pass anchored a slice on the active task, which still showed completed rows, kept the active item mid-window, and gave the two views divergent selection logic. Per reviewer, replace it with one shared policy both collapsed views run.

selectCollapsedTodos (todo.ts) omits completed/abandoned, pulls every active task (in_progress or subagent-matched pending) to the head in todo order, fills remaining rows with following pending tasks, and emits '… N more active todos' when active work alone exceeds the cap; it falls back to closed tasks for a settled phase so HUD persistence still renders. renderTreeList gains a trailingSummary primitive so item selection lives in the todo domain. The transient tool result reaches live subagent matches via setActiveTodoDescriptionsProvider, wired from interactive mode's observer registry, so both views share the active set.

Fixes #5873
2026-07-17 18:03:13 +00:00
Mathews-Tom c30c3ab0fb fix(mcp): process-group kill and SIGKILL escalate on stdio transport close
Before: StdioTransport.close() did a bare `this.#process.kill()` — a single
direct SIGTERM to the immediate child, with no wait and no escalation. On
Linux (and other non-Windows/non-macOS POSIX hosts), the MCP server is
spawned detached (setsid, its own session leader) so terminal job-control
signals can't stop it. A detached server that traps/ignores SIGTERM — or a
grandchild it spawns inside that session — survived omp process exit and
was orphaned, re-parented to PID 1.

After: close() runs a bounded, idempotent teardown:
  1. End stdin first (cooperative EOF) so a well-behaved server can exit on
     its own before any signal is sent.
  2. Send SIGTERM: to the whole process group (negative-pid `process.kill`)
     when this transport actually spawned detached on a POSIX host, else to
     the direct child only. A negative-pid signal is never attempted for a
     non-detached transport, since it could hit an unrelated group. ESRCH
     from the group signal means the group is already gone (treated as
     success); any other group-signal failure falls back to a direct-child
     signal.
  3. Wait up to ~1s for the direct child to exit; if it hasn't, escalate to
     SIGKILL (group-or-direct, same rule as step 2) and wait a further
     bounded ~0.5s before returning. Total worst case (~1.5s) stays well
     inside the ~3s MCP disconnect-all budget in agent-session.ts dispose().

`#process` is captured into a local and nulled before the first `await`, so
repeat/concurrent close() calls see it already cleared and skip re-signaling
— idempotent per the existing contract documented above close().

Extracted the signal/escalate logic into an exported `terminateStdioProcess`
(plus a `KillableSubprocess` structural type, decoupled from the stdio pipe
generics) so tests can drive group-signal escalation with an explicit
`detached` flag — `StdioTransport.connect()` ties `detached` to the host's
real `process.platform` via `resolveStdioSpawnCommand()`, so a POSIX
detached session can't be reproduced end-to-end through `connect()` on a
non-Linux dev/CI host, but a real detached process group can still be
spawned directly on any POSIX host to exercise it.

Tests added to stdio.test.ts: detached child trapping SIGTERM escalates to
SIGKILL; a detached parent's SIGTERM-trapping grandchild is only reached by
the group SIGKILL (proves group, not direct-child-only, signaling); a
well-behaved child closes promptly without escalating; a non-detached
transport never attempts a group signal. Extended
test/mcp-stdio-transport.test.ts's existing close() idempotency coverage
with a case where the first close() had to run the full escalation path.

Fixes #5578.
2026-07-17 23:22:06 +05:30
roboomp bacc24e12e fix(agent): preserved signed thinking-only stops
- Treated non-empty thinking signatures as terminal provider content.
- Added regression coverage for empty visible thinking with a valid signature.

Fixes #5881
2026-07-17 17:08:15 +00:00
roboomp aaac0ace1d fix(extensions): created legacy auth database directory
Create the resolved agent database parent before the synchronous compatibility store opens SQLite, and cover a fresh nested agent directory.

Fixes #5879
2026-07-17 17:06:15 +00:00
roboomp 7e8c4fc01f fix(extensions): restored legacy provider compatibility
Restored the historical assistant-message stream factory and synchronous auth-storage facade needed by pi-provider-kimi-code.

Fixes #5879
2026-07-17 16:54:47 +00:00
roboomp e6fd29ec21 fix(tui): keep active todo visible in collapsed views
Both collapsed todo renderers took fixed edge slices: the tool result kept the tail eight (truncateFrom start) and the HUD kept the head five (base.slice), so a mid-phase in_progress task fell in the omitted middle of both.

Add an anchorIndex option to renderTreeList that slides the collapsed window over the anchored item with two-sided '… N more' summaries, and anchor both call sites on the in_progress task (HUD falls back to the first subagent-matched pending task).

Fixes #5873
2026-07-17 16:33:28 +00:00
vmcall 131d06075d fix(task): preserved essential load mode 2026-07-17 17:46:07 +02:00
vmcall 4121c19781 test(eval): aligned allowed-agent prompt expectation 2026-07-17 17:38:12 +02:00
vmcall d53cf023b0 fix(task): reconciled structured subagents with upstream
- Preserved the plan-mode capability clamp after upstream removed report_finding.
- Updated persisted-revival coverage for mounted xdev tool activation.
- Applied current formatter output to conflicted runtime files.
2026-07-17 17:38:12 +02:00
vmcall b4952e27c4 refactor(eval): removed dead isolation recovery formatter 2026-07-17 17:38:12 +02:00
vmcall 1dbedbedf5 fix(task): restored restricted spawn policy description 2026-07-17 17:38:12 +02:00
vmcall 2aaa639b69 fix(task): marked dynamic task schema non-strict
Caller-provided output schemas are free-form JSON and cannot be represented by OpenAI strict tool schemas. Keep todo strict while explicitly sending task as non-strict.
2026-07-17 17:38:12 +02:00
vmcall 414ef80c41 fix(task): restored goal activation outside restricted sessions
- Preserved goal-mode tool injection for ordinary explicit tool lists.
- Kept plan-mode LSP and IRC unavailable under the host capability clamp.
- Added regressions for both capability boundaries.
2026-07-17 17:36:59 +02:00
vmcall d944879f21 feat(task): unified structured subagent execution
- Added per-invocation task schemas with strict and permissive validation.
- Shared task and eval agent policy, artifacts, isolation, and lifecycle handling.
- Enabled host-restricted plan-mode eval agents and persisted their capability clamp.

Fixes #5279
2026-07-17 17:36:59 +02:00
roboomp 66837a96be fix(hub): restored persisted peers after resume
Moved persisted roster discovery out of the Agent Hub UI so model-facing coordination can use the same disk-backed registration path.

Rehydrated parked peers before an empty hub list response and added a crash-resume regression test.

Fixes #5864
2026-07-17 15:20:43 +00:00
roboomp 189ac462cc fix(mcp): narrowed failed DCR block to unapproved clients
Only a 403 response that identifies unapproved_client now blocks generateAuthUrl before its clientless probe. Invalid metadata, invalid redirect, generic forbidden, retryable, and server failures preserve the probe path.

Consolidated fallback coverage across 400, 403, 429, and 503 responses.

Fixes #5852
2026-07-17 14:56:56 +00:00