Commit Graph

7033 Commits

Author SHA1 Message Date
Can Bölük 47bb5172fe Merge pull request #3138 from KamijoToma/save-command-history
feat(coding-agent): save slash command text for /btw /tan /omfg /memory /rename /move to TUI history
2026-06-20 22:39:47 +02:00
can1357 34cac5dd55 docs(changelog): normalize [Unreleased] after #3087/#3022 2026-06-20 22:36:32 +02:00
can1357 321b51517a Merge PR #3022: refactor(coding-agent): use Promise.withResolvers in AsyncDrain (@oldschoola) 2026-06-20 22:36:13 +02:00
Can Bölük 18be1f6509 Merge pull request #3090 from oldschoola/fix/batch-test-ebusy-cleanup
fix(test): migrate fs.rmSync to removeSyncWithRetries in 5 more test files
2026-06-20 22:35:07 +02:00
can1357 d8ec46eee5 fix(tiny): guard unsupportedReason access on const model-spec union (#3133 integration typecheck) 2026-06-20 22:25:29 +02:00
can1357 ad31ef212b docs(changelog): normalize [Unreleased] after PR integration 2026-06-20 22:23:36 +02:00
can1357 df581eee5f style: biome format inventory test slice (#3017 integration) 2026-06-20 22:23:18 +02:00
can1357 0f40ae3df0 test(coding-agent): drop obsolete inventory-layout assertion superseded by main's prompt reorder (#3017 integration) 2026-06-20 22:20:54 +02:00
can1357 c47b57a199 test(coding-agent): make inventoryFrom robust to prompt.md reorder
The prompt-inventory test sliced on the '# Inventory'/'ENV' markers from the
PR's merge-base prompt.md. On current main (chore: prompt reorder) the heading
is '# Tool Inventory' and the 'ENV' marker is gone, which is why the file was
deleted there. Accept either layout so the resurrected tests (incl. the SDK
'render provided tools' contract) pass after the cherry-pick.
2026-06-20 22:19:28 +02:00
can1357 9722505a2b Merge PR #3017: fix(coding-agent): handle todo paths and prompt inventory (@oldschoola)
# Conflicts:
#	packages/coding-agent/test/system-prompt-inventory.test.ts
2026-06-20 22:19:28 +02:00
can1357 ffc842ee7c fix(agent): reset promoted memory prompt on session fork
fork() reset mnemopi conversation tracking directly but skipped the shared new-transcript reset, so the folded/promoted first-turn memory stayed in #baseSystemPrompt. The next turn re-recalled and the change-detection saw no diff, taking the fallback promotion path and injecting the <memories> block twice into the forked session prompt. Route fork() through #resetMemoryContextForNewTranscript() like the other reset paths and add a regression test asserting the forked prompt contains recalled memory exactly once.
2026-06-20 22:16:58 +02:00
can1357 10ed2d4efa Merge PR #3113: fix(agent): preserve memory recall in append-only prompt cache (@roboomp) 2026-06-20 22:16:58 +02:00
can1357 1fadcdb8e3 Merge PR #3147: fix(agent): compact active goal yields (@roboomp) 2026-06-20 22:16:57 +02:00
can1357 afda2f1193 fix(coding-agent): move /omfg changelog entry to Unreleased
The PR placed the entry under the released [16.0.7] section with a
duplicate ### Fixed header, mutating released notes. Move it under
[Unreleased] per the repo changelog convention.
2026-06-20 22:16:57 +02:00
can1357 7bf8db9215 Merge PR #2946: fix(coding-agent): show omfg dismiss hint (@wolfiesch) 2026-06-20 22:16:57 +02:00
can1357 e3dd53affc Merge PR #2862: fix(tui): keep Alt+M role models selectable over context limit (@roboomp)
# Conflicts:
#	packages/coding-agent/test/model-selector-role-badge-thinking.test.ts
2026-06-20 22:14:28 +02:00
can1357 176d0a98a0 Merge PR #2995: fix(coding-agent): clarify temporary model picker (@riverpilot) 2026-06-20 22:13:07 +02:00
can1357 d3d88ce5c3 test(coding-agent): force startInAllScope in #3099 regression so it discriminates
The #3099 test omitted the startInAllScope flag, so it passed against the
buggy baseline too (empty folder defaults to folder scope regardless). Force
the removed flag via a cast to pin the real contract: even when a caller asks
for all-projects scope on an empty folder, the picker must stay folder-scoped.
Proven: passes on head src, fails on baseline src (renders '(all projects)').
2026-06-20 22:13:01 +02:00
can1357 31bb2144e7 Merge PR #3100: fix(coding-agent): keep /resume picker scoped to the current folder (@roboomp) 2026-06-20 22:13:01 +02:00
can1357 a76de2fea8 Merge PR #3089: fix(test): migrate fs.rmSync to removeSyncWithRetries for EBUSY-safe cleanup (@oldschoola) 2026-06-20 22:12:49 +02:00
can1357 61f3b54c86 Merge PR #3086: fix(test): use TempDir for Windows-safe cleanup in settings-manager tests (@oldschoola) 2026-06-20 22:12:49 +02:00
can1357 827edbec17 docs(changelog): correct legacy-compat entry placement and scope
Move the legacy pi-ai compat note from the released [16.0.5] section to
[Unreleased], and drop the inaccurate bare-`typebox` claim: bare
`typebox` specifier handling already exists on main (issue #2858,
TYPEBOX_SPECIFIER_FILTER / TYPEBOX_IMPORT_SPECIFIER_REGEX) and this PR's
diff does not touch it. The entry now scopes the change to the actual
delta: restored getModel/getModels aliases and StringEnum enum-object
support.
2026-06-20 22:12:49 +02:00
can1357 771f93244f Merge PR #2907: fix(coding-agent): support getModel/getModels aliases in legacy extensions (@pidevxplay) 2026-06-20 22:12:49 +02:00
can1357 b128406030 Merge PR #2994: fix(catalog): clamp MiMo reasoning efforts (@riverpilot) 2026-06-20 22:12:49 +02:00
roboomp 4fcebcea0b fix(mnemopi): kept transcript tail when clipping oversized embedding inputs
`MnemopiSessionState.retainMessages` hands `embed()` the chronological
multi-turn transcript (oldest -> newest). A naive `slice(0, max)` cap landed
on the oldest turns and dropped the most recent content, so every retained
episode past the cap collapsed onto essentially the same prefix vector and
dense recall could not match topics introduced after the first 8192 chars.

`capInputs` now routes oversized inputs through `clipToWindow`, which keeps
roughly half the cap from the head and half from the tail with a small
`[...]` elision marker between them. Short inputs and array reference pass-
through are unchanged. Falls back to a tail-only clip when `max` is too small
to fit a useful split. Locked in by a new `embedding-input-cap.test.ts` case
that pins markers at both ends of a 50k transcript and asserts both survive
the clip.

Fixes #3126
2026-06-20 22:12:48 +02:00
roboomp f2ad18692f fix(mnemopi): lowered default embedding input cap to 8192 chars
Defaulted MNEMOPI_EMBEDDING_MAX_INPUT_CHARS to 8192 so the automatic guard matches bge-m3 and OpenAI text-embedding context limits by default. Larger local embedding servers such as Qwen3-Embedding with 32k ctx can still raise the cap, and 0 still disables truncation.

Fixes #3126
2026-06-20 22:12:48 +02:00
roboomp 6666dec657 fix(mnemopi): capped embed() input to keep retention transcripts under the embedding context
`MnemopiSessionState.retainMessages` (`packages/coding-agent/src/mnemopi/state.ts:352`)
always calls `prepareRetentionTranscript(messages, true)` and hands the whole
multi-turn transcript to `embed([transcript])`. Long sessions (especially CJK
content) routinely outgrow the embedding model's context window, and llama.cpp's
`/embeddings` server rejects oversized requests with
`request (N tokens) exceeds the available context size` — every retain after
that point silently lost its vector row, leaving recall on FTS-only.

Capped per-input length inside `embed()` (the single chokepoint every retain /
query / consolidate flow funnels through) at `MNEMOPI_EMBEDDING_MAX_INPUT_CHARS`
(default 32000 chars ≈ 8k English tokens / 16–32k CJK tokens, override via env
or `embeddings.maxInputChars` runtime option; `0` disables). The new array
is allocated only when at least one input is oversized, so the typical short-
query path through `embedQuery` still passes the original array through; the
truncation also emits a debug-or-warn log so the resize is no longer silent.

Fixes #3126
2026-06-20 22:12:48 +02:00
can1357 c6c32242e9 fix(collab): arm welcome timer over the connect phase
The chunked-welcome refactor moved welcome-timer arming into socket.onOpen,
leaving the connect phase uncovered: if the relay blackholes the WebSocket
handshake (no onOpen and no onClose), the timer never arms and /join hangs
forever. Baseline armed the 30s timeout right after connect(); restore that
so a stalled handshake still rejects the join. onOpen continues to re-arm
(resetting the budget) once the socket opens.
2026-06-20 22:12:48 +02:00
can1357 c31e7fc16e Merge PR #3145: fix(collab): chunked welcome so large session snapshots can join (@roboomp) 2026-06-20 22:12:47 +02:00
can1357 6f17533041 fix(tiny): keep tiny-models download all green by skipping load-blocked models
resolveModels("all") expanded the full TINY_LOCAL_MODELS registry, which now
includes the qwen3-1.7b entry marked unsupportedReason. loadPipeline() throws
for such specs, so the download worker reported it as failed and the bulk
command exited with "One or more tiny title models failed to download" even
when every usable model downloaded. Filter unsupported specs out of the `all`
prefetch path; explicit single-model requests are unchanged. Addresses the
unaddressed Codex P2 on PR #3133.
2026-06-20 22:12:47 +02:00
can1357 28bbe4d14f Merge PR #3133: fix(tiny): stop respawning failed local model workers (@roboomp) 2026-06-20 22:12:47 +02:00
can1357 f58750d7bf Merge PR #3118: fix(tool): resolve internal URL directories (@roboomp) 2026-06-20 22:12:47 +02:00
can1357 390ea7b82b Merge PR #3109: fix(read): render wide SQLite tables as vertical blocks (@roboomp) 2026-06-20 22:12:47 +02:00
roboomp e00483b2c1 fix(agent): compact active goal yields
Run threshold compaction maintenance when an active goal turn ends through a successful yield, while preserving the final-yield skip for non-goal completions.

Fixes #3146
2026-06-20 19:01:26 +00:00
roboomp 10e1ff44c9 fix(collab): reject join when snapshot resume fails
The chunked welcome path cleared its snapshot progress timer before
writing the replica file and switching sessions. If that apply work
failed, the frame-apply catch only logged the error, leaving the
initial join promise pending with no welcome/progress timer left to
settle it.

Reject the pending initial join when a welcome or snapshot-chunk apply
fails before the join has completed, preserving reconnect-time logging
for already-joined guests. Add a regression test that forces the replica
write to fail and asserts /join rejects instead of hanging.

Fixes #3144
2026-06-20 18:45:04 +00:00
roboomp 4ff5b073e8 style: bun run fix 2026-06-20 18:34:05 +00:00
roboomp 5b937511c4 fix(collab): chunked welcome so large session snapshots can join
The host used to ship the entire transcript inside a single welcome
frame, so a multi-MB session spent the guest's 30s first-welcome
timeout on the relay transfer itself: ~1.3 MB took ~3s, ~4.2 MB took
~12s, and ~13.6 MB never arrived before the guest gave up with
'timed out waiting for the host's welcome'.

Bump COLLAB_PROTO to 2 and split the welcome:

- welcome carries metadata only (header, state, agents, entryCount,
  readOnly) and lands in well under one second.
- a train of snapshot-chunk frames (SNAPSHOT_CHUNK_BYTES = 512 KB,
  oversize entries ship alone) carries the transcript. Last chunk
  flips final: true; an empty snapshot still emits one final chunk.
- the host queues welcome + chunks synchronously inside #handleHello,
  preserving the host comment's ordering invariant (later broadcast
  frames cannot interleave between them).
- the TUI guest accumulates chunks under a SNAPSHOT_PROGRESS_TIMEOUT_MS
  that resets per chunk; only after final does it write the replica
  jsonl, switchSession, and render. The first-welcome timeout still
  guards arrival of the small welcome.
- the collab-web GuestClient streams entries into the snapshot as
  chunks arrive and flips phase to 'live' on final.

Includes a contract test (in-process relay) asserting the welcome is
metadata-only, the chunk train fans the 1.5 MB synthetic transcript
across multiple frames with only the last marked final, and the
flattened entries match the source snapshot.

Fixes #3144
2026-06-20 18:33:59 +00:00
roboomp 39ce1b33cc fix(tiny): kept queued models retryable after crashes
Stopped treating subprocess crash notifications as model-specific inference failures. Added regression coverage proving an unrelated queued title model can spawn a replacement worker after the crashed worker faults all pending requests.

Fixes #3132
2026-06-20 13:30:22 +00:00
roboomp 9b9a6b38a7 fix(tiny): stopped respawning failed local model workers
Blocked the unsupported Qwen3 1.7B ONNX memory model before loading transformers and remembered local model execution failures so the client returns null instead of spawning another __omp_worker_tiny_inference process for the same failed model.

Fixes #3132
2026-06-20 13:24:53 +00:00
roboomp 9f77877b15 fix(tool): kept internal directory listings immutable
Flag directory resources from internal URL handlers as immutable so hashline edit anchors never key on a directory path.
2026-06-20 09:59:39 +00:00
roboomp 9da023864f fix(tool): preserved handler directory listings
Stopped routing internal URL directory reads through the filesystem tree renderer so vault:// and '/data/workspaces/can1357__oh-my-pi__3116/.omp-session/2026-06-20T09-33-10-396Z_019ee460-817c-7000-8139-f8e2927809dd/local' keep their custom navigable listings.
2026-06-20 09:53:11 +00:00
roboomp 15b9dc222c fix(tool): kept immutable search directories read only
Treat immutable internal URL directory source paths as immutable for all descendants before search emits hashline anchors.
2026-06-20 09:50:28 +00:00
roboomp b098addaf3 fix(tool): resolved internal url directories
Allow file-backed internal URL handlers to return existing directories as resources so read can list them and search/find can walk their source paths.

Fixes #3116
2026-06-20 09:44:10 +00:00
roboomp 1b197956a4 fix(agent): reset memory prompts on new transcripts
Restored and refreshed promoted memory prompts through the shared new-transcript reset path used by new sessions, handoff, branch, /btw, and cross-session switches.\n\nAdded coverage for newSession after first-turn memory recall so stale recalled memories cannot leak into the next transcript when recall returns no context.\n\nFixes #3111
2026-06-20 08:50:30 +00:00
roboomp 7d7cc1d1ba fix(agent): cleared promoted memory on session switch
Reset memory recall state before rebuilding the prompt during session switches, and clear fallback-promoted memory prompts when moving to another session.\n\nAdded a regression test that switches sessions after first-turn memory recall and verifies the next session does not receive stale memories.\n\nFixes #3111
2026-06-20 08:45:25 +00:00
roboomp 3d864fa763 fix(agent): preserved memory prompt cache
Promoted first-turn memory recall into the stable base prompt so append-only sessions do not drop the memory block on the next turn and rebuild the provider prefix.\n\nAdded a regression test covering a memory backend that recalls once before the first model request.\n\nFixes #3111
2026-06-20 08:32:48 +00:00
roboomp ed37f076ef fix(read): render wide SQLite tables as vertical blocks
The ASCII table renderer in `sqlite-reader.ts` shrank columns down to
`MIN_COLUMN_WIDTH=1` to fit the 120-cell budget. With ~20+ columns
(the reporter had 33) every multi-char cell collapsed to a lone `…`
and the final per-line `truncateToWidth(..., MAX_RENDER_WIDTH)` then
chopped the right edge — so the read tool returned a table of nothing
but ellipses with the rightmost cells missing entirely.

Bump the per-column floor to 3 (so cells always show at least two real
glyphs alongside the ellipsis) and, when the column count alone forces
the floor over budget, fall back to a per-row vertical block layout —
mirroring `psql`'s expanded display mode. Each row becomes a
`column: value` group with column names padded so colons align and
the value line truncated to the same 120-cell budget.

Fixes #3107
2026-06-20 07:55:09 +00:00
Alexander Kirilin 164176d4d4 fix(coding-agent): merge main into temp picker guidance 2026-06-20 03:27:11 -04:00
Alexander Kirilin eaf9248ec2 fix(catalog): merge main into MiMo efforts 2026-06-20 03:27:05 -04:00
can1357 221f4102fb fix: resolved Fireworks Qwen models to openai thinking format
- Updated `buildOpenAICompat` to override the `qwen` thinking format for Fireworks-hosted models, ensuring they use `openai` thinking parameters instead.
- Prevented invalid `enable_thinking` payload errors by ensuring Fireworks-hosted Qwen requests conform to their strict schema.
- Updated `AgentSession` to allow Fireworks fast-fallback logic to execute even when standard retries are disabled.
2026-06-20 09:25:36 +02:00