Commit Graph

9151 Commits

Author SHA1 Message Date
can1357 2a7cb56abd feat(agent): rendered conversation logs with preferred tool syntax
- Updated compaction, branch summarization, and session dump formatting to pass preferred model tool syntax into conversation serialization.
- Enhanced shared serializers to render assistant tool calls and tool results through grammar envelopes when syntax is available, with the prior compact format as fallback.
- Aligned prompt, preview, and test fixtures to the new transcript tags: `[Think]`, `[Tool Call]`, and `[Tool Result]`.
2026-06-15 12:32:47 +02:00
can1357 fc912904e1 feat(coding-agent/prompts): made oracle and reviewer prompts non-blocking
- Removed the blocking flag from the oracle agent prompt metadata.
- Removed the blocking flag from the reviewer agent prompt metadata.
2026-06-15 12:19:48 +02:00
can1357 6a0710dd1d fix(ai): forwarded native tool calls through in-band owned stream
- Owned stream wrapping handled `toolcall_start`, `toolcall_delta`, and `toolcall_end` events from provider-native calls.
- The in-band projector tracked native calls by source index, created projected tool blocks, emitted lifecycle events, and committed final call fields so toolUse output is preserved.
- Gemini example rendering omitted the `default_api.` prefix when rendering examples, and a regression test covered native tool-call passthrough without in-band code text.
2026-06-15 12:19:32 +02:00
can1357 3ab675a83b fix: added buffered worker inboxing and standardized worker selectors
- Added `WorkerInbox` and `installWorkerInbox(port)` to queue worker messages before bind.
- Added `consumeWorkerInbox()` to replay buffered messages and clear one active inbox.
- Added buffered inbox consumption in JS and tab worker transports before direct message handlers.
- Normalized worker selector arguments to the `__omp_worker_*` naming across workers and tests.
2026-06-15 11:59:44 +02:00
can1357 39f866fc73 feat(agent): added interruptible tool polling for queued steering
- Added an `interruptible` field to AgentTool and documented when it is honored.
- Updated immediate-mode tool execution to poll steering during in-flight interruptible calls and abort them when steering is queued.
- Marked the coding `job` tool as interruptible and added tests covering mid-wait aborts versus boundary-only steering drain.
2026-06-15 11:53:25 +02:00
can1357 6385afdfb7 test(coding-agent): replaced Bun.sleep and wall-clock timing
- Replaced Bun.sleep and wall-clock timing with fake timers (vi.useFakeTimers), release gates, and deterministic polling across 15+ test files to eliminate flakiness and improve speed.
- Consolidated per-test fixture setup into beforeAll/afterAll lifecycle hooks across 20+ test files, reducing redundant initialization and improving test performance by reusing shared immutable fixtures.
- Stubbed network calls in ModelRegistry and test discovery to prevent unintended outbound requests during test execution.
- Replaced subprocess-based test coordination (file markers, Bun.sleep polling) with in-memory fakes (FakeWebSocket, FakeLspServer, VirtualClock) for deterministic, fast test execution.
2026-06-15 11:48:55 +02:00
can1357 9e65499e15 test(coding-agent): simplified agent hub row ordering test assertions
- Added a helper that renders hub output and extracts ordered agent IDs.
- Replaced positional string assertions with explicit row-order expectations.
- Awaited asynchronous theme initialization in test setup.
2026-06-15 11:43:33 +02:00
can1357 2de2926320 feat: added Gemini and Gemma in-band tool syntax support in runtime
- Added Gemini and Gemma syntax routing by model family and owned syntax env values.
- Added Gemini and Gemma in-band parsers for tool_code and token-based tool_call streams.
- Added rendering support for Gemini fenced tool_code/tool_outputs and Gemma tool tokens.
- Fixed parsing edge cases for comments, string escapes, nested args, and truncated blocks.
2026-06-15 11:40:55 +02:00
can1357 fc2ba5073a fix(coding-agent): fixed interactive input queueing during session race windows
- Added a streamingBehavior field to submitted user inputs and threaded it through interactive mode types and controller start-up.
- Updated interactive submission dispatch to default to followUp queueing while preserving explicit steer intent when provided.
- Changed tests to verify followUp and steer queueing behavior, preventing AgentBusyError from race-window busy sessions.
2026-06-15 11:38:31 +02:00
can1357 9566c22c77 fix(coding-agent): preserved row order in open agent hub
- Captured each row's initial position in AgentHubOverlayComponent on first refresh and reused it on later refreshes.
- Changed subsequent sorting to prioritize status then prior row position, so activity updates no longer reordered visible rows.
- Added a regression test that verifies row ordering stays stable when activity changes and new agents append at the end.
2026-06-15 11:08:15 +02:00
can1357 6a476a90cd fix(coding-agent/session): tracked agent_end as post-prompt task to avoid recovery race
- #handleAgentEvent now delegates non-`agent_end` events to a new `#processAgentEvent` routine.
- For `agent_end`, it tracked a resolver promise via `#trackPostPromptTask` before awaiting event handling and resolved it in `finally`.
- This kept `#waitForPostPromptRecovery()` from returning before deferred compaction or handoff work was registered.
2026-06-15 11:01:23 +02:00
can1357 d6c51fe69a feat: hashline .= as seperator 2026-06-15 10:46:45 +02:00
can1357 4d95a0e1dc feat(catalog/provider-models): added OpenAI model provider descriptors
- Updated default model identifiers across many catalog providers to newer model versions.
- Renamed a couple OpenAI compatibility provider descriptors, including Together and Zhipu coding-plan identifiers.
- Added multiple new OpenAI-compatible specialized provider descriptors for additional model provider families.
2026-06-15 10:40:48 +02:00
can1357 e680bc0ca3 feat(catalog): added Azure OpenAI support to registry and catalog compatibility
- Added `azure` provider registration in the AI registry with API key env mapping.
- Added Azure provider descriptors with default model `gpt-4o` and catalog discovery metadata.
- Enabled Azure-specific OpenAI compatibility for developer roles and strict responses pairing.
- Added Azure models namespace using OpenAI-family IDs with `models.dev` filtering and responses transport.
2026-06-15 10:06:26 +02:00
roboomp e9ea8a87d2 fix(agent): tracked non-message context deltas
Track the non-message token estimate used for provider-anchored assistant usage, then add only positive current system/tool growth during pre-prompt threshold checks. Restore released collab changelog entries to the immutable 15.13.1 section.

