Commit Graph

6107 Commits

Author SHA1 Message Date
can1357 e2e37dcde6 fix(coding-agent): fixed stale loader recovery and updated catalog model constraints
- Stopped and cleared the working loader before auto-compaction and auto-retry.
- Ensured stale loadingAnimation is removed so agent_start recreates the Working loader.
- Set catalog model input/output costs to 0.09/0.18 and reduced maxTokens to 65536.
2026-06-14 06:59:26 +02:00
can1357 258f030ddf fix(tui): fixed resize fast-path repaint to avoid full-screen clearing during drag
- Updated the resize fast-path repaint to remove the terminal full-screen clear and instead overwrite the viewport in place at home, rewriting each row via `#lineRewriteSequence`.
- Passed the viewport width into `#emitResizeViewport` so each row self-clears only its tail with CSI K while resize drag remains active.
- Added coverage in `resize-viewport-defer.test.ts` confirming drag-time writes omit ED2/ED3 clears and that ED3 is emitted when the resize settles.
2026-06-14 05:27:47 +02:00
can1357 c4ef8839d5 feat(tui): added large-paste collapse flow with threshold and attachment fallback
- Added `paste.largeMenuThreshold` setting with default 100 and values 0/100/250/500/1000.
- Added `Editor.onLargePaste` and `Editor.insertPaste` to intercept oversized pastes and expand markers.
- Added threshold-based large-paste routing to show the menu and wrap oversized content for code/XML or attachment fallback.
- Added tests for large-paste interception, fallback behavior, short-paste handling, and marker expansion.
2026-06-14 05:20:55 +02:00
can1357 529950711a feat(coding-agent): added smart adaptive poll wait mode for job polling
- Added a smart poll-wait mode to AsyncJobManager with per-owner escalation ladder logic and a reset timer for idle pauses.
- Updated job polling to use the adaptive wait when `async.pollWaitDuration` is `smart` and to record poll completion timing for subsequent waits.
- Expanded async job settings and tests so `smart` is the default option and escalation, reset, and owner isolation behavior are covered.
2026-06-14 05:19:02 +02:00
can1357 86245d722a fix(coding-agent): gated agent hub opening when no subagents are available
- Added an `isEmpty` getter on `AgentHubOverlayComponent` to report whether no subagent rows were loaded.
- Extended `showAgentHub` with an optional `requireContent` flag so the overlay is disposed early when empty under the double-<- path.
- Added tests for double-<- gating behavior with no subagents, with subagents, and explicit hub-open behavior.
2026-06-14 05:18:35 +02:00
can1357 0ee1b111ba fix(coding-agent): fixed duplicate model-role cycle track in chat scrollback
- Moved the ctrl+p model-role cycle rendering from `showStatus` to a dedicated anchored cycle container above the editor.
- Updated InteractiveMode to rebuild the cycle container in place and auto-clear the track after 4 seconds.
- Added tests that validate no scrollback stacking, in-place replacement, and timer-based clearing behavior.
2026-06-14 05:02:04 +02:00
can1357 a1d1d4c44f feat(coding-agent/modes): added shared compact divider for handoff summary
- Routed `customType: "handoff"` messages to the compact divider path in Agent Hub and UI helpers.
- Added handoff summary expansion that extracts context text and strips `<handoff-context>` wrappers.
- Refactored shared divider rendering into `SummaryDividerComponent` used by compaction and handoff messages.
2026-06-14 04:29:11 +02:00
can1357 d63b1530f8 feat(coding-agent): added snapcompact savings journaling for imaged tool results
- Added a `snapcompact-savings.jsonl` append-only journal for per-tool savings records.
- Extended `SnapcompactInlineTransformer` to compute `savedTokens` and emit savings to an optional sink.
- Integrated `createSnapcompactSavingsRecorder` into `createAgentSession` for session-aware tool-result metrics.
- Skipped journaling entries without a session and deduped duplicate `toolCallId`s per recorder lifecycle.
- Added tests for savings-sink emissions and savings-journal read/write behavior.
2026-06-14 04:28:43 +02:00
can1357 323c666ebf fix(coding-agent): hardened left-double-tap gesture handling against bursty arrow events
- Hardened left-arrow double-tap handling with a new detector that only fires on a second tap in a 40--500ms window.
- Reused that detector for both Agent Hub opening and focused-subagent return so terminal-synthesized burst taps no longer trigger navigation.
- Added gesture tests for deliberate doubles, burst suppression, minimum-gap filtering, and focused-subagent unfocus behavior.
2026-06-14 04:27:39 +02:00
can1357 4b37b79dcb fix(coding-agent/test): align merged tests with current session-context export and compaction-queue context 2026-06-14 03:39:38 +02:00
can1357 ca779a9eef Merge PR #2519: classify HTML export theme defaults by status-line luminance 2026-06-14 03:32:54 +02:00
can1357 9490c659b2 Merge PR #2508: add mnemopi embedding variant setting 2026-06-14 03:32:54 +02:00
can1357 afc0f8c2d2 Merge PR #2502: add guided-goal setup interview 2026-06-14 03:32:53 +02:00
can1357 caadf88953 Merge PR #2522: make /fast default scope configurable 2026-06-14 02:59:37 +02:00
can1357 90fe4995cf Merge PR #2513: /plan exits paused state back to mode none 2026-06-14 02:59:26 +02:00
can1357 0b4efb365d Merge PR #2524: stop AgentBusyError on plan approval and loop/goal continuations 2026-06-14 02:59:26 +02:00
can1357 98fc23899f Merge PR #2533: renumber image markers when restoring queued messages
# Conflicts:
#	packages/coding-agent/test/input-controller-compaction-image.test.ts
2026-06-14 02:59:17 +02:00
can1357 7ca0ca3b06 Merge PR #2530: restore compaction-queued messages on Alt+Up dequeue 2026-06-14 02:57:25 +02:00
can1357 83b00e79a1 Merge PR #2520: run plan-approval compaction on the plan model 2026-06-14 02:57:19 +02:00
can1357 4d01e5e703 Merge PR #2490: clean up compaction UI lifecycle 2026-06-14 02:57:18 +02:00
can1357 81bf6ee965 Merge PR #2506: glow magic keywords through cursor seam + focused shimmer 2026-06-14 02:57:08 +02:00
can1357 0c8cee3080 Merge PR #2521: clamp editor height and overlays on small terminals 2026-06-14 02:56:57 +02:00
can1357 eb5cc85eed Merge PR #2528: emit per-turn token-usage row as standalone block 2026-06-14 02:56:50 +02:00
can1357 dddfc3320c Merge PR #2526: phase-lock tool-call spinners across parallel calls 2026-06-14 02:56:44 +02:00
can1357 f66b14958d Merge PR #2489: memoize tool-result rendering 2026-06-14 02:56:37 +02:00
can1357 686f23a925 Merge PR #2488: TUI event-loop watchdog + phase breadcrumbs 2026-06-14 02:56:31 +02:00
can1357 4fe11fcbf5 Merge PR #2481: work-aware subagent roster (role + activity) [#2478-2481] 2026-06-14 02:56:21 +02:00
can1357 19766762cd chore: bump version to 15.12.6 2026-06-14 02:35:06 +02:00
can1357 f44cf57f9b test(coding-agent): stop auto-compaction queue test from OOM-looping
The continue() mock used mockResolvedValue(), which never consumed the
queued follow-up. After threshold compaction, #endInFlight ->
#drainStrandedQueuedMessages -> #scheduleQueuedMessageDrain reschedules a
zero-delay continue whenever messages remain queued, so the no-op mock spun
the drain into an unbounded microtask loop that allocated until the test
worker OOM'd (~101GB) and segfaulted, taking sibling tests down with it.

