Commit Graph

6817 Commits

Author SHA1 Message Date
Bin Jin e91d2cc776 feat(collab): added QR links and split web UI URL support
- Added collab.webUrl and rendered browser links as web UI wrappers whose fragments carry relay links.
- Added one-shot /collab qrcode and /collab qrcode-view commands with terminal QR rendering.
- Updated coding-agent and collab-web parsers to prefer parseable wrapper fragments while preserving legacy links.
- Added regression tests and changelog entries for split-host collab links and QR commands.
2026-06-19 01:21:21 +02:00
can1357 f743ddc83d feat: replaced XML-style pi dialect with sigil-delimited format
- Migrated the `pi` AI dialect from legacy XML-style elements to a compact, token-frugal sigil-delimited format using `§` for calls, `""` for body fences, and `¤` for thinking.
- Implemented robust parsing for the new format, including support for incremental streaming of tool arguments and automatic escalation of body fences to prevent content collisions.
- Updated documentation, settings configurations, and test suites across the `ai` and `coding-agent` packages to ensure consistency with the new dialect rules.
- Standardized moderation category terminology in `stats` to improve clarity in reporting metrics.
2026-06-19 01:19:41 +02:00
can1357 eeb9128510 docs(changelog): move merged fix entries (#2775/#2573/#2729/#2791) to [Unreleased] 2026-06-19 01:00:57 +02:00
can1357 5168e6d6af Merge PR #2791: fix(tool): resolve pasted image attachments in inspect_image (@roboomp)
# Conflicts:
#	packages/coding-agent/src/tools/inspect-image.ts
2026-06-19 00:59:03 +02:00
can1357 3e91783da8 fix(coding-agent): treat openrouter :max suffix as thinking selector
getOpenRouterRouteSuffix() used strict parseThinkingLevel(), which never
recognizes the max->xhigh alias, so openrouter/<id>:max was consumed as an
OpenRouter route suffix and cloned into a literal <id>:max model id with the
reasoning level dropped. This hit every exact-selector funnel
(parseModelPattern -> resolveCliModel/--model, resolveModelRoleValue/modelRoles
+ model picker, SDK default role) for the dominant aggregator provider.

Exclude max via parseThinkingSuffix(.., MAX_THINKING_SUFFIX_OPTIONS) so the
pattern falls through to the existing max-aware selector split. Literal :max
ids stay safe (none exist under openrouter; nanogpt literals win via exact
lookup before this path). Adds an openrouter/<id>:max regression test.
2026-06-19 00:58:52 +02:00
can1357 5d72ce1237 Merge PR #2729: fix(coding-agent): accept max thinking alias (@roboomp)
# Conflicts:
#	packages/coding-agent/test/model-resolver.test.ts
#	packages/coding-agent/test/sdk-model-selection.test.ts
2026-06-19 00:58:52 +02:00
can1357 f5c3b34a41 Merge remote-tracking branch 'origin/farm/11c539c6/bedrock-inference-profile-model' 2026-06-19 00:14:48 +02:00
can1357 c5c0229da0 style: biome format #2839 dispose-disconnect test 2026-06-19 00:14:21 +02:00
can1357 51f54ad30a docs(changelog): consolidate changelog entries under [Unreleased]; add #2906/#2839 notes 2026-06-19 00:14:20 +02:00
roboomp 12f608e0f4 fix(providers): used neutral bedrock profile metadata
Stopped synthetic Bedrock inference profile ARN models from inheriting Claude Opus reasoning and context metadata.

Fixes #3004
2026-06-18 21:40:08 +00:00
can1357 6d5f548147 fix(mcp): bound owned-manager disconnect on dispose
The dispose() disconnect added by this PR awaited mcpManager.disconnectAll()
unbounded. An owned manager holding an HTTP/SSE server whose session-
termination DELETE hangs would block dispose for the full MCP request timeout
(30s default, unbounded when OMP_MCP_TIMEOUT_MS=0), stalling /exit and
print-mode shutdown on a broken remote endpoint.

Wrap the disconnect in withTimeout(..., 3_000) — mirroring the bounded
async-job teardown two lines above and the startup bound from issue #2100.
stdio close (the subprocess reap this PR targets) completes well within the
bound; a slow transport close is left to finish detached.

Adds a regression test driving the real MCPManager.disconnectAll() with a
stalled transport close.
2026-06-18 23:32:55 +02:00
can1357 e6228ebda0 fix(coding-agent): move #2909 changelog entry to [Unreleased]
The quoted-path fix entry was appended under the already-released [16.0.6] section (creating a duplicate ### Fixed heading); released sections are immutable per repo convention. Move it to [Unreleased] and normalize the bullet.
2026-06-18 23:32:54 +02:00
can1357 469e4626d0 Merge PR #2839: fix(mcp): disconnect owned MCP manager on AgentSession.dispose() (@jms830) 2026-06-18 23:32:54 +02:00
can1357 7c635de10a Merge PR #2914: fix(coding-agent): preserve queued steers/follow-ups during auto-compaction (@metaphorics) 2026-06-18 23:32:54 +02:00
can1357 1c051532d4 Merge PR #2809: fix(coding-agent/config): support comments in JSON config migration (@usr-bin-roygbiv) 2026-06-18 23:32:54 +02:00
can1357 4406559996 Merge PR #2909: fix(coding-agent): support quoted paths with spaces in file arguments and mentions (@pidevxplay) 2026-06-18 23:32:54 +02:00
can1357 7a819bba16 Merge PR #2906: fix(login): honor disabledProviders in /login provider list (@dipunj) 2026-06-18 23:32:53 +02:00
roboomp b67d07e829 fix(providers): preserved bedrock profile thinking suffixes
Handled Bedrock inference profile ARNs through the normal thinking selector parser so suffixes such as :off do not become part of the ARN.

Fixes #3004
2026-06-18 21:26:35 +00:00
roboomp 3a736ff7c1 fix(providers): accepted bedrock inference profile arns
Resolved Amazon Bedrock application inference profile ARNs through the provider-specific model resolver and routed Bedrock requests to the ARN region.

Fixes #3004
2026-06-18 21:06:01 +00:00
usr_bin_roygbiv bc5f25af23 fix(coding-agent/config): support comments in JSON config migration 2026-06-18 16:05:06 -05:00
can1357 20f8c3776f chore: bump version to 16.0.9 2026-06-18 23:01:31 +02:00
can1357 828699ffdf test(catalog): drop evaluator-worktree note from copilot signing test 2026-06-18 23:01:11 +02:00
can1357 3006fe817b test(coding-agent): drop evaluator-worktree note from plan-reference test 2026-06-18 22:57:20 +02:00
can1357 0c69b35785 style: biome format integrated #2851/#1246/#2972 changes 2026-06-18 22:56:24 +02:00
can1357 a1dbbb50c9 Merge PR #2986: fix(session): prevent goal mode pause during compaction/switch (@roboomp) 2026-06-18 22:53:39 +02:00
can1357 33b7805e18 test(coding-agent): hoist runPrintMode to a top-level import
AGENTS.md bans inline/dynamic imports; import runPrintMode once at the
top of the file instead of re-importing it in each test body.
2026-06-18 22:52:48 +02:00
can1357 6358d9874e docs(coding-agent): changelog entry for --print-thoughts flag 2026-06-18 22:52:48 +02:00
can1357 b25d7472e4 fix(coding-agent): surface thinking for --print-thoughts when hidden
Threading printThoughts only into runPrintMode is too late when
hideThinkingBlock is set (settings or --hide-thinking): the session is
built with hideThinkingSummary=true, so the provider omits reasoning
summaries and --print-thoughts prints nothing. Override hideThinkingBlock
to false for single-shot print mode before session creation, gated on
print mode; an explicit --hide-thinking still wins.
2026-06-18 22:52:48 +02:00
can1357 0b684f9929 Merge PR #2960: add print-mode thinking output flag (@roboomp) 2026-06-18 22:52:48 +02:00
can1357 dbf4b53163 fix(coding-agent): re-inject approved plan reference after compaction
After plan approval the executor delivers the plan-mode-reference exactly
once and sets `#planReferenceSent = true`. Both compaction paths — `compact()`
and `#runAutoCompaction()` — replace the conversation history that carried
that reference but never cleared the flag, so `#buildPlanReferenceMessage()`
short-circuited to null on every subsequent turn and the executor permanently
lost the plan it was working on (exactly the long-session failure reported).

Clear `#planReferenceSent` right after `replaceMessages()` in both paths so the
next turn re-reads the plan from disk and re-injects it. The reset is a no-op
for ordinary sessions: the default plan path (PLAN.md in session-local scratch)
has no file on disk, so `#buildPlanReferenceMessage()` still returns null there.

Adds a deterministic regression test (short-circuited compaction, mock stream)
that fails before this change and passes after, plus a guard proving normal
sessions get no spurious plan injection.

Fixes #1246
2026-06-18 22:52:29 +02:00
can1357 b9f57fb5d6 feat(coding-agent/prompts): updated advisor system prompt and tool definition
- Refined the advisor's scope to prioritize concrete technical risks and user advocacy while discouraging process-related critiques.
- Explicitly barred the advisor from intervening on user intent, process questions, or issues already handled by developer tooling.
- Updated `advise` tool documentation to clarify its purpose in preventing wasteful or incorrect work.
2026-06-18 22:34:16 +02:00
Dipunj ca4c5463d9 fix(login): hide alias logins when their credential provider is disabled
A login entry can store credentials under a different provider id via
storeCredentialsAs (e.g. openai-codex-device => openai-codex). Filtering
only on provider.id left such alias logins visible after disabling the
underlying model provider. Surface storeCredentialsAs on OAuthProviderInfo
and hide a login entry when either its own id or its storeCredentialsAs
target is in disabledProviders.

Addresses Codex review on #2906.
2026-06-18 15:56:43 -04:00
usr_bin_roygbiv c16a41fd95 fix(session): prevent goal mode pause during compaction/switch 2026-06-18 14:44:39 -05:00
can1357 88aa88f605 fix(coding-agent): bundle mupdf into the compiled binary so PDF reads work
The vendored markit engine kept `mupdf` external, but a single-file
`bun --compile` binary has no node_modules to resolve it from, so the
standalone binary aborted at startup with `Cannot find package 'mupdf'`
— the otherwise-lazy import is resolved eagerly at boot. Bundle mupdf and
embed its WASM blob (scripts/embed-mupdf-wasm.ts, reset after the build);
npm and source installs still load mupdf from node_modules.

Import mupdf lazily inside the PDF converter so the bundled markit chunk's
init stays synchronous: mupdf's top-level await otherwise made the chunk
init async and bun's compiled bundler failed to await it through the
barrel, exposing the converters before their module-level const tables
initialized (undefined EXTENSIONS). Also keeps the ~10MB wasm off non-PDF
document conversions.
2026-06-18 20:44:58 +02:00
can1357 2023a6f674 chore: bump version to 16.0.8 2026-06-18 20:05:56 +02:00
can1357 653ba1fab1 chore: reformat 2026-06-18 20:05:35 +02:00
can1357 117e87df0d fix(coding-agent/utils): enhanced zip size validation checks
- Replaced insufficient file size checks with comprehensive validation for ZIP header and length limits.
- Added explicit rejection for archives that would exceed ZIP32 entry counts, name lengths, or total offsets.
- Added validation for central directory size to prevent overflow before generating the EOCD record.
2026-06-18 20:03:34 +02:00
can1357 ad14074701 feat: updated conversation rendering and tool result formatting
- Implemented structured markdown role headings and tool result merging to improve conversation readability.
- Added explicit `<out>` tags for tool result wrapping and enhanced rendering for thinking blocks.
- Refactored authentication snapshot validation to use manual structural checks instead of schema dependencies.
- Fixed instability in settings overlay scrolling and addressed assistant message splitting issues.
2026-06-18 19:54:01 +02:00
can1357 ea492f6903 refactor(deps): removed fflate dependency
- Removed the `fflate` dependency in favor of using `node:zlib` for ZIP operations.
- Updated documentation and internal code comments to reflect the transition to native `node:zlib` DEFLATE support.
2026-06-18 19:52:59 +02:00
can1357 2187d96658 refactor(coding-agent): improved archive handling and load times
- Replaced `fflate` dependency with `node:zlib` and manual ZIP framing in `src/utils/zip.ts`.
- Implemented lazy loading for site-specific scrapers to reduce cold-start latency.
- Unified ZIP compression and extraction logic to use native `zlib` stream decoders.
- Optimized ZIP member decoding by implementing memory-safe length-bounded inflation.
2026-06-18 19:50:52 +02:00
can1357 e3c025ccb4 feat(coding-agent/prompts): restricted the advisor from providing redundant
- Restrict the advisor from providing redundant insights, context, or second opinions.
- Prohibit restating information or problems already visible to the agent via its own tools.
- Prevent repetition of previously provided advice to minimize noise.
2026-06-18 19:50:24 +02:00
can1357 2a92ff8a98 refactor(coding-agent): optimized module exports and configuration
- Refactor deep imports by targeting specific sub-modules in `@oh-my-pi/pi-ai` to reduce barrel file overhead.
- Utilize jitless ArkType scopes in schema definitions to reduce startup JIT codegen costs by approximately 65%.
- Reorganize internal `auth-storage` exports to maintain clean boundaries between core and broker-specific functionality.
2026-06-18 19:33:48 +02:00
can1357 021d82ac1f feat(coding-agent): consolidated and optimize archive handling
- Centralized archive operations into a new `utils/zip.ts` module with unified support for ZIP, tar, and tar.gz formats.
- Optimized ZIP reading using lazy, ranged central-directory access and implemented ZIP64 support for large files.
- Hardened archive extraction with directory traversal protection and configured memory limits for loading and extraction.
- Refactored tool-specific logic to utilize the new centralized utility and deleted the redundant `archive-reader.ts`.
2026-06-18 19:21:37 +02:00
can1357 38d1d3a2f5 feat(coding-agent): vendor relevant parts of markit 2026-06-18 19:11:22 +02:00
can1357 81563e0155 feat(coding-agent): improved retry safety for partial message streams
- Refactor replay safety logic to specifically prevent retries when a tool call is present in the assistant message.
- Enable retries for transient stream errors occurring during partial text or thinking sequences, ensuring consistency when no tool call has been completed.
- Add regression tests to verify that transient socket closures are successfully recovered while completed tool calls remain protected from redundant retries.
2026-06-18 18:58:15 +02:00
can1357 30a133cef7 feat(coding-agent): prevented stale advisor data leakage across conversations
- Add an epoch counter to `AdvisorRuntime` to discard in-flight advisor batches when a reset or disposal occurs.
- Introduce `resetAdvisorSessionState` to clear advisor-specific queues, latches, and pending cards, ensuring pre-reset state does not interfere with new conversations.
- Extend `YieldQueue.clear` to support conditional clearing by entry kind.
2026-06-18 18:58:01 +02:00
can1357 831b664a4c perf(coding-agent): optimized documentation indexing via compressed blob
- Replaced raw TypeScript documentation map with a lazily-inflated gzip blob.
- Reduced bundled binary/npm package size by approximately 0.9MB.
- Encapsulated index logic into `docs-index.ts` to separate header metadata from content.
- Added `postpack` and robust `try/finally` patterns in build scripts to ensure clean artifacts.
- Implemented disk-based fallback during development to maintain existing developer experience.
2026-06-18 18:57:13 +02:00
can1357 f5ebab2b83 feat(utils): vendor mermaid rendering 2026-06-18 18:52:38 +02:00
can1357 4d8b6a9614 feat(coding-agent/debug): added remote javascriptcore inspector support
- Implemented a bridge to the `bun:jsc` remote inspector API.
- Added a debug interface action to start the inspector and expose the connection endpoint.
- Included logic to dynamically reserve available ports and reliably probe the socket state due to inherent platform-dependent limitations in the underlying API.
2026-06-18 17:40:40 +02:00
can1357 8427e69e1e fix(coding-agent): prevented puppeteer startup crashes
- Avoided value-imports of `puppeteer-core` in main startup files to prevent eager loading of the browser-data dependency graph.
- Used `import type` and literal string checks to defer `puppeteer-core` initialization until browser tools are actually invoked.
- Added a test to verify that `puppeteer-core` and `@puppeteer/browsers` remain off the eager startup import graph.
- Externalized additional heavy dependencies to reduce bundle size and improved minification settings in the build script.
2026-06-18 17:22:37 +02:00