Commit Graph

5061 Commits

Author SHA1 Message Date
can1357 c8b4bf09c7 prompts: undo experiment, update system 2026-06-04 17:41:10 +02:00
can1357 7124dbae93 fix(coding-agent): fixed session resume to reconcile modes and preserve model state
- Registered and triggered a session-switch reconciler during init and after switch.
- Rebuilt resume flow to restore plan/goal mode state and clear stale mode flags.
- Marked fallback and context-promotion model switches ephemeral and skipped them on restore.
- Added regression tests for temporary model ordering, fallback precedence, and mode cleanup.
2026-06-04 17:22:19 +02:00
can1357 7a7479f7e3 feat(coding-agent/modes): added arrow-key tab switching to dashboards
- Mapped left/right arrows to switch tabs in the extension dashboard.
- Updated agent and extension dashboard footers to show arrow controls.
- Reformatted HTTP transport assignment and reordered an import.
2026-06-04 16:37:50 +02:00
can1357 51865fc1ea test(coding-agent): updated assertions for condensed prompt wording
- Aligned handoff, reminder, and system-prompt expectations with shortened copy.
- Added HTTP transport test for required initialize failures.
- Guarded SSE startup timeout against stale connection races.
2026-06-04 16:35:45 +02:00
can1357 457fe9eb26 feat(coding-agent/prompts): routed parallel requests to task subagents
- Added system-prompt rule mapping user `parallel`/`parallelize` requests to `task` subagent fan-out.
- Clarified that parallel tool calls alone do not satisfy the request.
2026-06-04 16:35:15 +02:00
can1357 829b999dc1 feat(coding-agent/modes): added arrow-key based tab switching in the agent dashboard
- Mapped the right arrow key to advance tabs in the agent dashboard.
- Mapped the left arrow key to reverse tabs alongside shift+tab.
- Kept existing tab and shift+tab handling intact for backward-compatible navigation.
2026-06-04 16:32:17 +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 4cf112d92a feat(web/search): expanded Perplexity defaults and related questions
- Raised default search results to 20 and context size to high.
- Added related questions parsing and return_related_questions request flag.
- Added API-key request-shape tests covering defaults and parsing.
2026-06-04 16:28:59 +02:00
can1357 7d0931585b Merge remote-tracking branch 'origin/farm/a8fe8732/fix-acp-plan-local-write' 2026-06-04 16:03:00 +02:00
can1357 c4cc7b2326 Merge remote-tracking branch 'origin/farm/7f3f40ca/restore-exa-mcp-fallback' 2026-06-04 16:02:58 +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 a3fec0b978 feat(modes/components): implemented agent creation multiline editor flow
- Replaced the single-line description Input with Editor in agent-dashboard.ts for multiline entry.
- Added Enter-newline and Ctrl+Enter submit handling to the create-agent editor flow.
- Updated agent-creation-architect.md guidance for concise single-sentence whenToUse output.
- Added integration tests for multiline editor rendering and Ctrl+Enter submission.
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 f0f3c4cbd8 fix(coding-agent): kept local plan writes off acp bridge
Route '/data/workspaces/can1357__oh-my-pi__1863/.omp-session/2026-06-04T13-36-11-717Z_019e92d9-3fc5-7000-a66f-15cad94b7e75/local' plan artifacts through OMP's session-local storage instead of the editor writeTextFile bridge, preserving ACP bridge routing for regular editor-visible files.

