Commit Graph

8402 Commits

Author SHA1 Message Date
can1357 4e12e5bf76 fix(extensibility): read lazy graph modules from disk at import time
The consume-once source map kept entries for graph modules the initial
import never loaded (modules only reached via lazy dynamic imports).
Their first import - possibly long after load, and after an on-disk
edit - was served the boot-time snapshot instead of current file
content, and the unconsumed sources stayed in the plugin closure for
the process lifetime.

Clear the map once the entry import settles: everything Bun loaded at
startup was already consumed (keeping the read-once win), and anything
left must be read at its actual import time, matching pre-dedup
behavior for lazy modules. The new regression test passes on the
pre-dedup baseline and fails on the unfixed dedup.
2026-07-02 10:29:57 +02:00
can1357 29ddf875c7 style(test): format graph-read-dedup test with repo formatter
biome check previously failed on this file (unsorted imports, space
indentation where the repo formatter emits tabs).
2026-07-02 10:29:57 +02:00
can1357 64e4bd89d1 merge PR #4205: perf(extensibility): read extension source graph once per load (@metaphorics) 2026-07-02 10:29:57 +02:00
can1357 2a7a7ec15c merge PR #4202: fix(coding-agent): scope discoverExtensionPaths to native extension-module provider (@roboomp) 2026-07-02 10:29:57 +02:00
can1357 c8fcf7a3c7 merge PR #4209: fix(coding-agent): cache plugin extension resolution (@roboomp) 2026-07-02 10:29:56 +02:00
can1357 88e352298a merge PR #4204: fix(model-discovery): auto-update ZenMux models into models.db without a key (@metaphorics) 2026-07-02 10:29:47 +02:00
can1357 a7ff81e0f6 merge PR #4217: fix(providers): hydrate runtime model cache before selection (@roboomp) 2026-07-02 10:29:47 +02:00
can1357 a5043b11ec merge PR #4221: fix(session): keep model switches active after rate limits (@roboomp) 2026-07-02 10:29:47 +02:00
can1357 c2a9f97c41 fix(title): don't treat caseless scripts as shouting
isAllCapsWord matched any multi-letter token without a lowercase letter,
so CJK tokens registered as ALL-CAPS words: two adjacent ones marked the
whole source shouty and silently disabled acronym restoration for every
non-Latin-script message (e.g. '修复 CNPG 集群故障' kept 'Cnpg'). Require an
actual uppercase letter; cased-script shout detection is unchanged.
2026-07-02 10:29:38 +02:00
can1357 289c7b357d fix(title): allowlist ETL so acronym restoration matches the documented contract
The PR's changelog, doc comment, and prompt examples all name ETL as a
restored acronym, but the review-response narrowing (vowel heuristic +
allowlist) silently dropped it: ETL bears a vowel and was not listed.
Add it to COMMON_TITLE_ACRONYMS and pin it in the allowlist test.
2026-07-02 10:29:37 +02:00
can1357 7be66da1ef merge PR #4222: fix(title): preserve ALL-CAPS acronyms in auto-generated session titles (@roboomp) 2026-07-02 10:29:37 +02:00
roboomp bc5fbb4eb6 fix(title): avoid restoring emphasized words as acronyms
Narrow acronym restoration so plain all-caps English words such as FIX
and WORK do not get restored when the model naturally capitalizes the
first title word. Restorable all-caps source tokens now need a stronger
acronym signal: a common technical acronym allowlist, digits, or a
consonant-only shape.

This keeps CNPG, ETL, JWT, SQL, and API restoration while preserving the
anti-shout behavior for single emphatic words.

Fixes #4220
2026-07-02 07:02:26 +00:00
can1357 0ea6ea630b chore: bump version to 16.3.1 2026-07-02 09:00:04 +02:00
can1357 94645752ff feat(coding-agent/tts): introduced natural speech synthesis pipeline
- Added an enhanced speech pipeline that utilizes small models to rewrite text for natural language synthesis.
- Implemented `SpeechEnhancer` and `BlockAccumulator` to manage fence-aware text streaming and paragraph splitting.
- Configured a new `speech.enhanced` setting to toggle between mechanical and enhanced vocalization modes.
- Resolved `EPIPE` rejections during speech playback by ensuring stream flushes and suppressing stop-related errors.
2026-07-02 08:59:13 +02:00
roboomp 76ac419aaa style: bun run fix 2026-07-02 06:55:52 +00:00
roboomp 48d2b5c06b fix(title): preserve ALL-CAPS acronyms in auto-generated session titles
reconcileTitleCasing now maps ALL-CAPS source tokens (CNPG, API, ETL,
JWT) into an acronyms table and restores them when the model produces a
plain title-cased artifact (Cnpg). Restoration is disabled when the
source is shouty (>=2 consecutive multi-letter ALL-CAPS tokens like
"FIX the BUG NOW" or "ALL ERROR HANDLING"), and lowercase model output
is left alone so isolated single-word emphasis (WORK -> work) is never
re-shouted.