Mirror real continue() semantics (it polls and consumes the queue) by
clearing the queues in the mock, matching the sibling steer-idle-drain
tests. The drain now settles after one resume.
2026-06-14 02:34:24 +02:00
roboomp f41007d7da style: bun run fix 2026-06-14 00:24:34 +00:00
roboomp 2e431c0c21 fix(coding-agent): renumber image markers when restoring queued messages
`restoreQueuedMessagesToEditor` prepended queued text but appended queued
images to `pendingImages`. Positional `[Image #N]` lookup at submit time
therefore broke whenever the editor draft already held pending image(s):
queued markers (numbered 1..K against their own image list) collided with
draft markers (1..M) and resolved to the wrong images; queued images
landing past slot M were orphaned.

Add `shiftImageMarkers(text, offset)` to `image-references.ts` and have
`restoreQueuedMessagesToEditor` walk each queued message in order,
shifting its markers by the running pending-image count (existing draft
images plus images already pulled in from earlier queued messages). Draft
markers stay untouched because draft images keep their original slots.
Paste markers are left alone — those are owned by the editor's paste store,
not the pending-image buffer, and queued message text never carries
unmaterialized `[Paste #N]` because the editor expands paste markers in
`getExpandedText()` before `onSubmit` fires.

Regression test seeds a draft image + a queued image-message in
`input-controller-compaction-image.test.ts` (per acceptance) and locks the
marker -> image mapping after restore. Unit tests for
`shiftImageMarkers` cover the WxH tail, Paste-marker passthrough, and
the zero-offset no-op.

