Commit Graph

40 Commits

Author SHA1 Message Date
can1357 388e6462c3 fix(coding-agent): fixed cold-launch scrollback and frozen abort labels
- Cleared native scrollback on `omp`/`omp -c` so the resumed transcript no longer stacks on the prior run's welcome screen.
- Tracked assistant block finalization so aborted streaming messages stay repaintable when status rows land beneath them on ED3-risk terminals.
2026-06-05 23:50:49 +02:00
can1357 da636e3f51 feat(coding-agent): enabled clickable image and path links across chat and tools
- Added image-reference rendering to make `[Image #N]` placeholders clickable in chat.
- Added MIME-aware image blob materialization with extensioned sidecar paths.
- Added clickable path, line, and URL hyperlinks for read, search, and fetch outputs.
- Hardened OSC8 hyperlink emission with URI validation and control-byte/idempotency checks.
2026-06-05 23:38:22 +02:00
can1357 70c94efabe fix(coding-agent): froze live region by block finalization state
- Replaced bottom-most-block liveness with a finalization check so the live region spans every still-mutating block.
- Kept unfinalized tools repaintable when out-of-band inserts append finalized blocks below them.
- Recomputed blocks as they cross out of the live region to seal their final content.
2026-06-05 23:34:05 +02:00
can1357 29c91250fc Merge remote-tracking branch 'origin/farm/d4f04d82/tree-not-list-sessions' 2026-06-05 11:44:08 +02:00
can1357 1e3a8d5cdf fix(tui): pinned native scrollback to commit sealed live-region rows
- Added `NativeScrollbackLiveRegion` seam so components report the live suffix start.
- Stopped ED3-risk streaming from dropping sealed transcript rows above the live block.
- Appended newly sealed rows once while keeping the active tail deferred to checkpoint.
2026-06-05 11:29:18 +02:00
roboomp 01677a0c1f style: bun run fix 2026-06-05 05:58:04 +00:00
roboomp ccc3533c45 fix(tui): differentiate /tree empty-state for fresh sessions
The session-tree selector collapsed to "No entries found" whenever the
default filter rejected every entry. On a fresh session that is the
normal case: `sdk.ts` writes `model_change` + `thinking_level_change`
at startup so model + thinking state survive resumes, and the default
filter treats both as bookkeeping. `selector-controller.showTreeSelector`
guards on `tree.length === 0` so the selector still opens, and the user
sees an unexplained empty panel with `(0/0)` next to a "Recent sessions"
list that does contain data.

Split the empty-state branch into three shapes:
- `flatNodes.length === 0` → unchanged "No entries found".
- `searchQuery` non-empty → "No entries match search \"…\"" plus a
  Backspace hint, with the real total in `(0/N)`.
- otherwise → "N entries hidden by the current filter [mode]" plus
  "Press Alt+A to show all, Alt+D for default", with the real total in
  `(0/N)`.

So the fresh-session case now explains why the panel is empty and how
to widen it instead of reading as "/tree is broken".