Fixes #2628
2026-06-15 09:47:28 +02:00
roboomp 6d063d5e2a fix(agent): preserved non-message pre-prompt tokens
Include the current system prompt and active tool schemas when provider-anchored pre-prompt checks estimate threshold pressure, and cover the case with a regression test.

Fixes #2628
2026-06-15 09:47:25 +02:00
roboomp 2f81862935 fix(agent): aligned pre-prompt context usage
Use provider-anchored context usage for pre-prompt context-full threshold checks when available, then add only pending prompt tokens. This keeps OpenAI Responses encrypted reasoning payloads from overcounting local prompt pressure while the visible context usage remains below threshold.

Fixes #2628
2026-06-15 09:47:20 +02:00
can1357 e805b34ecf feat(coding-agent): added unexpected-stop detection with automatic retries and a 3-retry cap
- Added `features.unexpectedStopDetection` and `unexpectedStopModel` settings for opt-in behavior.
- Added assistant-stop handling to classify stop reasons and resume generation with retry prompts.
- Added unexpected-stop classifier logic with candidate checks, model fallback, and YES/NO parsing.
- Added retry tracking that caps auto-continues at three attempts and logs a warning when exceeded.
2026-06-15 09:38:25 +02:00
can1357 75ab023434 fix(actions/bun-install): retried bun install with job-local cache on first-attempt failure
- Updated the bun-install action to retry `bun install --frozen-lockfile` when the first attempt fails.
- Added a fallback path that creates a temporary job-local cache directory and reruns install with `--cache-dir`.
- Emitted a warning to note the shared-store failure before the retry path is used.
2026-06-15 09:25:02 +02:00
can1357 b7b1b54f6a chore: bump version to 15.13.2 2026-06-15 08:49:41 +02:00
can1357 eaffa00177 fix(coding-agent/eval): routed JS worker ready signaling through init response
- Updated worker core so it emitted `ready` only after receiving an `init` message instead of on construction.
- Changed worker startup to send `init` before waiting for readiness, enabling startup errors to fail fast and trigger fallback.
- Expanded JS worker tests with startup-error simulation and verified execution falls back to the inline worker when spawning fails.
2026-06-15 08:49:00 +02:00
can1357 ebe05c3fc2 fix(coding-agent/eval): fixed JS eval worker initialization with inline fallback on failure
- Initialized JS workers through a new helper that attaches message and error listeners before initialization handshake and enforces the existing ready timeout.
- Handled startup failures by rejecting on init or error events, cleaning up listeners and replacing dead workers with a retry path.
- Retried session creation with an inline worker after non-inline init failure so requests no longer stall on worker startup timeouts.
2026-06-15 08:45:15 +02:00
can1357 162f8bdd70 Merge remote-tracking branch 'origin/farm/ef25d9b3/codex-responses-route-deltas-by-item-id' 2026-06-15 08:35:01 +02:00
roboomp e114f3b1b2 style: bun run fix 2026-06-15 06:29:00 +00:00
roboomp da94f27edd fix(ai): tracked unkeyed current open item via currentEntry
The keyed maps only see items whose `output_item.added` carries `item.id`
or `output_index`. A fully keyless add never reached either map, and the
unkeyed fallback was scanning those maps instead of the actual current
item — so `function_call_arguments.delta` / `output_item.done` for a
keyless tool call landed on null and the stored block kept `{}`. Mixed
streams also picked an older `output_index` entry before a later
id-only current item for the same reason.