Fixes #1863
2026-06-04 13:43:17 +00:00
can1357 d7eee460d2 fix(coding-agent): sorted ctrl+r search results by recency
- Removed early FTS-only return so prefix and substring matches merge.
- Sorted merged results globally by prompt recency before limiting.
- Added /force, /copy, and /shake tips.
2026-06-04 15:40:37 +02:00
can1357 d32a33a4da docs(coding-agent): added ctrl+r prompt history search tip 2026-06-04 15:37:11 +02:00
roboomp aacf29e1de fix(coding-agent): kept exa mcp fallback out of auto chain
Reviewer noted that an unconditional ExaProvider.isAvailable steered the auto chain into the public MCP fallback before any later-configured provider could run. Restored the credential-gated isAvailable, then split out isExplicitlyAvailable so resolveProviderChain still routes an explicit Exa selection through MCP without affecting other providers.\n\nRefs #1860
2026-06-04 13:28:14 +00:00
can1357 4d067ad512 Merge remote-tracking branch 'origin/farm/7f3f40ca/restore-exa-mcp-fallback' 2026-06-04 15:25:09 +02:00
can1357 e495f073da feat(coding-agent): deferred session titling past greetings
- Skipped titling for greeting/filler/empty first messages deterministically, retrying on later user messages.
- Let capable title models decline taskless input via a "none" sentinel.
- Guarded against clobbering a name set by a concurrent attempt.
2026-06-04 15:24:53 +02:00
roboomp cb2d5b859a fix(coding-agent): restored exa mcp fallback
Restored Exa's unauthenticated MCP fallback when neither auth storage nor EXA_API_KEY provides credentials. Preserved API-key search ordering and bounded the MCP request with the web-search hard timeout. Updated provider copy and regression coverage for the no-key path.\n\nFixes #1860
2026-06-04 13:18:08 +00:00
can1357 482c95d375 chore: update chanelogs 2026-06-04 14:53:20 +02:00
can1357 06f9123b55 Merge remote-tracking branch 'origin/farm/8cadad3a/sync-natives-on-update' 2026-06-04 14:52:58 +02:00
can1357 7ed34f885a Merge remote-tracking branch 'origin/farm/3c94a6e9/fix-tsc-noemit-coding-agent' 2026-06-04 14:52:43 +02:00
can1357 13b518d845 Merge remote-tracking branch 'origin/farm/e2beffcf/ssh-render-multiline-command-block' 2026-06-04 14:52:23 +02:00
can1357 50b3075d80 Merge remote-tracking branch 'origin/farm/ace3249a/fix-mnemopi-embeddings-never-populated' 2026-06-04 14:52:13 +02:00
can1357 fe3f0024ea Merge remote-tracking branch 'origin/farm/8333346d/tui-plugin-settings-show-marketplace' 2026-06-04 14:51:25 +02:00
can1357 f48ed8b301 Merge remote-tracking branch 'origin/farm/f67b9118/anthropic-cache-control-compat' 2026-06-04 14:51:19 +02:00
can1357 876c9a9b21 Merge remote-tracking branch 'origin/farm/c2f776eb/mcp-results-status-icon' 2026-06-04 14:50:59 +02:00
can1357 f44b805d02 Merge remote-tracking branch 'origin/farm/2dde13da/appendonlycontext-sglang-auto' 2026-06-04 14:50:54 +02:00
can1357 95defa712b docs(compaction): rewrote prompts in terse scratchpad style
- Converted compaction, branch, and handoff prompts to fragment voice.
- Replaced "You MUST" phrasing with bare "MUST" directives.
- Applied same rewrite to autoresearch and turn-aborted prompts.
2026-06-04 14:49:45 +02:00
can1357 f3bbc9f069 docs(coding-agent): rewrote communication style guidelines
- Replaced concise-correctness rules with scratchpad-style reasoning format.
- Added Need/Check/Risk/Decision phrasing patterns and examples.
- Specified Problem/Decision/Keep/Why/Risk/Check/Next structure.
2026-06-04 14:49:45 +02:00
roboomp cf33b64033 fix(mcp): updated completed tool status icons
MCP tool renderers now merge call and result components so completed blocks replace the pending call header with success or error status.

MCP protocol errors now preserve top-level isError so downstream render state can use the error status consistently.

Added renderer coverage for completed MCP success and error blocks.

Fixes #1855
2026-06-04 12:14:57 +00:00
roboomp 15d4d7fcf9 fix(providers): enabled append-only auto for xiaomi
Centralized append-only context auto-mode resolution so SDK sessions, interactive sessions, and the status display use the same provider checks. Auto mode now enables for Xiaomi/SGLang hosts and explicit stored-request compat signals while preserving DeepSeek behavior.

Added focused regression coverage for Xiaomi Token Plan SGLang HiCache endpoints and explicit on/off behavior.