Fixes #1909
2026-06-05 05:57:47 +00:00
can1357 4e54836f94 chore(tui): adopt #1895 streaming-scrollback-defer; drop live-region pin 2026-06-05 06:42:05 +02:00
can1357 7447086186 fix(tui): pinned live region to stop scrollback dup on ED3 streams
- Added NativeScrollbackLiveRegion seam reporting where a component's transient suffix begins.
- Pinned the live block and chrome below it out of native history during foreground streams on ED3-risk terminals.
- Consumed pending forced scrollback wipes while pinned to avoid yanking a scrolled-up reader (#1682).
2026-06-05 00:53:39 +02:00
can1357 bfbb2464bb fix(coding-agent/modes): recomputed prior live block on live-to-frozen transition
- Tracked the previous live child in TranscriptContainer and forced a one-off recompute when a block leaves live status.
- Skipped snapshot reuse for that transitioning block so coalesced finalize-and-append frames seal transcript blocks at their final content.
- Added a regression test covering the stale-prefix freeze case on ED3-risk terminals and confirming the frozen block stays unchanged until thaw.
2026-06-04 18:46:16 +02:00
can1357 c8b4bf09c7 prompts: undo experiment, update system 2026-06-04 17:41:10 +02:00
can1357 8709f7a7e6 fix(coding-agent): fixed terminal UIs to resize with rows and avoid extra OSC11 polling
- Adjusted session and dashboard renderers to derive heights from live terminal rows.
- Propagated terminal-row callbacks through picker/controller wiring and session selectors.
- Reworked list visibility and page navigation to honor row-based budgets and footer lines.
- Added DECRQM 2031 startup probing and stopped OSC11 polling once support was confirmed.
2026-06-04 16:29:37 +02:00
can1357 53c09417b4 feat(modes/components): added tokenized matching and selection navigation
- Added token-aware query matching so highlights mirror `HistoryStorage.search` tokenization.
- Added token highlighting, compact relative timestamps, and selected-row styling in results.
- Added PageUp/PageDown and Home/End selection shortcuts in `HistorySearchComponent`.
- Added selector matchers for `tui.select.pageUp` and `tui.select.pageDown`.
- Changed empty-result messaging to distinguish `No history yet` from `No matching history`.
- Added tests for page/home/end navigation and token-highlighting result rendering.
2026-06-04 16:02:34 +02:00
can1357 2bd77f14f5 test(modes/components): added regression tests for assistant line counts
- Added tests covering stable line count behavior for streamed assistant messages.
2026-06-04 16:02:34 +02:00
can1357 cbdff129b6 feat(tui): enabled stable-prefix scrollback commits for streaming assistant output
- Added assistant-message completion state and stable-line count reporting.
- Added transcript stable-row aggregation and snapshot replay to keep unstable rows out of scrollback.
- Added TUI stable scrollback boundary APIs and stable-prefix commit path.
- Added regression tests proving unstable rows stay out of scrollback until stabilized.
2026-06-04 16:00:50 +02:00
roboomp 63ee0ee709 fix(tui): reload plugins after settings toggle
Marketplace plugin toggles in Settings → Plugins wrote the installed-plugin
registry and then only requested a render through the settings callback. In a
live TUI session that left already-loaded slash commands, hooks, tools, agents,
and SSH tool state unchanged until the user manually reloaded plugins or
restarted.

Make the plugin-change callback awaitable and wire the settings selector to the
same reload pipeline used by the slash-command runtime: clear plugin-root caches
for the active project registry, refresh slash command state, refresh the SSH
tool, then request a render. Await the callback after npm and marketplace
registry writes so Settings → Plugins reflects live plugin state immediately.

Add a regression test proving a marketplace toggle calls setPluginEnabled before
the plugin-change reload callback resolves.
2026-06-04 11:18:14 +00:00
roboomp 04dd818176 fix(tui): shorten marketplace install path before rendering
`MarketplacePluginDetailComponent` rendered the raw `installPath` from
the installed-plugin registry, which leaks the user's home directory
into the TUI when the plugin lives under `~/.omp/cache`. Route it
through `shortenPath` so $HOME becomes `~` before the value reaches
`Text`, matching the repo's TUI sanitization rules (per review on #1844).
2026-06-04 11:10:17 +00:00
roboomp a10e5d74af fix(tui): list marketplace plugins in settings panel
`PluginSettingsComponent.#showPluginList()` only inspected the npm plugin
registry, so the TUI's `Settings → Plugins` panel rendered "No plugins
installed" whenever the user had no npm plugins — even when many
marketplace plugins were installed. The `/plugins list` slash command,
`omp plugin list` CLI, and the install/uninstall selectors already
merged `PluginManager.list()` with `MarketplaceManager.listInstalledPlugins()`;
the settings panel was the only surface that missed the marketplace
registry when it was added.

Extend the panel to consume both data sources:

- Replace `PluginListComponent`'s `InstalledPlugin[]` input with a tagged
  union `PluginListEntry = { kind: "npm"; plugin: InstalledPlugin } | { kind:
  "marketplace"; plugin: InstalledPluginSummary }`. Each row now carries an
  `[npm]`/`[marketplace]` kind badge, a scope tag, and the shadow indicator
  for user installs overridden by a project entry. Widen the SelectList
  primary column so long `name@marketplace` ids stay readable.
- Add `MarketplacePluginDetailComponent`: single `Enabled` toggle plus the
  read-only `InstalledPluginEntry` metadata (version, install path,
  installed-at, last-updated, git commit SHA). The toggle calls
  `MarketplaceManager.setPluginEnabled(pluginId, enabled, scope)` — same
  path `/plugins enable|disable` uses.
- Update `PluginSettingsComponent` to await both `PluginManager.list()` and
  `MarketplaceManager.listInstalledPlugins()` in parallel, build the merged
  list, and route selection to the kind-specific detail view. The empty
  state now lists both install commands (npm and marketplace).

Fixes #1842
2026-06-04 11:05:30 +00:00
can1357 b0cf24ca0d feat(coding-agent): froze offscreen transcript blocks on ED3-risk terms
- Added TranscriptContainer that snapshots non-live blocks to avoid stale scrollback duplicates.
- Thawed snapshots at prompt-submit checkpoints for reconciliation.
- Repainted eager streaming tail on overflowing shrink to unfreeze UI (issue #1682).
2026-06-04 03:48:12 +02:00
can1357 5e17edf1ec refactor(coding-agent): restructured session text slicing to use unified head/tail reads
- Replaced SessionStorage readTextPrefix/readTextSuffix with readTextSlices.
- Added peekFileEnds utility to read bounded file head/tail in one handle.
- Updated session-manager list/recent reads to consume unified head/tail slices.
- Expanded storage tests for head/tail and UTF-8-boundary slice extraction.
2026-06-04 02:07:34 +02:00
can1357 e6716d086d feat(coding-agent): added lifecycle status to session picker
- Classified each session's final message as done, interrupted, aborted, error, or pending from a 32 KiB tail read.
- Rendered the status as a colored segment on the session metadata line.
- Added `peekFileTail` and `readTextSuffix` across storage backends to read file tails in one pass.
- Simplified `MemorySessionStorage` to a string array mirror with a sidecar mtime map.
2026-06-04 01:58:25 +02:00
Can Bölük 2909b068d1 Merge branch 'main' into farm/d05e786c/cannot-log-out-opencode 2026-06-02 08:52:53 +03:00
can1357 7b3ea248d4 feat(coding-agent): enabled cross-project resume with folder/all scope fallback
- Enabled resume picker to preload sessions and toggle folder/all scope with Tab.
- Enabled resume flow to fall back to all-project sessions and switch cwd on resume.
- Added centralized applyCwdChange to refresh caches, commands, and UI after cwd updates.
- Updated session restoration to adopt restored session cwd and sessionDir when present.
2026-06-02 05:53:57 +02:00
roboomp 12cfdd68b1 fix(auth): limited logout to stored credentials
Filtered the logout selector to credentials that /logout can actually remove and reported ambient env/config auth when direct logout cannot clear it. Added selector coverage for env-only OpenCode providers.\n\nFixes #1658
2026-06-01 19:14:28 +00:00
shoucandanghehe fbb24fb7dc fix(coding-agent): tighten thinking renderer semantics 2026-05-31 20:59:15 +08:00
shoucandanghehe 569cc3442b feat(coding-agent): add assistant thinking renderers 2026-05-31 20:44:02 +08:00
can1357 a5c71bb775 test(coding-agent/test): added markdown-aware keyword tests in prose mode
- Added markdown prose tests to verify maskNonProse preserves plain prose and masks fenced/tilde blocks.
- Added keyword-in-prose tests that enforced lowercase token matching and ignored code spans, fences, XML, and comments.
- Added highlight-mode tests ensuring only prose keywords are ANSI-highlighted and inline/fenced/XML regions stay unmodified.
- Added workflow/orchestrate assertions that uppercase or path-like forms remain unchanged while lowercase token boundaries are handled correctly.
2026-05-31 09:47:24 +02:00
can1357 42b79bc696 feat(coding-agent): added fuzzy token matching in coding-agent components
- Added fuzzy token matching in agent-dashboard, state-manager, and tree-selector, replacing lowercased checks.
- Added search-query state and fuzzy-filter helpers to hook, oauth, and user-message selectors for query filtering.
- Updated filtered selectors to render match results, status lines, no-match text, and move selection within results.
- Added `overflowSearch` and filter state to `SelectList`, switching overflowing list matching to fuzzy checks.
- Configured `SelectList` input flow and fixed cancel so Escape/Ctrl+C closes lists when no matches exist.
- Updated changelogs and added tests for fuzzy-filter behavior in hook, oauth, user-message, and list selectors.
2026-05-31 07:45:22 +02:00
can1357 1d930a527d test: fixed flaky tests by using relative timestamps and palette-agnostic regex
- Replaced fixed calendar timestamps with `minutesAgo()` so beam-store items stay within the 24h working-memory TTL.
- Broadened background-color assertion to match both truecolor (`48;2;`) and 256-palette (`48;5;`) terminals.
2026-05-31 02:26:29 +02:00
can1357 edcc8ab30f test(coding-agent): added segment-track coverage and removed obsolete OAuth selector spec
- Added unit tests for renderSegmentTrack verifying per-segment coloring, active chip fill formatting, and active-index movement.
- Added tests for theme.getContrastFgAnsi to ensure selected foreground contrast remains clearly readable against RGB fills.
- Removed the OAuth selector keybinding test and its local auth-storage scaffolding, and documented the new model-tier/role-cycle chip-track behavior in the changelog.
2026-05-31 01:04:56 +02:00
can1357 e32c639d2e feat(coding-agent): added hook-selector slider for persisted role models
- Added role-model cycle data structures and helper methods to resolve and persist selected model states.
- Added a plan-review model-tier slider from role model cycles, with arrow navigation and slider help text.
- Applied selected role model and explicit thinking level before plan approval, carrying over to fresh and compacted sessions.
- Added hook-selector slider rendering and movement handling with index clamping, plus tests and changelog coverage.
2026-05-30 18:21:34 +02:00
can1357 a13c9bf6fc feat(coding-agent): added SettingsList#setItems with clamped selection
- Added SettingsList#setItems to replace items and clamp selection to a valid index after updates.
- Updated SettingsSelector to rebuild active memory items on backend changes and skip refresh when appropriate.
- Switched MCP wizard and command spinners to theme frames with themed initial frame and 80ms updates.
- Reworked welcome intro animation for a 3-second eased sweep with optional shine blending.
- Added memory backend refresh tests and aligned package changelogs with the updated behavior.
2026-05-22 13:19:35 +09:00
roboomp 9ede82deba fix(tui): compressed deep session tree gutters
Capped the session tree selector gutter width so deeply branched histories preserve space for the selected entry text.

Added regression coverage for heavily branched trees at wide and narrow viewport widths.

Fixes #1144
2026-05-17 06:55:59 +00:00
can1357 f1f6516056 refactor: reorganized exports and removed obsolete helper branches
- Removed export leakage by demoting many helper and const symbols to module-local scope.
- Renamed underscore-prefixed internals and cache fields, then updated related references and `satisfies never` checks.
- Deleted obsolete logic branches and helpers, including harmony-stream interruption flow and unused benchmark runtime helpers.
- Updated Biome config and manifests by broadening lint coverage and removing an unused `@napi-rs/cli` dev dependency.
- Adjusted tests and utilities to use renamed test helpers and remove redundant private test-only helpers/locals.
2026-05-14 04:36:19 +02:00
Ogrodev 9ae60cd793 Fix assistant image fixture path 2026-05-13 06:00:45 +02:00
David Marshall c8d4f22b59 fix(coding-agent): render developer-role messages in /export and /tree
The HTML export feed, sidebar tree, and TUI session tree did not handle
the developer role, so plan content injected after /plan approval (and
any other developer messages) was hidden from /export and shown as a
bare [developer] label in /tree.

Renders developer messages in the main feed with a dimmed
.developer-message style, labels them in the sidebar tree, counts them
in header stats, and shows their content in the TUI tree selector so
search matches the body.

Closes #753.

Co-Authored-By: omp <noreply@oh-my-pi.dev>
2026-05-11 10:42:17 -05:00
can1357 af8504d081 feat(coding-agent/modes): converted non-PNG tool images to PNG for Kitty terminal rendering
- Added asynchronous Kitty conversion for assistant tool images using `convertToPng`, keyed per tool-call entry with cached and in-flight tracking.
- Updated assistant image rendering to prefer converted PNGs for Kitty terminals while preserving existing behavior for other protocols.
- Added a unit test that verifies WebP tool images are converted and rendered as Kitty image output instead of the raw image/webp fallback.
2026-05-09 22:01:56 +02:00
Vu Anh Nguyen 12c666f4c0 Fix mermaid markdown test expectations 2026-04-24 06:47:56 +02:00
Vu Anh Nguyen a7845b3b86 Fix mermaid assistant test settings init 2026-04-24 06:47:56 +02:00
Vu Anh Nguyen 81fd90ecc0 Fix Mermaid markdown rendering on non-image terminals 2026-04-24 06:47:56 +02:00