Commit Graph

61 Commits

Author SHA1 Message Date
can1357 c6602de1cf Merge PR #5687: feat(config): add PI_CONFIG_FILES settings overlay env var (@roboomp) 2026-07-18 20:12:48 +02: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 1b267ad3fe fix(tui): restored alt-screen borrow for resize drag frames
- v17.0.1 (#5476) rewrote the normal buffer in place per SIGWINCH, so
  the terminal's own width reflow pushed wrapped fragments into native
  scrollback mid-drag and resize smoothness collapsed.
- Throwaway drag frames paint on the alternate screen again; the settle
  full paint fuses the buffer exit ahead of its destructive repaint.
- Kept the #5319 fixes: deferred overlay alt-exit fusing, confirmed-only
  DECRPM 2026 handling, and Warp's in-place resize path.
2026-07-17 05:49:22 +02:00
roboomp 68f84d7c20 fix(tui): prevented stale-buffer flicker
- Kept fullscreen replacement overlays mounted through asynchronous transcript rebuilds.
- Fused alternate-screen exit with destructive repaint and removed resize-time buffer switches.
- Preserved statically detected synchronized output when DECRQM probing is inconclusive.

Fixes #5319
2026-07-14 18:23:45 +00:00
can1357 68c3c7ea9d docs(providers): documented novita support 2026-07-10 12:08:44 +02:00
can1357 bb95fcfafe Merge PR #3732: fix(ai): honor NODE_EXTRA_CA_CERTS on every provider fetch (@roboomp) 2026-07-01 21:42:25 +02:00
roboomp 2c8b723083 fix(coding-agent): forwarded stream timeout settings
Forwarded persisted provider stream timeout settings into model requests so slow local LLM streams can widen or disable first-event and idle watchdogs without environment variables.

Fixes #3878
2026-06-30 07:07:41 +00:00
roboomp 41e9bc861b fix(ai): honored NODE_EXTRA_CA_CERTS on every provider fetch
Bun's fetch ignores NODE_EXTRA_CA_CERTS, so private-CA gateways failed
with `unknown certificate verification error` on every OpenAI-compatible,
Codex, Ollama, Azure Responses, and Google call. The env var was only
plumbed through resolveFoundryTlsOptions() on the Anthropic Foundry path.

Added a shared wrapper (wrapFetchForExtraCa / withExtraCaFetch) that
merges the resolved CA bundle into Bun's RequestInit.tls.ca and seeds
the system root store alongside it (Bun's tls.ca replaces the default
trust store when set). The wrapper composes with the existing proxy /
request-debug stack in streamDispatch and streamSimple, so every
provider call now picks up the env var. Path-mtime cache invalidation
mirrors the Foundry helper so rotating bundles are picked up live.

Fixes #3731
2026-06-28 15:57:44 +00:00
can1357 ac904fc70c fix: patched Kimi model edit mode fallback
- Added a fallback from `hashline` to `replace` mode for Kimi-family models to resolve compatibility issues.
- Introduced `PI_STRICT_EDIT_MODE` environment variable to bypass automatic model-specific edit-mode fallbacks.
- Updated `getEditVariantForModel` to perform case-insensitive matching for model variant configurations.
- Added comprehensive unit tests for edit mode resolution and settings configuration.
2026-06-26 13:17:35 +02:00
oldschoola 13bfc7b9c0 Remove Wafer Pass provider 2026-06-21 02:45:48 +02:00
Can Bölük b7fe6f61a1 Merge branch 'main' into fix/litellm-base-url 2026-06-17 11:37:28 +02:00
can1357 d5b3c78132 chore: update docs 2026-06-17 04:37:39 +02:00
Alexander Kirilin 11e6eb0c2c fix(litellm): support LITELLM_BASE_URL 2026-06-16 20:54:55 -04:00
sorphwer 89fb1b0a49 fix(tui): stop Warp resize feedback-loop redraw storm
The non-multiplexer resize fast path borrows the alternate screen for
throwaway drag frames. Warp reports a terminal height one row different
for the alt buffer, so each alt enter/leave emits a fresh SIGWINCH that
re-enters the fast path — a self-sustaining loop that floods ED3 full
repaints with completely stable geometry (observed ~130
fullPaint(clearScrollback) frames over 15s, continuing after the drag
stopped). PI_FORCE_SYNC_OUTPUT cannot help (it is a loop, not tearing);
tmux works because the multiplexer path never toggles the alt buffer.

Route resize through the in-place repaint path (no alt-screen borrow, no
ED3 rewrap) for multiplexers and for terminals that re-report size on
alt-screen toggles, via resizeRepaintsInPlace(). Default-on for Warp,
overridable with PI_TUI_RESIZE_IN_PLACE=1|0. Tradeoff matches a
multiplexer: scrollback above the window keeps its old wrap.

Tests assert no alt-screen borrow / no ED3 across a Warp resize burst and
that the override toggles both ways; existing direct-terminal resize
tests now pin TERM_PROGRAM so they stay deterministic under Warp.
2026-06-16 12:27:53 +08:00
oldschoola 7d721dc420 Add Umans AI Coding Plan provider 2026-06-15 03:58:20 -07:00
can1357 371846167b docs: update docs 2026-06-12 14:43:35 +02:00
can1357 ae84502b82 fix(coding-agent): bypass LSP for individual conflict resolution
Individual conflict resolution now bypasses the LSP writethrough to prevent formatting from corrupting other unresolved marker blocks and to avoid noisy diagnostics in partially resolved files.
2026-06-12 11:29:38 +02:00
can1357 8c3c68a048 feat(ai): added stateful previous_response_id chaining to the platform Responses provider 2026-06-12 02:33:46 +02:00
can1357 f2137becb8 fix: fixed prompt parsing, startup tracing, and help-command behavior
- Fixed help rendering so `--help` no longer triggers unrelated command loaders.
- Fixed startup span logging to emit markers only with PI_DEBUG_STARTUP set.
- Fixed logger startup trace behavior for `:start`, `:done`, and `:fail` phases.
- Fixed prompt template processing with cached raw-template compilation and safer formatting.
- Optimized symbol and tag parsing in prompt templates via manual parsers.
2026-06-10 02:17:35 +02:00
can1357 64e68f173b fix(tui): fixed terminal shrink semantics to preserve immutable committed scrollback
- Handled frame shrink by re-anchoring windowTop and chunkTo at commit boundaries.
- Reset committedRows when the frame shrank into committed content to keep history immutable.
- Treated geometryChanged like overlay when advancing chunkTo to stabilize repaint commit timing.
- Updated regressions to assert stable scrollback prefixes and no clear-home/dclear repaint bytes.
2026-06-09 21:31:58 +02:00
can1357 8f23ba511b fix: close several easy issues 2026-06-08 15:47:21 -03:00
can1357 bad1e2acd6 fix: restricted GitHub Copilot auth to COPILOT_GITHUB_TOKEN
- Changed the `github-copilot` service provider to resolve credentials only from `COPILOT_GITHUB_TOKEN`.
- Updated CLI extra help text to document `COPILOT_GITHUB_TOKEN` as the GitHub Copilot environment variable.
- Reworded environment variable docs to reflect the revised Copilot/GitHub token usage and order.
2026-06-08 00:42:23 +02:00
can1357 78700a2c77 feat(ollama): added OLLAMA_HOST and OLLAMA_CONTEXT_LENGTH support
- Used OLLAMA_HOST for implicit discovery when OLLAMA_BASE_URL is unset.
- Applied OLLAMA_CONTEXT_LENGTH override to discovered context budgeting.
2026-06-05 22:47:40 +02:00
can1357 b8a602ac2a test(auth): switched OAuth ranking tests to weighted selection
- Replaced top-rank assertions with weighted-preference distribution checks.
- Added cases for equal-priority balancing and 2x best-bucket cap.
- Added coding-agent snapshot-cache boot and seed tests.
2026-06-05 11:15:32 +02:00
Can Bölük 9f7c36c36b Merge pull request #1702 from basedcorp99/feat/cmux-terminal-id
Add cmux terminal surface detection to getTerminalId
2026-06-04 06:13:25 +03:00
can1357 86c56d6472 feat(tui): added DECCARA fill optimizer with OSC 66 and DEC 2026/2048
- Added a Kitty-only DECCARA optimizer painting solid bg panels as rectangles, with `PI_NO_DECCARA` kill switch.
- Added OSC 66 text-sizing width handling to slicing, truncation, and wrapping.
- Added DECRQM probes for DEC 2026 sync output and 2048 in-band resize.
- Added structured OSC 99 notification formatting.
2026-06-04 00:27:20 +02:00
can1357 4905e142c1 feat(tui): added PI_NO_SYNC_OUTPUT opt-out for DEC 2026 synchronized output
- Added `PI_NO_SYNC_OUTPUT=1` env var to disable DEC 2026 wrappers while keeping autowrap guards active around paints.
- Removed Termux-specific height-change no-op; all non-multiplexer resizes now repaint to prevent phantom blank rows.
- Added `linux-normal-vteNoSync-small` stress scenario and issue-1765 regression tests.
2026-06-03 11:30:48 +02:00
basedcorp99 3bcc02a19e Prefer cmux surfaces over host terminal ids 2026-06-02 13:18:01 +02:00
basedcorp99 b93be377ba pretty 2026-06-02 12:10:21 +02:00
basedcorp99 656e855e4a Add CMUX_SURFACE_ID to docs
Follow-up to CMUX_SURFACE_ID env var support — document it alongside
KITTY_WINDOW_ID, TMUX_PANE, etc. in environment-variables.md and
session-switching-and-recent-listing.md.
2026-06-02 11:52:19 +02:00
can1357 3c398c7eb1 Merge remote-tracking branch 'origin/farm/48a24745/fix-anthropic-custom-headers-web-search' 2026-06-02 10:11:24 +02:00
roboomp b3ec588921 fix(coding-agent): honored Anthropic search base URL for fallback auth
- Passed ANTHROPIC_SEARCH_BASE_URL through to Anthropic web search calls that use authStorage fallback credentials instead of only applying it with ANTHROPIC_SEARCH_API_KEY.
- Added regression coverage asserting fallback Anthropic credentials use the search-specific base URL.
- Updated the environment and web_search docs to reflect the actual credential and base URL resolution order.

Fixes #1694
2026-06-02 07:57:34 +00:00
roboomp 4bd0fe573c fix(anthropic): forward ANTHROPIC_CUSTOM_HEADERS for non-Foundry enterprise gateways
The Anthropic web search path built request headers via buildAnthropicSearchHeaders, which never threaded model headers through buildAnthropicHeaders, so ANTHROPIC_CUSTOM_HEADERS was dropped from every web-search request regardless of mode. The streaming path's resolveAnthropicCustomHeaders also gated on isFoundryEnabled(), so users with a corporate ANTHROPIC_BASE_URL + ANTHROPIC_CUSTOM_HEADERS (e.g. X-Gateway-Key) got 401s on web_search unless they set CLAUDE_CODE_USE_FOUNDRY=true.

Loosen the resolver to also apply when ANTHROPIC_BASE_URL points to a non-Anthropic host, export the baseUrl-keyed variant, and have buildAnthropicSearchHeaders pass the resolved custom headers as modelHeaders so search and streaming paths behave identically. Stock api.anthropic.com (no Foundry) still omits the headers.

Fixes #1693
2026-06-02 07:52:37 +00:00
roboomp 5b1e5a5c4a docs: documented ANTHROPIC_SEARCH_API_KEY and ANTHROPIC_SEARCH_BASE_URL
- Expanded the existing entries in docs/environment-variables.md so the override-semantics ('search-only, isolates from main ANTHROPIC_API_KEY / ANTHROPIC_BASE_URL / FOUNDRY_BASE_URL') are spelled out, and added a usage note for enterprise-gateway split routing.
- Surfaced the search-only env vars (ANTHROPIC_SEARCH_API_KEY / ANTHROPIC_SEARCH_BASE_URL / ANTHROPIC_SEARCH_MODEL) in the Anthropic provider section of docs/tools/web_search.md, where users were already looking.
- Added ANTHROPIC_SEARCH_BASE_URL alongside ANTHROPIC_SEARCH_API_KEY in 'omp --help' so the pair shows up together in the CLI env-var summary.

Fixes #1694
2026-06-02 07:49:59 +00:00
roboomp 239bb9858d fix(ai): honored openai idle timeout for first events
OpenAI-compatible local servers can spend longer than the generic first-event budget processing large prompts before they emit response headers or SSE frames. The OpenAI-specific idle timeout now also acts as the OpenAI-family first-event floor unless an explicit OpenAI first-event timeout is configured.

Added regression coverage for OpenAI Responses request setup so a lower generic first-event watchdog no longer undercuts PI_OPENAI_STREAM_IDLE_TIMEOUT_MS.

Fixes #1603
2026-05-31 18:53:58 +00:00
can1357 1dba122c53 chore: updated docs 2026-05-31 04:36:14 +02:00
can1357 4d3d181d8e fix(coding-agent): changed local tiny-model default to CPU inference
- Changed tiny-device preference resolution to always default to CPU instead of platform-specific DirectML/CUDA heuristics.
- Updated settings schema, documentation, and changelog text to describe the CPU default while keeping accelerated providers behind explicit `providers.tinyModelDevice`/`PI_TINY_DEVICE` choices.
2026-05-31 03:39:38 +02:00
can1357 668faabfd2 feat(tiny): added providers.tinyModelDevice and tinyModelDtype settings
- Added persistent settings in the Providers tab for ONNX execution provider and quantization/precision, replacing env-var-only configuration.
- PI_TINY_DEVICE and PI_TINY_DTYPE env vars still override the matching setting at spawn time.
- Added tinyWorkerEnvOverlay to map settings onto worker env without clobbering explicit env vars.
- Updated docs and tests to reflect the new setting-first resolution order.
2026-05-31 02:14:58 +02:00
can1357 5d3adfab7f feat(tiny): added GPU-first device selection with CPU fallback for local models
- Added `PI_TINY_DEVICE` env var to control ONNX execution provider (`gpu` default, `cpu`, `metal`, `cuda`, `dml`, `coreml`).
- Local tiny-model inference now tries accelerated GPU provider first and retries on CPU if initialization fails.
- Added `device.ts` module with normalization, preference resolution, and load-order helpers.
- Updated docs and model descriptions to drop CPU-specific language.
2026-05-31 01:57:59 +02:00
bench-local f6ca76728b feat(ai): add Wafer Pass and Wafer Serverless providers
Wafer (https://wafer.ai) exposes a single OpenAI-compatible endpoint
(`https://pass.wafer.ai/v1`) for two SKUs whose entitlement differs
server-side, so we model them as two parallel providers — mirroring the
firepass/fireworks split so a user with both subscriptions can switch
without re-pasting:

- `wafer-pass` — flat-rate. `/v1/models` is filtered to entries whose
  `wafer.tier === "pass_included"`.
- `wafer-serverless` — pay-as-you-go superset of Pass.

Both issue `wfr_…` keys. `/login wafer-pass` and `/login wafer-serverless`
paste-and-validate via `/v1/models`. `WAFER_PASS_API_KEY` and
`WAFER_SERVERLESS_API_KEY` are wired through `getEnvApiKey`.

Bundled catalog:
- `wafer-pass`: GLM-5.1, Qwen3.5-397B-A17B.
- `wafer-serverless`: GLM-5.1, Qwen3.5-397B-A17B, Kimi-K2.6, Qwen3.6-35B-A3B.

Dynamic discovery via `/v1/models` overlays additional models at runtime
and folds the `wafer` envelope (tier, capabilities, cents/M pricing) into
the canonical `Model<"openai-completions">` shape. GLM-family entries
carry the zai-style thinking compat (`thinkingFormat: "zai"`,
`reasoningContentField: "reasoning_content"`) so reasoning tokens land in
the right field. Cents-per-million → dollars-per-million via /100.

Tests (`packages/ai/test/wafer.test.ts`, 5 cases): bundled catalog
contract for both providers and wire-id pass-through (case-sensitive,
no rewrite — `GLM-5.1` must round-trip verbatim or upstream 404s).
Optional `packages/ai/test/wafer.live.ts` exercises a real round-trip
against `pass.wafer.ai` when `WAFER_PASS_API_KEY` is set.
2026-05-27 20:45:33 -07:00
can1357 bc9833d422 feat(mcp): added validation and warning for invalid OMP_MCP_TIMEOUT_MS
- Rejected negative values in addition to non-numeric ones, falling back to per-server config or default 30s.
- Emitted a logger warning when an invalid env value is ignored.
- Added tests covering negative and non-numeric rejection cases.
2026-05-26 20:30:02 +02:00
can1357 ea2f4b2557 feat(coding-agent): removed vim edit mode and migrated configs to hashline
- Removed vim edit mode and automatically map existing vim configurations to hashline mode.
- Deleted VimTool class, VimEngine implementation, and all vim-specific editing logic (2409 lines).
- Removed vim mode from EditMode union type, edit tool strategies, and configuration schemas.
- Deleted vim parser, command handler, buffer manager, and renderer modules.
- Updated documentation and tests to remove vim mode references and add deprecation mapping.
2026-05-26 13:16:59 +02:00
roboomp 2619eb092e fix(ai): honored bedrock bearer token precedence
Bedrock now sends AWS_BEARER_TOKEN_BEDROCK as Authorization: Bearer before resolving SigV4 credentials, so failing profile credential_process hooks cannot block bearer-token requests.

Added regression coverage for a default profile credential_process failure with AWS_BEARER_TOKEN_BEDROCK set.

Fixes #1399
2026-05-26 09:29:46 +00:00
can1357 c049613cab docs: added auth-broker, schema-normalize, install-id, and eval docs
- Added auth-broker-gateway.md covering remote OAuth vault, gateway forward-proxy, usage cache layering, and env surface.
- Added ai-schema-normalize.md documenting the unified tool-schema normalization pipeline and strict-mode edge cases.
- Added install-id.md describing the per-install UUID persistence and consumer contract.
- Rewrote eval.md to reflect structured JSON cells schema, removing the legacy `*** Cell` parser and Lark grammar.
- Updated environment-variables.md, models.md, sdk.md, secrets.md, lsp.md, session-tree-plan.md, ttsr-injection-lifecycle.md, and natives docs to match code changes.
2026-05-17 02:15:55 +02:00
can1357 3009e41e20 chore: update docs 2026-05-14 21:32:31 +02:00
can1357 8d144e17ec feat(coding-agent/eval): added local python-runner subprocess execution
- Replaced Python execution with a local `python -u runner.py` subprocess and NDJSON stdin/stdout framing.
- Removed shared-gateway architecture, including coordinator lifecycle APIs, `useSharedGateway` wiring, and `jupyter` CLI/actions.
- Simplified setup checks to a plain Python 3 availability probe and removed automatic dependency-install fallbacks.
- Updated kernel cancellation and display processing to use status frames, SIGINT/SIGTERM escalation, and normalized output coercion.
- Added `python-runner` integration and display tests while deleting legacy websocket and kernel lifecycle test suites.
2026-05-12 09:09:24 +02:00
某亚瑟 55ed29f9c7 docs(coding-agent): clarify SearXNG auth configuration 2026-05-06 18:09:52 +02:00
can1357 2826ec2ea0 refactor(scripts): restructured edit-mode fallbacks to ignore strict mode
- Removed PI_STRICT_EDIT_MODE gating from edit-mode resolution so model fallbacks now always apply.
- Stopped injecting PI_STRICT_EDIT_MODE in edit-benchmark.py and rate-edit-tool.py execution environments.
- Removed PI_STRICT_EDIT_MODE from environment-variable documentation and strict-mode test coverage.
2026-05-02 04:34:39 +02:00
can1357 cf60e6df51 feat(coding-agent): implemented eval framework and replaced python tool
- Added a unified eval framework with parser grammar, backend interfaces, and JS/Python execution result types.
- Added eval tool docs and updated prompts for fenced cells, `eval.py`/`eval.js`, and fallback behavior.
- Replaced the built-in `python` tool with `eval` across registry, rendering, interactive modes, and tool settings.
- Migrated Python execution runtime from `src/ipy` to `src/eval/py`, renamed state fields, and removed legacy introspection.
- Refactored browser tooling from in-process VM helpers to worker-managed tab supervisors and protocol transport.
- Added eval parser fallback and JS tool-bridge tests, updated imports, and removed obsolete python-mode suites.
2026-04-30 18:08:37 +02:00
can1357 9865a4ce6c docs: update docs 2026-04-30 06:47:01 +02:00