Fixes #2531
2026-06-14 00:24:28 +00:00
can1357 24c8bb24c6 feat(session): added modular session APIs and rebuilt listing/persistence behavior
- Added session-domain modules and exports for session-entries, context, listing, loader, and migrations.
- Changed persistence to async append writes plus writeTextAtomic, removing sync line APIs.
- Added compaction-aware session context rebuild with dangling tool-call cleanup.
- Added resumable session resolution with status inference, id/stem/suffix matching, and backup recovery.
2026-06-14 02:02:53 +02:00
metaphorics 39883fd8bf test(coding-agent): type clearQueue stub to drop unsafe cast in restore test
Address PR review: the makeCtx session stub typed clearQueue() as
returning string[], forcing an `as unknown as` cast when the ordering
test overrode it with message objects. Type the stub to the real
RestoredQueuedMessage[] shape so the override needs no cast and shape
drift is caught at compile time.
2026-06-14 08:54:29 +09:00
metaphorics 219fa0765c fix(coding-agent): obfuscate guided-goal transcript before provider calls
runGuidedGoalTurn sent the rendered interview transcript to the plan/slow
provider as raw text, so a secret typed into the rough goal or an answer
bypassed the session's redaction contract. Route the transcript through the
session obfuscator before the request and deobfuscate the echoed question /
objective before it is displayed or the goal starts (no-op when no secrets
are configured).
2026-06-14 08:51:59 +09:00
metaphorics aeebcbb6c2 feat(irc): work-aware peer roster with role and activity
Add a display-only `activity` field to AgentRef plus `setActivity`, fed
from the subagent progress chokepoint with a short gist of the agent's
latest intent (or current tool). Render it in the `irc list` output, the
subagent peer roster, and the TUI peer card, beside the role-derived
display name. setActivity emits no event — the roster reads on demand —
so the per-tool-call rate stays off the registry listener path. Peers
with no activity render without a dangling clause.

Refs #2470

Op: extend
2026-06-14 08:47:01 +09:00
metaphorics a6cce473ac feat(task): nudge generic spawns toward specialization
When a spawner with remaining depth capacity spawns generic role-less
workers (a task/quick_task spawn without a `role`, or the same agent
cloned >=2x all without roles), TaskTool.execute appends a non-blocking
advisory steering it toward tailored specialists. Gated on DepthCapacity
so a leaf at max recursion is never nudged; the task-tool depth gate is
extracted into a shared `canSpawnAtDepth` helper reused by both the tool
gate and the advisory.