`CodexStreamRuntime.currentEntry` now always points at the most recently
added `output_item.added` (whether or not it has keys). `openItemForEvent`
returns `currentEntry` when both `item_id` and `output_index` are absent,
and `closeCodexOpenItem` clears `currentEntry` (alongside the legacy
`currentItem` / `currentBlock` mirrors) when its item closes. The keyed
maps are unchanged so deliberate drop-on-mismatch for keyed events still
holds.

Regression tests cover the fully keyless function-call stream and the
mixed id-only vs `output_index`-only ordering. Existing reasoning/message
flow keeps singleton semantics through the same fallback.

Fixes #2619
2026-06-15 06:28:35 +00:00
can1357 ee6e036073 chore(scripts): raised native test parallelism and removed failure-only test flag
- Removed the `--only-failures` flag from workspace test commands so CI runs complete test passes.
- Raised native test mode parallelism from 1 to 4 for native and integration package execution.
2026-06-15 08:27:59 +02:00
can1357 8f7112e853 build: remove fix:changelogs from fix script 2026-06-15 08:22:12 +02:00
can1357 70f6059fdf fix(ai): fixed cursor MCP tool-call streaming merge logic for oversized args
- Handled cumulative Cursor `argsTextDelta` snapshots by stripping prior JSON prefix before parsing.
- Merged completion-frame `McpArgs` into streamed args while preserving omitted keys and structured values.
- Preserved streamed tool-call arguments when completion-frame `McpArgs` omitted oversize payload keys.

Fixes #2617
2026-06-15 08:21:45 +02:00
can1357 d6471c2244 feat(coding-agent/tools): allowed flattened init for Gemini TODO calls
- Updated `init` handling to build a single-phase list from `items` when `list` is absent, using `phase` if provided or defaulting to `Tasks`.
- Kept the existing init validation behavior by emitting `Missing list for init operation` only when neither `list` nor `items` was supplied.
- Added tests for flattened init forms, including implicit phase defaulting, explicit phase use, and the missing-input error case.
2026-06-15 08:19:18 +02:00
can1357 5afe0e5832 fix(ai/grammar): updated grammar rendering for example tool-call output
- Added an `example` option to `GrammarRenderOptions` and threaded it through grammar tool-call renderers.
- Updated Harmony tool-call rendering to output raw argument JSON when example mode is enabled.
- Removed `string` attributes from generated XML `parameter` elements in tool invocation output.
2026-06-15 08:17:20 +02:00
roboomp 69ae68db8a style: bun run fix 2026-06-15 06:14:25 +00:00
roboomp 5f3d8643d5 fix(ai): finalized idless codex calls by output_index
Codex Responses function/custom tool call items can omit `id` while still
carrying `output_index` on `output_item.added` and `output_item.done`.
The first pass only keyed open items by `item.id`, so idless done events
could not find the stored block and the authoritative final arguments were
not copied into `output.content`.

Track open items by both `item.id` and `output_index`. Event lookup now
uses `item_id` first, then `output_index`, and only falls back to the
singleton-current path when neither key is present. Closing an item removes
both keys, so stale keyed deltas remain dropped instead of leaking into a
sibling.

Added a regression covering idless function and custom tool calls finalized
only by `output_item.done`, including out-of-order completion and per-call
`contentIndex`.

