Commit Graph
6612 Commits
Author SHA1 Message Date
usr_bin_roygbiv 7d62f2702f test(prompts): add mathematical formatting prompt verification test 2026-06-14 00:59:20 -05:00
usr_bin_roygbiv 7b64e9c3b3 fix(prompts): instruct models to avoid LaTeX math delimiters and commands 2026-06-14 00:59:20 -05:00
can1357 1f9a1bd67b feat(coding-agent/web): added support for scraping GitHub commit URLs
- Extended GitHub URL parsing to recognize commit paths and extract commit refs.
- Implemented a commit renderer that fetches commit metadata, stats, and file patches from the GitHub API.
- Added a handler branch to render commit URLs to markdown with `github-commit` results metadata.
2026-06-14 07:54:04 +02:00
usr_bin_roygbiv bddfd478ac fix(coding-agent/utils): remove extra closing brace in title-generator 2026-06-14 00:35:04 -05:00
can1357 cd00003829 fix(coding-agent/session): stopped post-prompt recovery waits after aborted generations
- Added a generation-aware early-exit check in `#waitForPostPromptRecovery` to return when the prompt turn is superseded.
- Passed the current prompt generation into the post-prompt recovery wait after prompting.
- Ensured aborted prompts no longer block while later queued retry/follow-up turns drain.
2026-06-14 07:29:23 +02:00
can1357 74bfcabc35 fix(coding-agent): fixed JS eval helper positional args and URI read slicing
- Updated JS eval helper option parsing to accept positional optional args or a trailing plain-object options argument, while rejecting mixed or invalid forms.
- Updated `read` to route non-`local://` URI paths through the `read` tool with line selectors so offset/limit slicing works for artifact-style resources.
- Expanded JS executor tests for positional reads, nullable slot skipping, and delegated URI read slicing.
2026-06-14 07:27:16 +02:00
can1357 94ebe3b509 feat(coding-agent/task): adjusted embedded task agent thinking levels
- Removed the `task` embedded agent's explicit `thinkingLevel` assignment.
- Updated the `quick_task` agent to use `Effort.Medium` instead of `Effort.Minimal`.
2026-06-14 07:20:50 +02:00
can1357 6c616ca847 fix: fixed OpenAI promotion linking for namespaced gpt-5.5 variants
- Updated OpenAI context promotion linking to resolve target models by parsed version and provider/API match instead of fixed bare ids.
- Scanned available siblings to select the plainest matching gpt-5.4 fallback so namespaced, dotted, and dated 5.5 variants promote correctly.
- Adjusted the TUI render stress shadow writer to ignore alternate-screen regions and replay only normal-screen bytes after exits.
2026-06-14 07:14:11 +02:00
can1357 038cf5b8de Merge remote-tracking branch 'origin/farm/a635c8cc/fix-resolve-gate-thinking' 2026-06-14 07:02:46 +02:00
can1357 233ee852cd feat(snapcompact): added spacing-tuned snapcompact variants and updated provider defaults
- Added 8on22-bw and 11on16-bw variants with spacing-tuned defaults for snapcompact.
- Changed provider defaults/mappings to use 11on16-bw for Anthropic and 8on22-bw for OpenAI/Google.
- Updated model frame rules so claude/fable/opus and gemini/gpt families map to new shapes and 2048 billing behavior.
- Fixed non-multiplexer resize dragging by using alternate screen during transient resize frames.
2026-06-14 07:02:27 +02:00
metaphorics 1df62df826 test(coding-agent): cover learned-lesson injection budget exhaustion
Grill test-gap finding: the learned-lesson read-back had no coverage for the
budget clamp when a memory summary already fills `summaryInjectionTokenLimit`.
Add a case with an oversized summary asserting the lesson is dropped and the
combined block stays bounded.
2026-06-14 14:00:20 +09:00
metaphorics 28cf423172 fix(coding-agent): make auto-learn activation, guidance, and controller consistent
Grill findings on the auto-learn change-set — the controller nudge, the standing
guidance, and the actual tool availability could disagree:

- Guidance was rebuilt from live `autolearn.enabled`, so a mid-session enable (or
  a subagent that filtered the tools out) injected guidance for tools the session
  never built. `buildAutoLearnInstructions` now takes `{ manageSkill, learn }` and
  is driven by the auto-learn BUILTINS that `createTools` actually built
  (`builtInToolNames`) — provenance, so a same-named custom/extension tool can't
  trigger it while auto-learn is off.
- The controller install reverted to gate on `autolearn.enabled && taskDepth === 0`:
  the tool registry is built once at session start, so installing it while disabled
  would nudge toward absent tools. The fire-time re-check still handles a
  mid-session disable.
- Force-included auto-learn tools are now ACTIVATED for restricted top-level
  sessions (mirroring the `yield` invariant), so a session with an explicit tool
  whitelist actually exposes manage_skill/learn instead of building them inactive.

Tests: guidance gating by tool presence (none/manage-only/learn), restricted-session
activation via createAgentSession, and removal of the obsolete mid-session-enable
controller case.
2026-06-14 14:00:19 +09:00
metaphorics 12c4078b4b fix(coding-agent): harden managed-skill writes (symlink root, empty content, races)
Grill findings on the auto-learn change-set:

- Reject a symlinked managed-skills ROOT (not just the per-skill dir): lstat on a
  child follows intermediate components, so a symlinked root would let an
  otherwise-valid name write/delete outside the isolated directory. Added
  `assertManagedRootSafe()` to create, update, and delete.
- Reject empty content: an all-whitespace/control description sanitizes to "" and
  the `requireDescription` discovery scan then silently drops the skill, so the
  tool would report success for a skill that never appears. Reject empty
  description/body before writing.
- Serialize create/update/delete on the same skill name (`serializeSkillMutation`):
  both tools are non-exclusive, so a parallel batch could interleave (e.g. update
  observing the file mid-delete). O_EXCL only covered duplicate-create.

Tests: symlinked root/dir/file rejection (create + update + delete), empty
description/body, concurrent create+update ordering, concurrent-create one-winner.
2026-06-14 14:00:19 +09:00
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
metaphorics 66da2aabef fix(coding-agent): tighten learn/manage_skill input contracts
- learn (mnemopi): `rememberScoped` returns undefined when the retain failed
  (closed DB / disk error). The tool ignored it and reported "Lesson stored"
  (and could still mint a skill), silently losing the lesson. Mirror
  `mnemopiBackend.save` and fail loudly when no id is returned.
- manage_skill: enforce the action/field contract in the schema via a cross-field
  refine (create/update require description+body; delete needs only name) instead
  of relying solely on a runtime throw in execute. Kept as a refine, not a
  discriminated union, so the wire schema stays a single root object — both
  strict structured-output mode and the Anthropic tool-schema builder require
  that.

Addresses review threads on PR #2542 (threads 19, 14).
2026-06-14 12:51:59 +09:00
metaphorics f84ed4ddc6 fix(coding-agent): clamp learned-lessons injection budget to non-negative
`truncateByApproxTokens` appends a truncation marker, so a truncated memory
summary can exceed `limit * 4` chars and drive the remaining lessons budget
negative. Clamp to 0 and skip lessons entirely when the summary already fills the
budget, instead of feeding a negative limit to the truncator.

Addresses review thread on PR #2542 (thread 15).
2026-06-14 12:51:58 +09:00
metaphorics f83084c92c docs(coding-agent): pin load-bearing custom-dir vs managed skill ordering
The managed-skill discovery block vetoes a name already in `skillMap` to let a
custom-directory authored skill win. Custom dirs never enter `result.all`, so
they are absent from `enabledAuthoredNames` — the map check is the only veto, and
it only works because the custom-dir loop runs first. Add a comment so a future
refactor doesn't invert the order.