Refs #2469

Op: extend
2026-06-14 08:47:01 +09:00
metaphorics ecb46fc72b feat(task): advertise role and tailored delegation in task prompts
Document the `role` parameter in the task-tool description (both the
batch and single-spawn shapes) and make tailored specialists the default
rule, not the exception. Direct a recursing worker to pass a `role` for
each sub-specialist. Activates the role field from #2467 for the model.

Refs #2468

Op: extend
2026-06-14 08:47:01 +09:00
metaphorics 5e5e237005 feat(task): inline role specialization for spawned subagents
Add an optional `role` field to the task spawn contract, threaded end to
end through resolveSpawnItems/spawnParamsFor into the executor. A role
injects a specialization preamble into the subagent system prompt and
becomes the subagent's display name and telemetry identity (label
normalized, length capped), so delegated trees stop being clones of one
generic worker. Empty/absent roles fall back to the agent type name.

Refs #2467

Op: extend
2026-06-14 08:47:01 +09:00
metaphorics d2f3c6ea7e refactor(coding-agent): extract /fast status label into a helper
Addresses Copilot review on #2522: the nested ternary building the /fast
status label was duplicated across the ACP and TUI handlers. Extracted
formatFastModeStatus(session) (a switch over serviceTier) so the wording
stays consistent and new tiers/scopes are added in one place. No behavior
change.
2026-06-14 08:42:23 +09:00
metaphorics a95be2860f fix(tui): honest editor-height floor and dead-branch cleanup
Addresses Copilot + Codex review on #2521:

- computeEditorMaxHeight returned 1 on terminals too small to host both the
  editor and the chrome reserve, but the bordered editor never renders fewer
  than 3 rows (2 border + 1 content). The cap now floors at that real minimum
  (EDITOR_MIN_RENDERED_ROWS) so it no longer misreports the rows the editor
  occupies; rendering is unchanged, and the contract is documented honestly
  (reserve holds once terminalRows >= 7).
- #resolveOverlayLayout now always resolves maxHeight (?? availHeight), so the
  maxHeight !== undefined branch in effectiveHeight, the composite slice guard,
  and the number | undefined return type were dead. Tightened all three.
- Mirrored the maxHeight-default contract in the render stress oracle
  (resolveExpectedOverlayLayout + compositeExpectedOverlays) so the randomized
  sweep validates the real clipped geometry instead of the obsolete unclipped
  one; updated the oracle helper test expectation accordingly.

Editor-height tests rewritten to assert the real contract (reserve when the
terminal can host both; pinned to the bordered minimum below that).
2026-06-14 08:40:12 +09:00
metaphorics f6d69620f9 fix(coding-agent): restore compaction-queued messages on Alt+Up dequeue
restoreQueuedMessagesToEditor only drained the agent steering/follow-up
queue via session.clearQueue(), but the "Alt+Up to edit" pending-bar
hint is rendered for both that queue and ctx.compactionQueuedMessages.
Messages typed while the session was compacting -- including /skill:*
follow-ups, which the follow-up path routes to the compaction queue
before its skill check -- were advertised by the hint yet unreachable,
so Alt+Up reported "No queued messages to restore".

Drain compactionQueuedMessages alongside the agent queue, merged in the
same order the pending bar renders (session-steer, compaction-steer,
session-follow-up, compaction-follow-up). The existing text-join, image
hand-back, and abort paths operate on the merged list unchanged.
2026-06-14 08:39:18 +09:00
metaphorics 0ad4c8525c fix(coding-agent): restore model on compaction cancel and before queue flush
Addresses Codex review on #2520:

- Cancel path: `#approvePlan` returned on `compactOutcome === "cancelled"`
  without restoring the deferred pre-plan model, stranding the next turn on
  the plan model and leaking `#planModePreviousModelState`. The model
  transition now runs for the cancelled outcome too (the operator aborted
  only the compaction, not the approval) before the early return.