The three title system prompts (title-system.md, title-system-marker.md,
tiny-title-system.md) also gained an explicit instruction to preserve
ALL-CAPS acronyms verbatim, so a competent model short-circuits via the
verbatim set before post-processing kicks in.

Fixes #4220
2026-07-02 06:55:20 +00:00
roboomp a06d0c54b3 fix(session): switched models during goal recovery
Removed the live-context guard that let default model selection persist a new role without changing the active session model. The next prompt's compaction path now owns oversized-context recovery after a switch.

Fixes #4219
2026-07-02 06:48:30 +00:00
can1357 41cc57c238 feat(coding-agent/tts): redesigned streaming speech vocalization
- Added `SpeakableStream` to strip markdown noise, silence code blocks and tables, normalize links and paths, and emit sentence/clause segments.
- Reworked `Vocalizer` to segment assistant deltas in the parent process, lazily open TTS streams, idle-flush partial thoughts, and chain playback sessions.
- Added gapless streaming playback with ffmpeg/sox backends, ducking-aware pacing, fallback file playback, and immediate stop handling.
- Added IPC `sendAndFlush` support and used it in the TTS worker so audio chunks drain before blocking ONNX inference resumes.
- Added speakable-stream coverage for markdown filtering, segmentation latency, idle flushing, and forced long-segment splits.
2026-07-02 08:30:58 +02:00
can1357 95b91c7f73 feat(coding-agent/tools)!: replaced paths arrays with path strings
- Replaced `grep`, `glob`, and `ast_grep` `paths` inputs with optional single `path` strings while preserving default workspace-root behavior.
- Added shared `toPathList` normalization for legacy arrays and JSON-encoded arrays across tool execution and TUI renderers.
- Updated prompts, fixtures, shims, transcript summaries, and tests to send and display the new `path` argument.
- Updated collab-web search tool cards to read `path` while falling back to legacy `paths` for historical transcripts.
- Recorded the contiguous coding-agent changelog run for the tool-path breaking change and adjacent TTS entries.
2026-07-02 08:30:33 +02:00
roboomp e58d86448a fix(changelog): moved provider fix to unreleased
Moved the #4216 runtime provider cache fix entry out of the released 16.3.0 section and into Unreleased.\n\nFixes #4216
2026-07-02 06:24:49 +00:00
roboomp 114b4bedfa fix(providers): hydrated runtime model cache before selection
Loaded cached runtime extension provider catalogs before deferred model resolution so dynamic-only providers can satisfy cold-start --model and session resume selection from models.db.\n\nFixes #4216
2026-07-02 06:16:39 +00:00
roboomp 15c4835e99 fix(coding-agent): cached plugin extension resolution
- Added shared plugin cache invalidators wired through clearClaudePluginRootsCache.\n- Memoized enabled plugin discovery and legacy bare dependency fallback resolution.\n- Added regression coverage for cache reuse and invalidation.\n\nFixes #4197
2026-07-02 04:54:10 +00:00
metaphorics 39668f36f7 fix(model-discovery): auto-update ZenMux models into models.db without a key
ZenMux discovery only defined a dynamic fetcher when a ZENMUX_API_KEY was
present, and the descriptor lacked the top-level allowUnauthenticated flag
that gates keyless runtime manager creation. Newly published ZenMux models
therefore never reached the runtime models.db cache without a key — they
were stranded until the bundled models.json was regenerated.

Make fetchDynamicModels unconditional (the public /api/v1/models endpoint
needs no auth) and add top-level allowUnauthenticated so the runtime builds
a keyless manager and writes discoveries to models.db, matching the
ollama/lm-studio pattern. ZenMux stays out of #keylessProviders: it is a
paid gateway, so discovered models are cached and findable but not
selectable without credentials (they would 401 at inference).

Also fixes a latent runtime bug: getProviderBaseUrl returns the first
bundled model's baseUrl, which for ZenMux is the anthropic-routed
/api/anthropic. Discovery then fetched /api/anthropic/models (nonexistent)
instead of /api/v1/models, breaking discovery even for keyed users.
normalizeZenMuxOpenAiBaseUrl now remaps a trailing /api/anthropic back to
/api/v1 before the /models fetch.