Addresses review thread on PR #2542 (thread 7).
2026-06-14 12:51:58 +09:00
metaphorics 449e0e6803 fix(coding-agent): create managed skills atomically with O_EXCL
`writeManagedSkill` resolved create-vs-update with a check-then-write, so two
concurrent creates for the same name could both pass the existence check and the
second would stomp the first. Create now uses an `O_CREAT|O_EXCL` ("wx") write
that fails atomically if the file exists (closing the race) and refuses to
follow a symlinked `SKILL.md`. Update keeps the lstat existence + symlink guard.

Addresses review thread on PR #2542 (thread 6).
2026-06-14 12:51:58 +09:00
metaphorics 62c3d50498 fix(coding-agent): always install auto-learn controller for top-level sessions
The controller was only constructed when `autolearn.enabled` was true at
`createAgentSession` time. Because `newSession` reuses the session without
rerunning startup, enabling the setting via the UI mid-session never installed
the listener, so the feature stayed inert until the app was recreated. The
controller already re-checks the live flag at fire time, so install it for every
top-level session and let that check gate activation; when disabled it only
counts tool calls and returns.

Addresses review thread on PR #2542 (thread 18).
2026-06-14 12:51:57 +09:00
usr-bin-roygbiv 82868435c3 fix(coding-agent/config): allow google-gemini-cli in models-config schema 2026-06-13 22:50:49 -05:00
roboomp f5d54e4acd fix(providers): downgraded forced tool choice for kimi
Added OpenAI-compatible compat metadata for endpoints that allow tools but reject forced tool_choice. OpenCode Go kimi-k2.7-code now downgrades resolve-gate forcing to auto tool selection while preserving thinking-mode request state.\n\nFixes #2546
2026-06-14 03:41:00 +00:00
metaphorics c84c9d4086 fix(coding-agent): harden auto-learn suppression and skip goal mode
Two controller bugs from review:

- The post-stop nudge still queued a passive `nextTurn` message during goal
  mode (goal mode only disabled `autoContinue`). That message rides the goal
  continuation and can divert the goal loop into capture. Return early when
  goal mode is active.
- `#suppressNext` was latched before the fire-and-forget `sendCustomMessage`.
  It must arm synchronously (the synthetic turn's `agent_end` fires inside
  `sendCustomMessage` before it resolves), but a rejected or *deferred* dispatch
  (ACP clients downgrade `triggerTurn` to a queue) then produces no `agent_end`,
  so the latch swallowed the next real stop. `sendCustomMessage` now returns
  whether it actually started a turn; the controller disarms the latch when no
  turn ran (rejection or deferral).

`task/executor.ts` widens its pending-message array to `Promise<unknown>[]` to
absorb the new return type (the resolved values are discarded).

Addresses review threads on PR #2542 (threads 5, 9, 12).
2026-06-14 12:36:32 +09:00
metaphorics 3047e500e6 fix(coding-agent): install auto-learn controller before memory startup
The `AutoLearnController` was constructed inside the fire-and-forget
`startMemoryStartupTask`, after `await memoryBackend.start()`. With a slow
backend (Mnemopi/Hindsight) a fast first turn could begin and finish before the
event listener subscribed, dropping that turn's tool events so no nudge fired.
Install the controller synchronously, before the backend task, so the listener
is registered before any turn can run.

Addresses review thread on PR #2542 (thread 10).
2026-06-14 12:36:32 +09:00
metaphorics 16bad4b47e fix(coding-agent): refuse symlinked managed-skill write targets
`writeManagedSkill` wrote `<managed-dir>/<name>/SKILL.md` via `Bun.write`,
which follows symlinks. A planted symlink at the `<name>` directory (or the
`SKILL.md` itself) could redirect the write outside the isolated managed root
and clobber a user-authored skill, breaking the isolation guarantee. lstat the
parent directory and the file and reject symlinks before writing; the existence
check now derives from the same lstat instead of a separate `Bun.file().exists()`.