- Queue-flush ordering: `executeCompaction` flushes input queued during
  compaction before returning, so the post-return model switch landed after
  the queued turn began streaming (deferred one turn via #pendingModelSwitch).
  Added a `beforeFlush(outcome)` hook to `executeCompaction`/`handleCompactCommand`;
  `#approvePlan` runs the transition through it (and idempotently re-runs it
  afterward to cover the message-count short-circuit).

Tests cover the cancel restore and the before-flush ordering.
2026-06-14 08:33:10 +09:00
can1357 17ba881c5a feat(coding-agent/utils): added title marker fallback for non-forced tool-choice models
- Added new system prompts that ask models to emit titles inside `<title>` markers when forced tool calls are unavailable.
- Updated `generateTitleOnline` to use marker-based prompting and disable required `set_title` tool calls for models that do not support forced tool choice.
- Adjusted title parsing to extract the `<title>...</title>` value and fall back to stripped marker text when wrapping tags are incomplete.
2026-06-14 01:32:47 +02:00
can1357 9a26a945a7 fix: dropped unavailable forced toolChoice and added runtime fallback recovery
- Validated queued toolChoice against active tools in agent and coding-agent sessions.
- Rejected queued forced choices with reason "unavailable" when selected tools were inactive.
- Dropped provider toolChoice payloads when requested function tools were not offered.
- Probed Tokio worker-thread support and fell back to current-thread runtime creation.
2026-06-14 01:32:47 +02:00
can1357 65880477fe docs(coding-agent/modes): documented fix for unmatched OSC 133 command markers
- Added a changelog entry describing that submitted user messages no longer pair OSC 133 command-start markers with missing end markers.
- Annotated the user-message component with guidance to avoid emitting OSC 133 command-start markers for submitted prompts.
2026-06-14 01:32:46 +02:00
can1357 ef2304aaca fix(coding-agent/modes): removed redundant OSC133 final zone marker
- Removed the unused OSC133 final zone marker constant from the user message component.
- Stopped appending the final OSC133 marker so rendered messages now end with only the shell integration close code.
2026-06-14 01:32:46 +02:00
metaphorics d7f4d7c679 fix(mnemopi): address review — read-only opens skip reconcile; preserve MNEMOPI_EMBEDDING_MODEL precedence (#2476) 2026-06-14 08:27:15 +09:00
metaphorics 67cf33ed2d fix(coding-agent): clean up compaction UI lifecycle
executeCompaction added a transcript Spacer(1) the handoff path never adds; it leaked as an orphan blank line on cancelled/failed compaction (only the OK branch cleared it via rebuildChatFromMessages). Removed it, and on the OK branch the loader is stopped + statusContainer cleared before the rebuild so the live loader no longer composites over the reconciled transcript. The finally block stays as the idempotent cancel/fail safety net.
2026-06-14 08:25:57 +09:00
metaphorics ee45472c05 fix(coding-agent): memoize tool-result rendering to stop per-frame re-shape stalls
ToolExecutionComponent.#updateDisplay() re-ran renderResult (O(result-size)) on every invalidate - spinner ticks, stream chunks, resizes, keystrokes - so large results blocked the loop for seconds and typing lagged. It now early-returns on an unchanged dirty key (result version, expanded, partial, spinner frame, image visibility, theme epoch), and theme.ts exposes getThemeEpoch() bumped on every theme swap so cached blocks re-render on theme change.
2026-06-14 08:23:57 +09:00
metaphorics 2b126ffb80 feat(tui): add event-loop watchdog and phase breadcrumbs for stall diagnosis
Always-on LoopWatchdog (armed in TUI.start/stop) logs ui.loop-blocked with blockedMs and the current loop phase on the rising edge of a late probe tick. New pushLoopPhase/popLoopPhase/currentLoopPhase stack in pi-utils feeds it; breadcrumbs at in-process subagent dispatch (subagent:<id>) and the SelectList fuzzy filter (ui.select-filter) attribute residual main-thread stalls.
2026-06-14 08:23:05 +09:00