Fixes #2619
2026-06-15 06:14:02 +00:00
can1357 8b7dd10a8a feat: added native tool inventory rendering with TypeScript signatures
- Added `jsonSchemaToTypeScript` and `renderToolInventory` to generate tool blocks with TypeScript signatures.
- Added `examples` and `TSchema` fields to dump-tool metadata and passed them through prompt rendering.
- Changed Harmony invocation rendering to omit `<|constrain|>json` markers in tool call payloads.
- Added compact native tool list-mode inventory rendering with full `# Tool:` output elsewhere.
2026-06-15 08:12:58 +02:00
roboomp 03895acdeb style: bun run fix 2026-06-15 05:56:50 +00:00
roboomp cf71cfa832 style: bun run fix 2026-06-15 05:55:43 +00:00
roboomp cdfc1cce3e fix(ai): routed codex responses arg deltas by item_id
The Codex Responses stream runtime tracked a singleton
`currentItem`/`currentBlock`. With more than one tool call open
concurrently every `response.function_call_arguments.delta` was
appended to whichever item was added most recently, and the next
`response.output_item.done` for the earlier call overwrote the
sibling's stored arguments. On the agent loop's `task` tool this
surfaced as `tasks: Invalid input: expected array, received undefined`.

Open items are now tracked in a `Map<string, CodexOpenItem>` keyed by
`item.id`, each entry carrying its own `block` and `contentIndex`.
`response.function_call_arguments.{delta,done}`,
`response.custom_tool_call_input.{delta,done}`, and
`response.output_item.done` route through `openItemForEvent` and
operate on the matching entry's block; the legacy singleton-current
fallback only kicks in when an event omits `item_id`. A delta whose
keyed item already closed is dropped instead of leaking into a
sibling, and `toolcall_delta` / `toolcall_end` stream events emit the
right `contentIndex` for each call. Recovery sites converge on a new
`resetCodexStreamAccumulators` helper that clears the open-items map
in lockstep with `currentItem`/`currentBlock`/`nativeOutputItems`.

Regression test (`packages/ai/test/openai-codex-stream.test.ts`)
interleaves two function-call argument streams plus a stale
post-close delta and asserts per-call argument integrity and
per-call stream `contentIndex`.