Fixes #1851
2026-06-04 11:59:47 +00:00
roboomp fddcee5e80 fix(ai): honored anthropic cache compat
Allowed OpenAI-compatible providers to opt into Anthropic cache_control markers via compat.cacheControlFormat while preserving OpenRouter Anthropic defaults.

Fixes #1845
2026-06-04 11:20:08 +00: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
roboomp 66b6597829 fix(mnemopi): populated memory_embeddings on remember and auto-derived queryEmbedding on recall
The beam backend never invoked the embedding pipeline during normal
operation: `remember()`/`rememberBatch()`/`updateWorking()` skipped `embed()`
entirely and `recall()`/`recallEnhanced()` never called `embedQuery()` on
the query text. As a result `memory_embeddings` stayed empty in every
deployment and recall silently degraded to FTS-only regardless of the
configured provider (fastembed, OpenAI-compatible API, custom).

- Added `scheduleEmbedding` on `beam.pendingExtractions` (mirroring
  `scheduleFactExtraction`) and wired it from `remember`, `rememberBatch`,
  `updateWorking`, and `consolidateToEpisodic`. Writes
  `INSERT OR REPLACE INTO memory_embeddings(memory_id, embedding_json, model)`
  with the active runtime-options model, captured before the AsyncLocalStorage
  scope exits and re-entered inside the task.
- Auto-derived `queryEmbedding` inside `recall()` via `embedQuery(query)` when
  the caller did not pass one. `queryEmbedding: null` is preserved as the
  explicit FTS-only opt-out; `undefined` triggers auto-derive.
- Propagated `queryEmbedding` through `Mnemopi`'s `toRecallOptions` so the
  facade no longer strips the override on the way to the beam layer.
- Made `Mnemopi.recall`/`recallEnhanced`/`search`/`query`, the module-level
  exports, `BeamMemory.recall`/`recallEnhanced`, the free `recall`/`recallEnhanced`,
  and `orchestrateRecall` async. MCP `handleToolCall`/`callToolJson`/`handleJsonRpc`
  follow suit so the recall handler can await.
- Fixed `withBeam`/`withSharedBeam` to defer `beam.close()` until the async
  handler resolves; otherwise the new async recall hit
  `RangeError: Cannot use a closed database`.
- Updated CLI, MCP entrypoints, coding-agent `MnemopiSessionState`, and every
  affected test to await the new shapes.

Verified with a new regression suite (`test/issue-1832-embedding-population.test.ts`)
exercising both ends of the bug: empty `memory_embeddings` and zero
`dense_score`.

Fixes #1832
2026-06-04 09:22:07 +00:00
roboomp 7a1280784e fix(tools/ssh): rendered multiline remote commands in a framed body block
The SSH tool renderer fed the raw command into renderStatusLine's
description, so any newline in the remote command expanded the
single-line tool header — the bordered output block then opened
mid-command and the rest of the SSH cell rendered against a broken
frame.

The renderer now keeps only [host] in the header and renders the
full command (with a dim $ prefix and tab sanitization) as its own
framed section above Output, matching the bash renderer's shape.

renderStatusLine also flattens CR/LF in title, description, meta,
and badge labels so no future caller can accidentally produce a
multiline tool header.

Covered by:
- test/tools/ssh-render.test.ts: multiline command stays out of
  the header and every command line is present in the body, for
  both renderCall and renderResult.
- test/tui/status-line-newline-guard.test.ts: embedded LF, CRLF,
  and lone CR in description/meta are flattened to spaces.

Fixes #1828
2026-06-04 07:44:52 +00:00
roboomp 20820b748c style: bun run fix 2026-06-04 06:52:55 +00:00
roboomp 32f07b24f7 fix(coding-agent): sync pi-natives on omp update
bun install -g <pkg>@<v> did not reliably re-resolve transitive
optionalDependencies, so @oh-my-pi/pi-natives and the platform leaf
@oh-my-pi/pi-natives-<tag> stayed at the previous version while
@oh-my-pi/pi-coding-agent moved. The loader’s validateLoadedBindings
then aborted because the .node file exposed the old
__piNativesV<old> sentinel instead of __piNativesV<new>.