Op: correct
Restores: spec:ZenMux runtime discovery reflects newly published models in models.db without a ZENMUX_API_KEY
2026-07-02 13:50:06 +09:00
roboomp 65377c1ca8 style: bun run fix 2026-07-02 04:43:45 +00:00
roboomp 0eb820e7ce fix(coding-agent): scope discoverExtensionPaths to native extension-module provider
`discoverExtensionPaths` loaded the extension-module capability across all
registered providers (native, claude, codex, gemini, opencode) and then
discarded every item whose `_source.provider !== "native"`. Four foreign
directory walks ran on every session startup only for their results to be
dropped — worst on Windows.

Scope the load to the native provider via the existing `LoadOptions.providers`
filter: `loadCapability(extensionModuleCapability.id, { ...loadOptions,
providers: ["native"] })`. The hook-capability load in the same function is
unchanged (hooks legitimately span providers). Output is identical.

Regression test in `extensions-discovery.test.ts` spies on each extension-module
provider's `load()` and asserts only "native" is invoked.

Fixes #4198
2026-07-02 04:43:20 +00:00
metaphorics 621e3f3a82 perf(extensibility): read extension source graph once per load
collectExtensionModules already reads every own-source module's text to scan imports; the onLoad rewrite hook then re-read each file. Return a Map<path,source> from the collector and serve it consume-once in onLoad (delete on first hit, disk fallback on miss), so transitive modules are read once and the entry still re-reads on its ?mtime re-import. Adds a regression test asserting exactly one read per graph module.

Closes #4196
2026-07-02 13:42:13 +09:00
can1357 6c02efa506 chore: remove useless test 2026-07-02 04:56:45 +02:00
can1357 36cfb54e92 chore: bump version to 16.3.0 2026-07-02 04:12:21 +02:00
can1357 c4c0331345 fix(coding-agent/session): prevented data loss in session serialization
- Persist signed message blocks (`text`, `thinking`, `toolCall`) and encrypted reasoning payloads verbatim during session serialization instead of clearing or truncating them.
- Preserve signature keys instead of replacing them with empty strings when they exceed persistence size limits.
- Exempt official first-party OpenAI and Anthropic API endpoints from the leaked-thinking stream healing wrapper to prevent misfires on legitimate visible text fences.
2026-07-02 03:58:10 +02:00
can1357 0d96c2b6ec Merge remote-tracking branch 'origin/farm/bf21f607/frame-rewind-completion'
# Conflicts:
#	packages/coding-agent/src/session/agent-session.ts
#	packages/coding-agent/test/agent-session-checkpoint-rewind-branch.test.ts
2026-07-02 03:56:59 +02:00
can1357 af748c3e90 fix(coding-agent/session): prevented truncation of signed thinking and redacted reasoning blocks
- Excluded signed `thinking` blocks and `redactedThinking` blobs from size-based persistence truncation.
- Preserved signature-bound reasoning verbatim to prevent provider validation failures on session replay.
- Maintained normal truncation behavior for unsigned thinking and standard text blocks.
2026-07-02 03:39:59 +02:00
can1357 21f5728ef8 fix(agent): prevented consuming legacy steering queue during mid-batch interrupts
- Stopped calling the consuming `getSteeringMessages` getter during mid-batch interrupt polls to prevent stranding or dropping messages before they reach the injection boundary.
- Skip subsequent steering checks in the poll loop once an interrupt has already triggered.
- Added a regression test to ensure legacy steering remains queued until the injection boundary when no non-consuming peek exists.
2026-07-02 03:34:14 +02:00
roboomp af26c7ec43 style: bun run fix 2026-07-02 01:33:34 +00:00
roboomp 0b8164facb fix(agent): restored active checkpoints when rehydrating rewind state
The branch-scan rehydrator only rebuilt `#lastCompletedRewind` and wiped
`#checkpointState` unconditionally at entry — so a branch whose latest
checkpoint had not yet been rewound came back with neither an active
checkpoint nor completed-rewind guidance. Reloading such a session (or
`switchSession()` on the same file) made the next `rewind` fail with
"No active checkpoint" even though the checkpoint entry was still the
branch leaf.

Extended the walker to also track the last unresolved checkpoint entry
and, when the branch ends without a rewind-report, seed `#checkpointState`
from that entry (id, `details.startedAt`) so `rewind` can complete
normally. Renamed the method to `#rehydrateCheckpointRewindState` to
reflect the widened responsibility and added a regression test that
truncates the branch to the checkpoint entry, resumes into a fresh
`AgentSession`, and calls `rewind` end-to-end.