Fixes #2619
2026-06-15 05:55:24 +00:00
can1357 ba82ed6e59 test: update hashline tests 2026-06-15 07:47:54 +02:00
can1357 641be81478 feat: added control over fabricated tool-result stream handling
- Added an abortOnFabricatedToolResult option to Agent and AgentLoopConfig to choose whether in-band fabricated tool results are aborted or drained.
- Propagated the option through agent loop wiring into wrapInbandToolStream so fabrication is aborted only when enabled.
- Exposed the setting in coding-agent as tools.abortOnFabricatedResult and wired it through session creation with a true default.
2026-06-15 07:44:03 +02:00
can1357 55d42cd5cf ci(workflows): added conditional sccache setup for self-hosted and GitHub runners
- Detected the runner environment in CI by checking SCCACHE_BUCKET and exporting an on_infra output.
- Updated the workflow to use the local ensure-sccache action on self-hosted runners and mozilla-actions/sccache-action on GitHub-hosted runners.
2026-06-15 07:37:58 +02:00
can1357 7687810c5d feat: added syntax-aware tool example rendering across catalog, AI, and agent modules
- Added model-to-syntax mapping in catalog with preferred tool-call syntax API.
- Added `ToolExample` typing and `ToolCallSyntax` exports across tool/grammar interfaces.
- Added syntax-aware tool example rendering through provider-specific grammar invocations.
- Added `exampleSyntax` context flow and example metadata so rendered prompts include examples.
2026-06-15 07:33:25 +02:00
can1357 52f2ade900 fix(ai/grammar): stripped template whitespace after control token boundaries
- Added a `#stripLeadingWhitespace` state flag to track whitespace after a dropped control token.
- Trimmed leading whitespace from the scanner buffer at the start of outside-token consumption when the flag was set.
- This suppressed template-control trailing spaces from being emitted in visible text.
2026-06-15 07:33:25 +02:00
can1357 4c786de933 feat(coding-agent/tui): added start-based truncation support for tree list rendering
- Added a `truncateFrom` option to `TreeListOptions` supporting `start` and `end` modes, defaulting to `end`.
- Updated `renderTreeList` to compute candidate items and summary placement based on truncation direction.
- Set the todo list renderer to use start-side truncation so collapsed todo output shows the tail entries first.
2026-06-15 07:33:25 +02:00
can1357 a1070d055e feat(coding-agent/modes): updated large-paste menu with explicit attachment actions
- Replaced large-paste wrap options with a single `<attachment>` wrapper action.
- Added explicit local-file attachment and inline paste choices to the selector.
- Updated the changelog to document the new large-paste action set.
2026-06-15 07:33:25 +02:00
can1357 fbba331f8a feat(cross-cutting): added multi-syntax in-band tool-call support for runtime tool conversion
- Added optional Agent and SDK tool-call syntax controls (`toolCallSyntax`, `PI_OWNED_TOOLS`) for owned calls.
- Added in-band grammar scanners and renderers for Anthropic, DeepSeek, GLM, Hermes, Kimi, PI, and Qwen3.
- Added supportsTools propagation and model schema updates to route unsupported models to fallback syntax.
- Replaced stream-markup parsing with syntax-specific in-band scanners and event conversion.
2026-06-15 07:33:24 +02:00
can1357 907bc9979e feat: renamed opcodes to simplified variants
- Renamed line and block patch op verbs to XCHG, DEL, and INS in parsing and formatting.
- Updated grammar and tokenizer to support XCHG.BLK, DEL.BLK, and INS.PRE/POST/HEAD/TAIL forms.
- Updated diagnostics, docs, prompts, tests, and changelog to use XCHG/DEL/INS-based operators.
- Expanded session-stats parsing to normalize legacy op aliases to compact IDs.
2026-06-15 07:33:24 +02:00
can1357 6639d6e1f7 feat(coding-agent/modes): added conditional nerd-font tip for unicode welcome mode
- WelcomeComponent now lazily selected and cached a tip per instance, preserving it across re-renders.
- With the unicode preset, it showed a special nerdfont tip 10% of the time and otherwise used the regular tip rotation.
- Added tests that mocked theme preset and Math.random to verify standard and special tip selection behavior.
2026-06-15 06:10:52 +02:00
can1357 628809a09a fix(coding-agent): promote context before pre-prompt compaction and fall back from overflowing snapcompact
The pre-prompt context check ran compaction directly, so snapcompact (or
any strategy) fired before auto-promote ever got a chance — defeating
Auto-Promote Context. It now tries promotion to a larger-context model
first (mirroring the post-turn threshold path) and only compacts when no
target is available.

Auto and manual compaction now project a snapcompact result's
post-compaction size (kept history + frames at the image budget + summary
+ non-message overhead); when it still exceeds the model's usable window,
they downgrade to a context-full LLM summary instead of leaving the
session overflowing.
2026-06-15 05:45:42 +02:00
can1357 bc6130aad4 fix(natives): build linux addons against a glibc 2.17 floor via cargo-zigbuild
Native linux-x64/arm64 builds moved onto the Ubuntu 24.04 (glibc 2.39)
omp-kata runner. The x64 addon was a plain host build that linked the
runner's glibc and failed to dlopen with `version 'GLIBC_2.39' not found`
on older distros; the arm64 cross-build floated up to GLIBC_2.30. Build
the shipped linux-gnu addons through cargo-zigbuild against a pinned 2.17
floor so they load on any glibc >= 2.17.

- build-native.ts: key the tree-sitter-just `-UNDEBUG` CFLAGS off the
  bare triple (cargo-zigbuild strips the `.2.17` glibc suffix before
  invoking cargo) and symlink the suffixed target dir napi 3.7.0 expects
  to the bare dir cargo-zigbuild writes, so postBuild copyArtifact finds
  the cdylib.
- build-native action: add a `glibc` input plus a resolve step deriving
  the zigbuild cross_target (suffixed) and the rustup bare_target
  (stripped); gate zig/cargo-zigbuild install on cross_target so the
  host-arch x64 build still runs native Rust tests.
- ci.yml: GLIBC_FLOOR=2.17 fed to the linux-x64 and linux-arm64 native
  jobs.

Re-tags 15.13.1, whose release failed at the linux-x64 binary smoke
before any publish step ran.
2026-06-15 05:39:02 +02:00
can1357 6c48b6224d chore: bump version to 15.13.1 2026-06-15 04:36:40 +02:00
can1357 35abd9ff71 chore: update changelogs 2026-06-15 04:35:55 +02:00