buildBunInstallArgs now pins @oh-my-pi/pi-natives and (when the
running tag is one the release pipeline publishes) the platform
leaf to the same version it installs for @oh-my-pi/pi-coding-agent,
so bun replaces all three in lock-step. The leaf is gated by the
same SUPPORTED_PLATFORMS set the loader uses, so unsupported tags
still surface the original 'no matching version' diagnostic instead
of EBADPLATFORM.

Fixes #1824
2026-06-04 06:52:31 +00:00
roboomp 70ada531d8 fix(coding-agent): made slash-command handlers compatible with TypeScript 5.x
The SlashCommandSpec handle/handleTui signatures and a test `populate`
callback relied on `() => void` being assignable to
`() => T | undefined`. The repo's own gate uses `tsgo`
(@typescript/native-preview) and TypeScript 6.x, both of which accept
that coercion, so `bun run check:ts` passed cleanly. TypeScript 5.x
does not, so `tsc --noEmit -p packages/coding-agent/tsconfig.json`
under 5.9.3 produced 56 errors (`builtin-registry.ts` x46 TS2322,
`agent-session-openai-responses-replay.test.ts` x10 TS2345).

Expressed the slot as a union of two function types — one returning
`SlashCommandResult`, one returning `void` — so the same handler
bodies typecheck under both compilers. `T | void` in a single
function-return position also trips Biome's `noConfusingVoidType`;
the siblings-of-function-types shape avoids that.

Verified:
- TypeScript 5.9.3: 0 errors (was 56)
- tsgo: 0 errors
- bun run check:ts: 0 errors workspace-wide
- packages/coding-agent test/slash-commands + agent-session-openai-responses-replay: 50/50 pass

The issue's other two categories (telemetry-export.ts x2, tui virtual-terminal.ts x1) did not reproduce on this checkout — the catalog
declares @opentelemetry/exporter-trace-otlp-proto,
@opentelemetry/sdk-trace-node, and ghostty-web and they install cleanly.

Fixes #1821
2026-06-04 06:10:02 +00:00
can1357 17a39ebd3a chore: bump version to 15.9.0 2026-06-04 05:41:53 +02:00
can1357 38b7c77b76 chore: update chanelogs 2026-06-04 05:41:32 +02:00
can1357 7490967f0e fix: fixed tool-call compatibility and tiny runtime resolver behavior
- Updated tool-call handling to accept string and object arguments.
- Stored object tool-call args directly into block.partialArgs and block.arguments.
- Added compiled runtime module resolution honoring exports, main, and index fallbacks.
- Patched tiny runtime loading to install resolver stubs and load the resolved entry file.
2026-06-04 05:41:09 +02:00
Can Bölük af32512564 Merge branch 'main' into feat/otel-otlp-export 2026-06-04 06:39:07 +03:00
Can Bölük a6997b1b7f Merge branch 'main' into fix/session-accent-light-contrast 2026-06-04 06:28:21 +03:00
can1357 1379772628 refactor(utils): consolidate color utilities into pi-utils
Move the color math added for the session-accent fix into the shared
@oh-my-pi/pi-utils color module instead of a coding-agent-local file:

- colorLuma, relativeLuminance, and hslToHex now live in
  packages/utils/src/color.ts (hslToHex lifted out of session-color.ts).
- Drop the duplicate hex parser: toRgb reuses the existing hexToRgb and
  paletteToRgb returns the shared RGB type, so hex parsing lives once.
- Delete packages/coding-agent/src/utils/color.ts; theme.ts and
  session-color.ts import from @oh-my-pi/pi-utils.
- Move the color unit test into the utils package; repoint session-color
  test imports.

No behavior change to accent luminance capping.
2026-06-04 05:27:11 +02:00
can1357 db0f396601 feat(tui): added terminal cursor mode synced to hardware cursor pref
- Added Input setUseTerminalCursor to render terminal or software cursor.
- Synced focused component cursor mode on focus and preference changes.
- Fixed wrapTextWithAnsi infinite loop on BEL-terminated string escapes.
2026-06-04 05:21:35 +02:00