Commit Graph

950 Commits

Author SHA1 Message Date
can1357 ffab5689a0 Merge PR #5497: fix(catalog): prune unsupported Codex account models (@roboomp)
# Conflicts:
#	packages/catalog/src/discovery/codex.ts
#	packages/catalog/src/models.json
#	packages/catalog/test/codex-discovery.test.ts
2026-07-18 21:02:46 +02:00
eval 3a33b2bb53 fix(coding-agent): restore cache-omitted headers in registry startup loaders and preserve unrelated runtime discoveries in scoped refresh
The v10 model cache never persists request headers (#5780). The registry's
startup cache readers (#loadCachedStandardProviderModels /
#loadCachedDiscoverableModels) read cache.models directly, so cached rows
replaced bundled models (github-copilot, kimi-code, nanogpt) with header-less
copies for the cache TTL after every restart. Restore bundled static headers,
drop unrestorable rows so bundled fallbacks win the merge, and mark
discoverable providers stale when header-bearing models were excluded.

refreshProvider's #reloadStaticModels could also evict models discovered by
other runtime providers; re-merge them from cache with online-if-uncached.
2026-07-18 20:14:11 +02:00
can1357 c6602de1cf Merge PR #5687: feat(config): add PI_CONFIG_FILES settings overlay env var (@roboomp) 2026-07-18 20:12:48 +02:00
can1357 5c9b5f7b64 Merge PR #5890: fix(ai): allow custom OAuth fingerprint header overrides (@roboomp) 2026-07-18 19:57:45 +02:00
can1357 b8091d4f2c Merge PR #5972: fix: resolve configured model roles in --model (@paralin) 2026-07-18 19:42:51 +02:00
roboomp 2d27bfdd66 fix(search): allowed command-backed codex keys
- Exposed command-backed provider-key detection from ModelRegistry.
- Allowed configured Codex command keys to outrank stored OAuth while preserving the custom-endpoint OAuth guard.
- Added resolver-precedence regression coverage.

Fixes #6001
2026-07-18 15:34:03 +00:00
Christian Stewart 670304eafa fix(coding-agent): resolve bare model role aliases
Signed-off-by: Christian Stewart <christian@aperture.us>
2026-07-18 03:51:09 -07:00
roboomp 913ec0baae fix(kimi-code): preserved k3 native effort contract
- Parsed live named efforts, mandatory-thinking state, and model protocol metadata.

- Sent native Kimi named efforts and adaptive Anthropic override efforts without generic token budgets.

Fixes #5893
2026-07-17 18:19:00 +00:00
roboomp 67ca037b17 fix(ai): allowed custom oauth fingerprint headers
Added an opt-in compatibility flag for non-official Anthropic OAuth endpoints while preserving authoritative OAuth and Cloudflare credentials.

Fixes #5888
2026-07-17 17:44:47 +00:00
roboomp 6558b5ec05 feat(config): added PI_CONFIG_FILES settings overlay env var
Loaded a platform-delimited (: on Unix, ; on Windows) path-list of settings overlays from PI_CONFIG_FILES before explicit --config overlays, so wrapper-based setups can inject settings without argv surgery.

Dropped the earlier global --config extraction as too risky; --config remains a launch/acp/models flag as before.

Fixes #5685
2026-07-17 10:35:19 +00:00
can1357 450bea6cc7 feat(coding-agent): disabled generate_image by default
Lands the intent of #5318 on the established generate_image.enabled
gate instead of introducing a parallel imagegen.enabled key; sessions
must opt in before the tool registers top-level or as an xd:// device.
2026-07-17 05:32:51 +02:00
can1357 4e0e53c183 merge PR #5321 via eval/pr-5321: feat(coding-agent): generate_image per-request provider + Codex-subscription images 2026-07-17 05:29:29 +02:00
can1357 a7eadcae46 merge PR #5635 via eval/pr-5635: fix(coding-agent): disable thinking on local llama.cpp Qwen models 2026-07-17 05:23:49 +02:00
can1357 8bdb69254b merge PR #5596 via eval/pr-5596: feat(coding-agent): support per-project model roles
Combined #5586's role-tag precedence with #5596's scope labels in the
selector status messages.
2026-07-17 05:23:49 +02:00
can1357 87bd6c7b94 Merge branch 'sweep/2026-07-17' into eval/pr-5321
# Conflicts:
#	packages/coding-agent/src/config/settings-schema.ts
#	packages/coding-agent/src/tools/image-gen.ts
#	packages/coding-agent/test/tools/image-gen.test.ts
2026-07-17 05:23:41 +02:00
can1357 fd6f2e0b94 merge PR #5721 via eval/pr-5721: fix(coding-agent): stop post-turn maintenance turns
Resolved sdk.ts overlap with #5651 (kept getCursorTools alongside the
extracted transformToolCallArguments) and beginDispose overlap with
#5668 (kept both title-generation and autolearn-capture aborts).
2026-07-17 04:40:03 +02:00
can1357 30b9e8c158 merge PR #5641 via eval/pr-5641: fix(coding-agent): migrate legacy nested autoqa/todo settings keys 2026-07-17 04:37:09 +02:00
can1357 1424cae066 feat(coding-agent): added id-prefixed wildcard support to retry fallback chains
- Implemented parsing of id-prefixed wildcard keys and entries, allowing provider-specific prefixes in retry fallback configuration.
- Added logic to re-prefix failing model IDs and to match id-prefixed keys, with validation of provider existence.
- Updated settings schema description and changelog, and added tests covering the new behavior.
2026-07-17 03:49:43 +02:00
Gerben Meijer 1e083eb832 feat(coding-agent): support per-project model roles 2026-07-17 01:22:23 +04:00
roboomp e518bc22c4 fix(coding-agent): stopped post-turn maintenance turns
- Prevented compaction from reopening a settled terminal answer unless queued work or an active goal remains.
- Ran auto-learn capture in an abortable detached agent with constrained tools and isolated provider state.
- Replaced primary-turn capture coverage with private-capture regression tests.

Fixes #5715
2026-07-16 14:55:27 +00:00
Christian Stewart e3aa6594e5 fix(coding-agent): disable thinking on local llama.cpp Qwen models
A Qwen-family model served through llama.cpp ships a jinja chat template that
defaults `enable_thinking: true`, but `discoverLlamaCppModels` stamped every
local model with `reasoning: false` and an empty compat, so `--thinking off`
never reached the wire and the model kept emitting a reasoning block.

Route Qwen-family ids (plus the Qwen3.6-derived PrismLM Ternary Bonsai GGUFs,
matched with a scoped pattern rather than broadening the global
`isQwenModelId`) through a shared `applyLlamaCppQwenThinking` upgrade. It gives
them `reasoning: true` with the `qwen-template-false` disable dialect and
`qwenPreserveThinking`, since omp emits `preserve_thinking` inside
`chat_template_kwargs` for Qwen, and switches them to the chat-completions API
because the implicit llama.cpp provider defaults to `openai-responses`, whose
disable path has no Qwen encoding. The runtime base URL gains a `/v1` suffix so
the completions request does not POST to the native root, which serves
`/models` and `/props` but not `/chat/completions`; a model kept on a custom
transport (e.g. `pi-native`, whose client appends `/v1/pi/stream`) retains its
base URL so the suffix is not doubled. Non-Qwen local models keep the
configured api, base URL, and minimal compat.

The upgrade is idempotent and re-applied as the outermost transform after
discovery merges, provider/transport overrides, and cache fallbacks, so a
configured native-root `baseUrl` (which wins in `mergeDiscoveredModel`) or a
fallback to a pre-fix cached row cannot leave the routed model on the old
`openai-responses` / `reasoning: false` spec. Because routed models carry a
`/v1` base URL, the runtime metadata refresh probes the native `/models`
endpoint (stripping `/v1`, matching the existing `/props` probe) so a model's
`meta`, `status.args`, and `architecture.input_modalities` fields are not lost.

Adds discovery tests pinning the resolved reasoning/api/base URL/compat for
Qwen and non-Qwen local ids, that a configured native-root provider keeps the
`/v1` runtime URL, that a pi-native-transport model keeps its gateway URL, and
that the runtime metadata refresh for a routed model stays on native `/models`.

Signed-off-by: Christian Stewart <christian@aperture.us>
2026-07-15 21:47:48 -07:00
can1357 a3283a157c merged PR #5443: fix(tools): prefer active image provider and fall back 2026-07-16 03:32:01 +02:00
can1357 a55e4b1a7b fix(model-resolver): preserve fuzzy literal thinking suffixes 2026-07-16 03:32:01 +02:00
can1357 0b6ce1d185 merged PR #5447: fix(model-resolver): strip thinking suffix before fuzzy model match 2026-07-16 03:32:01 +02:00
can1357 c098e8679d merged PR #5601: fix(web-search): honor configured xAI transport 2026-07-16 03:31:58 +02:00
can1357 6783c3a473 merged PR #5573: fix: disable eager tool streaming for custom Anthropic endpoints 2026-07-16 03:31:57 +02:00
roboomp ec6511524e fix(coding-agent): migrate legacy nested autoqa/todo settings keys
The v17 rename (46ad908) of dev.autoqa.consent -> dev.autoqaConsent and
todo.reminders.max -> todo.remindersMax added no case to
Settings.#migrateRawSettings, so pre-rename nested or quoted-dotted config
left the leaf beneath the parent path. The parent then resolved to an
object, making dev.autoqa truthy (isAutoQaEnabled saw Auto QA enabled) and
discarding the reminder limit.

Lift both legacy leaves onto the new keys during raw settings load via a
shared migrateNestedLeafRename helper: an explicit new key wins, a
separately configured parent boolean is preserved, an irrecoverable
object-valued parent is dropped so the schema default applies, and only the
new representation persists on save.

Fixes #5632
2026-07-16 01:23:01 +00:00
roboomp 188985eb0f fix(models): isolated provider header defaults
- Resolved provider headers only from static and runtime provider overrides.
- Kept unrelated per-model header overrides out of native tool requests.
- Added regression coverage for xAI model-scoped tenant headers.

Fixes #5599
2026-07-15 17:53:47 +00:00
roboomp 91b67c7b0f fix(web-search): honored configured xai transport
- Routed native xAI Responses search through configured provider base URLs and headers.
- Kept endpoint credentials coupled and rejected official OAuth tokens for custom endpoints.
- Added proxy routing and credential-leak regression coverage.

Fixes #5599
2026-07-15 17:44:30 +00:00
can1357 c2a659df34 chore: fix stale tests 2026-07-15 19:16:41 +02:00
can1357 46ad908245 fix(coding-agent): renamed settings keys to avoid nested-value lookup collisions
- Updated schema and runtime paths to use `dev.autoqaConsent` and `todo.remindersMax`, including auto-QA consent reads/persistence and todo reminder limit checks.
- Adjusted settings expectations so obsolete BM25-discovery keys were dropped on load and `tools.xdev` now kept its default unless explicitly set.
- Added/updated tests for the setting key migration and refreshed issue-consent flows, plus a new `refreshMCPTools` test for steered `xdev-mount-notice` updates without prompt rebuilds.
2026-07-15 19:08:37 +02:00
can1357 bf3764fa4d feat(coding-agent): stabilize system-prompt cache across xd:// mount changes via delta notices
Instead of including the xd:// device inventory in the system-prompt signature, mount/unmount events now inject a steered `xdev-mount-notice` message so the system prompt (and its provider cache prefix) stays byte-stable across MCP connects and disconnects. Full device docs are picked up opportunistically on the next unrelated rebuild.

Also caps external (dynamic-mount) device descriptions to 200 chars in `docsAll` to prevent server-controlled prose from consuming prompt budget; built-ins keep their full curated docs, and `read xd://` always returns the untruncated text.

Legacy `discoveryMode: "off"` → `tools.xdev: false` migration is removed; the setting keeps its own default without inference from the deprecated key.
2026-07-15 19:07:31 +02:00
can1357 9afedb591e feat(coding-agent): added opt-in task prewalk and tightened --tools and xdev behavior
- Added a `task.prewalk` option (default `false`), removed default task `prewalk` flags, and updated prewalk resolution so bunded generic task execution only prewalks when explicitly enabled.
- Enforced strict `--tools` validation in CLI parsing, making unknown tool names fail fast with `CliUsageError` instead of being silently filtered.
- Migrated legacy discovery settings (`tools.discoveryMode`, `tools.essentialOverride`, MCP discovery keys) into updated `tools.xdev` handling with preserved explicit override behavior.
- Hardened xdev/ACP execution flow by capping `docsAll` payloads with overflow listing and remapping `xd://` dispatches/approval gating for correct execute/read behavior and reduced duplicate prompts.
2026-07-15 18:39:36 +02:00
can1357 5ff277349c refactor(coding-agent): consolidated tool surface onto xd:// devices and hub
- Added the `xd://` virtual device protocol (`internal-urls/xd-protocol.ts`, `tools/xdev.ts`): tools declaring `loadMode: "discoverable"` are unmounted from the request tools array and driven via `read xd://` (list/docs+schema) and `write xd://<tool>` (execute), gated by the `tools.xdev` setting (default on) and inlined into the system prompt.
- Merged the `irc`, `job`, and `launch` tools into a single `hub` tool (`tools/hub/`, `async/job-manager.ts`): messaging keeps `send`/`inbox`/`list`, job control maps to `wait`/`cancel`/`jobs`, process supervision keeps `start`/`logs`/`stop`/`restart`/`describe` with `ps`, and the unified `wait` races background jobs against peer messages; SDK `IrcTool`/`JobTool`/`LaunchTool` are replaced by `HubTool`.
- Removed the hidden `resolve` tool in favor of the `xd://resolve`/`xd://reject`/`xd://propose` resolution devices, auto-including `write` whenever a deferrable tool or plan mode is present.
- Removed the BM25 tool-discovery system: the `search_tool_bm25` tool, the `tool-discovery` module, the `tools.discoveryMode`/`mcp.discoveryMode`/`mcp.discoveryDefaultServers`/`tools.essentialOverride` settings, per-tool MCP selection, and the `mcp_tool_selection` message type.
- Unified tool presentation on `ToolLoadMode` (`essential`|`discoverable`), replacing the custom-tool `xdev?: boolean` opt-out; custom, extension, MCP, RPC host, image-generation, and TTS tools now default to `discoverable`, and added a `satisfies` predicate to `SoftToolRequirement`.
- Removed the standalone `ssh` command tool and `ssh/ssh-executor` (the `ssh://` read/write/search protocol stays), and made `--tools` address hidden built-ins.
- Updated collab-web to render `xd://` dispatches and `hub` op families, dropped the `search_tool_bm25`/`ssh`/`report-finding` renderers, refreshed tool docs and prompts, and migrated the affected tests and changelogs.
2026-07-15 15:16:29 +02:00
can1357 d50cc4e2d3 feat(coding-agent): made hashline seen-line guard opt-in via edit.enforceSeenLines
- Added the `enforceSeenLines` option to hashline `PatcherOptions` (defaults `true`); the seen-line guard in `Patcher` now runs only when enabled.
- Added the `edit.enforceSeenLines` coding-agent setting (default off) and wired it through `edit/hashline/execute.ts` into the `Patcher`.
- Stopped `file-snapshot-store` excluding column-clipped (>512-char) lines from a snapshot's seen set, so single-line edits on long lines apply without a full-width re-read.
- Updated `seen-line-guard` tests and the hashline/coding-agent changelogs.
2026-07-15 15:15:08 +02:00
roboomp 4b3ec660f3 fix(catalog): disabled eager streaming for custom anthropic
Defaulted eager tool input streaming to the canonical Anthropic API while allowing explicit models.yml opt-in for compatible proxies.

Fixes #5572
2026-07-15 11:20:12 +00:00
can1357 f3aad14ee9 fix(tui): restored compact editor border by default
- Restored the compact two-row `Editor` layout by default and gated the dedicated IME-safe bottom border behind `setImeSafeCursorLayout()`.
- Added `tui.imeSafeCursor` as an opt-in appearance setting and applied it to initial and replacement editors.
- Added regression coverage for compact default rendering while retaining terminal-local IME preedit protection.
- Updated the TUI changelog for the opt-in compatibility layout.
2026-07-15 13:16:07 +02:00
can1357 e4bbe34f61 config(coding-agent/config): disabled astGrep tool by default
- Set `astGrep.enabled` to `false` in the settings schema so it starts disabled.
2026-07-15 10:04:13 +02:00
can1357 425e583ae0 feat(coding-agent): added support for task-agent field and model resolution
- Added schema and type updates for task-agent fields and model resolver settings.
- Extended discovery helper logic to carry resolved task-agent metadata through execution setup.
- Updated task/agent registration and execution paths to use the new capability/field data.
- Expanded test coverage for agent-field parsing, model resolution, and executor prewalk behavior.
2026-07-15 00:50:55 +02:00
can1357 3663963b76 Merge PR #5466: fix(tools): gate generate_image behind setting and tool whitelist (@roboomp) 2026-07-14 22:58:48 +02:00
roboomp 5ec402fc10 fix(catalog): force codex refresh for authoritative pruning
Built-in discovery skipped the OAuth refresh whenever a fresh authoritative cache existed, so an openai-codex user with an expired access token never got the model manager constructed and stale bundled models (e.g. gpt-5.4-nano) stayed selectable for the full cache TTL. Force the refresh for authoritative providers and forward the registry fetch through the Codex manager so discovery honors the configured transport.

Fixes #5364
2026-07-14 20:47:46 +00:00
roboomp 5878ed8f49 fix(tools): gate generate_image behind setting and tool whitelist
generate_image was registered as a custom tool and force-activated via the alwaysInclude list in createAgentSession, so it survived --no-tools (empty toolNames) and any explicit whitelist that omitted it. There was also no generate_image.enabled setting, so /settings had no toggle.

Add a generate_image.enabled setting and only register the tool when enabled and either no whitelist is given or it names generate_image.

Fixes #5305
2026-07-14 18:06:10 +00:00
roboomp 8dfbe8e09d fix(model-resolver): strip thinking suffix before fuzzy model match
parseModelPatternWithContext ran matchModel on the whole pattern
(including a trailing :level thinking suffix) and only stripped the
suffix if that first pass missed. matchModel's provider-scoped fuzzy
match normalizes colons away and does subsequence matching, so
kimi-for-coding:high matched the longer sibling kimi-for-coding-highspeed
before the suffix was recognized as a thinking level, silently switching
model and billing tier.

Match the full pattern exactly first (new exactOnly mode skips the
fuzzy/substring fallbacks), then strip a valid :level suffix and recurse
before any fuzzy match; fuzzy-match the whole pattern only as a last
resort. Literal ids ending in :max still win via the exact pass.

Fixes #5151
2026-07-14 17:21:19 +00:00
roboomp 12c693a857 fix(tools): preferred active image provider with fallback
Preferred the active session provider after any explicit image preference and retained the configured auto order for remaining candidates.

Continued to the next credentialed image provider after HTTP failures.

Fixes #5218
2026-07-14 17:12:17 +00:00
can1357 7c1375ceb8 fix(coding-agent): preserve auth fallback resolution warnings 2026-07-14 18:41:16 +02:00
can1357 851b5a7c0c Merge PR #5377: fix(coding-agent): forward sessionId to getApiKey in subagent auth fallback (@djdembeck) 2026-07-14 18:41:16 +02:00
can1357 f786fe4a6f Merge PR #5147: fix(coding-agent): support models.yaml custom config (@roboomp) 2026-07-14 18:39:26 +02:00
can1357 8a5e73902c Merge PR #5247: Fix automatic rollover across quota-limited accounts (@jeffscottward) 2026-07-14 18:29:14 +02:00
djdembeck aa470b9e34 fix(coding-agent): forward sessionId to getApiKey in subagent auth fallback
The pre-flight auth check in resolveModelOverrideWithAuthFallback called
getApiKey without a session id. For providers with session-sticky OAuth
credentials, this returned undefined even though the credential was
usable once the subagent session started, causing the auth fallback to
silently replace the configured model with the parent's (#5325).

The subagent's id is now forwarded as the session id so session-sticky
credentials resolve during the pre-flight check. Genuinely broken auth
(stale OAuth, revoked tokens) still falls back as before.

Also propagate model resolution warnings through resolveModelOverride
and log them in the executor so users see why a pattern didn't match.
2026-07-14 00:28:42 -05:00
can1357 da24614d5a feat: added scrollback rebuild controls and prewalk status-line visibility
- Added `tui.scrollbackRebuild` configuration with interactive startup/controller wiring to apply `setScrollbackRebuild`.
- Exposed prewalk session state in `SegmentContext` and rendered a dedicated prewalk segment/icon in the status line.
- Added divergence-aware TUI full-paint logic that enables scrollback erase-and-replay rebuilds for non-multiplexer divergence cases.
- Updated rendering and streaming tests to verify rebuild behavior (`3J`) and eliminate stale marker expectations under drift scenarios.
2026-07-14 00:39:34 +02:00