Addresses review thread on PR #2542 (thread 11).
2026-06-14 12:36:31 +09:00
metaphorics 34c7f106d9 fix(coding-agent): restrict auto-learn tools to top-level sessions
The `manage_skill`/`learn` force-include and `isToolAllowed` gates only
checked `autolearn.enabled`, not session depth. A subagent created with an
explicit `tools:[...]` whitelist (which runs `approvalMode: "yolo"`) would
silently gain write-capable tools that can mutate `~/.omp/agent/managed-skills`.
The auto-learn controller only runs for top-level sessions, so gate both the
force-include and `isToolAllowed` for `manage_skill`/`learn` to `taskDepth === 0`.

Also tidies the gating test file: drop a module-level `Bun.env` mutation that
was never restored (the test runner skips the Python preflight already) and a
no-op `afterEach` homedir spy in a block that never mocks homedir. Adds a
subagent-exclusion test.

Addresses review threads on PR #2542 (threads 2, 3, 8, 16).
2026-06-14 12:36:31 +09: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
metaphorics 9662844853 feat(coding-agent): support the local memory backend in the learn tool
The `learn` tool previously required a `hindsight`/`mnemopi` backend. It now
also works when `memory.backend` is `local` (the file-based rollout backend):
lessons append to a `learned.md` under the project's memory root, kept separate
from the consolidation artifacts so a consolidation pass never clobbers them,
and are injected into future sessions alongside the memory summary.

- memories: `saveLearnedLesson` (newest-first, deduped, count- and per-field
  size-capped, secret-redacted, injection-neutralized) with per-path write
  serialization; `buildMemoryToolDeveloperInstructions` reads `learned.md` and
  shares one injection budget with the summary; `redactSecrets` extended with
  GitHub/npm/Slack/Google token prefixes.
- local backend: implements `save()`; status reports `writable: true`.
- learn tool: `local` execute branch; `createIf`/`isToolAllowed`/auto-include
  and the standing guidance extended to `local`; local saves tier as a `write`
  approval.
- read-path prompt: renders the learned-lessons block when present.
- Lessons are injection-neutralized and secret-redacted on BOTH write and read
  (they render unescaped into the system prompt).

Also moves the auto-learn CHANGELOG entry out of the released [15.12.6] section
(a cherry-pick artifact) back under [Unreleased] and notes the local backend.

Tests: local storage (format, dedup, cap, redaction incl. provider/delimiter-
split tokens, concurrency), read-back (with/without summary, off-gating, raw
hand-edited file), tool gating + write-approval tiering.
2026-06-14 12:03:13 +09: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
metaphorics 42626b8c44 feat(coding-agent): make task.eager and todo.eager three-level eagerness enums 2026-06-14 11:09:29 +09:00
metaphorics 18ee97751a feat(coding-agent): opt-in experimental auto-learn (memory + isolated managed skills)
Add a default-off "auto-learn" loop. When `autolearn.enabled` is set, after the
agent stops a session controller nudges it to capture reusable lessons: durable
facts go to long-term memory and repeatable procedures become "managed skills" —
SKILL.md files written to an isolated ~/.omp/agent/managed-skills directory that is
discovered and surfaced like authored skills but never overwrites them.

Two tools back this:
- `manage_skill` — create/update/delete managed skills.
- `learn` — record a lesson, optionally minting/enhancing a managed skill in the
  same call (requires a hindsight/mnemopi memory backend).

The nudge is passive by default (a hidden reminder rides the next turn);
`autolearn.autoContinue` instead auto-runs one capture turn at stop, and
`autolearn.minToolCalls` (default 5) gates trivial turns. Plan/goal-mode turns and
subagents are never nudged, and the controller re-checks the live setting at fire
time so a mid-session opt-out takes effect.

Isolation & precedence: managed skills are a separate lowest-priority discovery
provider, so an authored skill of the same name wins across every provider and
custom directory regardless of third-party toggles; a disabled higher-priority
authored skill can never hide a managed one, and managed never masks an enabled
authored skill. Managed names and descriptions are sanitized on both write and
read (control/format chars, angle brackets, and Markdown fences) before they render
into the system prompt, and the SKILL.md byte cap is enforced on the final
serialized file.

Default off → zero footprint when disabled.
2026-06-14 10:45:23 +09: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