Fixes #4187
2026-07-02 01:33:21 +00:00
can1357 dfc6706032 ux(coding-agent/modes): aligned subagents hud layout with todos hud
- Refactored `renderSubagentHudLines` to use `renderTreeList` with dim connectors and a single-space indentation shift.
- Adjusted budget limits to account for the new layout wrapping and tree-list padding.
2026-07-02 03:30:51 +02:00
can1357 3660b0973a chore: revert brain damage 2026-07-02 03:29:30 +02:00
roboomp a030373665 fix(agent): cleared rewind state on session resets
Cleared checkpoint rewind runtime state when starting new sessions or creating branch sessions so stale completed-rewind guidance cannot leak into unrelated contexts.

Added regression coverage for /new and branch reset paths.

Fixes #4187
2026-07-02 01:19:18 +00:00
can1357 31a8cfc31c Merge remote-tracking branch 'origin/farm/38b1b467/llama-cpp-context-size' 2026-07-02 03:17:59 +02:00
roboomp cf570a90f0 fix(agent): rehydrated completed rewind state
Reconstructed the completed rewind marker from the active branch so resumed sessions keep repeat-rewind recovery guidance.

Covered resume rehydration with the checkpoint rewind branch regression test.

Fixes #4187
2026-07-02 03:17:17 +02:00
roboomp e35d772030 style: bun run fix 2026-07-02 01:16:36 +00:00
roboomp e3e79127ba fix(model-discovery): honor --ctx-size for llama.cpp router presets
llama-server in router/preset mode advertises each preset via /v1/models,
but meta.n_ctx / n_ctx_train are only merged in after the preset's child
instance loads. The router-level /props returns a dummy n_ctx: 0. As a
result every unloaded preset fell through to DISCOVERY_DEFAULT_CONTEXT_WINDOW
(128000), and picking a preset from /model kept surfacing 128k in the
status bar regardless of the configured --ctx-size — a restart didn't
help because discovery repopulated the cache from the same broken chain.

Parse each entry's status.args (rendered CLI vector) for --ctx-size or
-c, and fall back to ctx-size = N in status.preset (INI). Positive values
slot between runtimeContextWindow and serverMetadata in the resolution
chain so a running child's live n_ctx still wins; --ctx-size 0 ("loaded
from model") is correctly skipped so we don't publish 0.

The same fallback wires through discoverLlamaCppModelRuntimeMetadata so
the refresh triggered by /model uses the configured window even before
the child spawns.

Fixes #4190
2026-07-02 01:16:23 +00:00
roboomp 125dd36ead fix(agent): rehydrated completed rewind state
Reconstructed the completed rewind marker from the active branch so resumed sessions keep repeat-rewind recovery guidance.

Covered resume rehydration with the checkpoint rewind branch regression test.

Fixes #4187
2026-07-02 01:09:44 +00:00
can1357 3128eab271 chore: update changelogs 2026-07-02 03:08:59 +02:00
can1357 0159d86023 Merge remote-tracking branch 'origin/farm/bf21f607/frame-rewind-completion' 2026-07-02 03:08:23 +02:00
can1357 5dcf2ad197 chore: cleanup 2026-07-02 03:08:16 +02:00
can1357 b149cfce71 feat(coding-agent): implemented targeted mid-run todo nudges for mutating tools
- Refactored the mid-run todo nudge to trigger on mutating tools (bash, eval, edit, write, ast_edit) rather than overall tool turns.
- Simplified the nudge prompt template to a concise, non-escalating reminder.
- Migrated nudge messages from "developer" role with public events to a hidden "custom" role that is excluded from the TUI and transcript.
- Introduced a separate per-cycle reminder cap of 2 to decouple mid-run hints from the user-visible stop-time escalation budget.
- Avoided triggering the todo nudge when read-only exploration tools (e.g. grep, read, glob, lsp) or errored results are returned.
2026-07-02 03:03:23 +02:00
Can Bölük 8e68b26315 Merge pull request #4185 from DeprecatedLuke/feat/make-token-info-nice
feat/make token info nicer
2026-07-02 02:59:04 +02:00
roboomp d68c36ca74 style: bun run fix 2026-07-02 00:56:26 +00:00
roboomp 1109c25629 fix(agent): framed completed rewind context
Wrapped retained rewind reports with completion guidance so the post-rewind turn knows the checkpoint is closed.

Added repeat-rewind recovery errors and regression coverage for both the retained context and no-active-checkpoint path.

Fixes #4187
2026-07-02 00:56:06 +00:00
Can Bölük d1eae1eb00 Merge pull request #4185 from DeprecatedLuke/feat/make-token-info-nice
feat/make token info nicer
2026-07-02 02:54:11 +02:00