Commit Graph

15813 Commits

Author SHA1 Message Date
can1357 8acd667005 Merge PR #6780: fix(shell): correct kill signal handling (@roboomp) 2026-07-27 15:57:47 +02:00
can1357 7d864fd4e6 Merge PR #6799: fix(natives): surface exit code and stdout in napi build error (@roboomp) 2026-07-27 15:57:46 +02:00
can1357 3681faec41 Merge PR #6789: feat(coding-agent): show advisor cost separately in the status line (@paolomazzitti) 2026-07-27 15:57:46 +02:00
can1357 a89ab0841a Merge PR #6778: test(coding-agent): decouple changelog bundle probe from native addon resolution (@wolfiesch) 2026-07-27 15:57:46 +02:00
can1357 9e8947cc83 Merge PR #6773: fix(live): honor standard proxies for sideband websocket (@roboomp) 2026-07-27 15:57:46 +02:00
can1357 d220cfee9b Merge PR #6806: fix(extensions): cancel timed-out handler dialogs (@roboomp) 2026-07-27 15:57:46 +02:00
can1357 e4e8f8a40a Merge PR #6785: fix(coding-agent): preserve extension providers for plan subagents (@roboomp) 2026-07-27 15:57:45 +02:00
can1357 d3e55817fb Merge PR #6802: fix(lsp): honor custom server language ids (@roboomp) 2026-07-27 15:57:45 +02:00
can1357 da044f33ef Merge PR #6784: fix(tui): route editor word delete through keybindings registry (@roboomp) 2026-07-27 15:57:45 +02:00
can1357 0bfcdd434b Merge PR #6768: fix(tui): defer large command panels during streaming to stop scrollback dupes (@roboomp) 2026-07-27 15:57:45 +02:00
can1357 56c5fe5ad6 Merge PR #6788: fix(tui): don't crash on teardown when the pty is already gone (@dergachoff) 2026-07-27 15:57:45 +02:00
can1357 b0063dd180 Merge PR #6787: fix(mcp): deduplicate aliased server connections (@roboomp) 2026-07-27 15:57:44 +02:00
can1357 f9c4118b0b Merge PR #6790: fix(mcp): resolve native resource URIs (@FernandeZ-hjm) 2026-07-27 15:57:44 +02:00
roboomp 452932b291 fix(rpc): cancelled aborted extension dialogs
Moved RPC dialog request lifecycle into a reusable helper that emits a cancel frame targeting the original request before settling an aborted local promise.

Added coverage for remote confirmation cancellation and pending-request cleanup.
2026-07-27 13:53:30 +00:00
Paolo Mazzitti 9d240ea0ad feat(coding-agent): show advisor cost separately in the status line
Render the Advisor spend next to the primary-model cost as `$2.67 (sub) + $0.41 (adv)`, leaving the status line unchanged until an Advisor cost exists.

Record the cost from finalized advisor `message_end` events in a per-session ledger instead of deriving it from the live advisor transcript, so an in-session compaction or any other history rewrite no longer resets the reported spend. The ledger is cleared for a new session and once a different-session switch commits, and survives a switch that rolls back.
2026-07-27 13:52:22 +00:00
roboomp eb40353a95 fix(extensions): preserved prototype-backed UI methods
Replaced the scoped UI object spread with a delegating proxy that binds inherited methods to the original context while overriding only abort-capable dialogs.

Extended watchdog coverage with a prototype-backed notification method matching RPC UI contexts.
2026-07-27 13:44:33 +00:00
roboomp 4176a6c799 fix(extensions): registered abort before handler start
Attached the session-stop abort listener and rechecked cancellation before invoking extension work, preventing synchronous ctx.abort() calls from being missed.

Added deterministic coverage for a handler that aborts and then waits on non-UI work.
2026-07-27 13:37:05 +00:00
roboomp 5e6f12b278 fix(extensions): cancelled timed-out handler dialogs
Forwarded confirmation dialog options in the interactive TUI and scoped extension UI dialogs to each handler watchdog signal.

Added regressions for direct confirmation cancellation and fail-closed tool-call timeout cleanup.

Fixes #6805
2026-07-27 13:28:24 +00:00
can1357 c60b6971db feat(coding-agent): used static colon separator for working terminal title on windows
- Keep terminal working titles static with a colon separator on Windows instead of scheduling animated spinner updates.
- Update terminal title builder and state machine to check the platform and bypass timer intervals on win32.
2026-07-27 15:04:04 +02:00
can1357 5e139d9515 feat(coding-agent): reduced terminal title update overhead with deduplication and FFI
- Deduplicate terminal title writes globally across all platforms.
- Adopt `SetConsoleTitleW` via `bun:ffi` for Windows terminal updates instead of OSC writes.
2026-07-27 14:35:06 +02:00
can1357 a7abeff1b7 perf(ci): cut warm CI time via download-skipping, splat reuse, PR gating
Four levers on top of the green pipeline:
- kata jobs pass --remote_download_toplevel, so fully cache-hit builds
  stay metadata-only instead of pulling every intermediate artifact from
  bazel-remote (the bulk of the previous 6-minute TS-only main runs).
- the xwin MSVC splat caches its ~1GiB CDN payload on the runner-cache
  PVC (OMP_XWIN_CACHE_DIR), instead of re-downloading per ephemeral pod.
- main-push rust jobs export their bazel disk cache to the GitHub cache
  (once per lockfile change, shared linux scope). GitHub only shares
  default-branch caches across PRs, and main runs on kata where
  actions/cache never saved — so every fresh PR was building cold.
- TS-only pull requests skip Rust validation entirely (gh pr diff path
  gate); their test jobs restore addons from the main-exported cache.

Export runs disable top-level-only downloading: remote hits would
otherwise export action entries whose blobs were never materialized.
2026-07-27 14:31:24 +02:00
can1357 ae01a76136 fix(agent): hardened pre-model-call gate state cleanup and API surface
- Cleared the retained soft-requirement lifecycle alongside the deferred
  hard choice: clearDeferredToolDirectives() owns both, is called from
  clearAllQueues/reset and session-scoped tool-state cleanup, with a
  regression covering reminder re-injection after a queue clear.
- Allowed void-returning pre-model gates via the named AgentBeforeModelCall
  type and normalized gate results in the loop and Agent dispatcher.
- Documented that the first gate installed mid-run applies from the next
  run; corrected the onToolChoiceRejected contract docs; documented the
  cross-run lifetime of ToolChoiceQueue's in-flight claim.
- Removed the unused addBeforeModelContextBuild hook.
- Relocated both packages' changelog entries out of the released 17.1.4
  sections into Unreleased with PR attribution, folding the never-shipped
  Fixed bullet into Added and noting the input-event timing change.
2026-07-27 14:08:53 +02:00
can1357 6bbfc1110a Merge PR #6543: feat(agent): add a pre-model-call gate that can stop the turn (@paralin) 2026-07-27 14:01:11 +02:00
roboomp cb55edd60e fix(lsp): honored custom server language ids
Added an optional per-server languageId override and used it for both disk-backed and in-memory didOpen notifications.

Covered config loading and both document-open paths with a fake custom GDScript server.

Fixes #6800
2026-07-27 11:54:29 +00:00
roboomp 550f3e9d19 fix(natives): surface exit code and stdout in napi build error
build-bindings.ts built the failure error from captured stderr only, but
napi-rs/cargo route much of the failure detail to stdout (e.g. `cargo
metadata exited with code 101 ...`). When stderr was empty the thrown
error collapsed to a bare "napi build failed", hiding the real cause.

Attach the exit code plus tail-capped stdout and stderr sections to the
thrown error so the actionable output survives on the error object.

Fixes #6796
2026-07-27 11:42:20 +00:00
Ivan Dergachev bde5e56695 fix(tui): surfaced raw-mode restore failures on a live terminal
Gates guard 1's suppression on #dead: the disconnected path stays
best-effort, but a failed restore during a normal stop() throws as it
did before the guard, instead of silently leaving stdin in raw mode.

Claude-Session: https://claude.ai/code/session_01LTC1HNAntXEMnTYmuUpGHz
2026-07-27 15:32:10 +04:00
can1357 7c82297c9e fix(build): isolated zig compile caches to stop concurrent corruption
zig 0.14's cache corrupts under concurrent `zig cc` (ziglang/zig#18763):
with ~60 cc-compiling cargo build scripts running in parallel, cache
manifests end up referencing evicted objects ("failed to open
.../scanner.o: FileNotFound") and kill the build. Patch the hermetic
wrapper via single_version_override so compile-only steps (-c/-E/-S) get
private throwaway caches under the system tmp dir — cold vs warm is
~25ms for compiles, measured — while links keep the shared cache for
compiler-rt/crt reuse (~6s cold, 25ms warm) under zig's per-artifact
locking.
2026-07-27 13:15:16 +02:00
Dongmen Laohu 2c77c8535a fix(mcp): resolve native resource URIs 2026-07-27 18:59:12 +08:00
roboomp da11d906ff fix(mcp): unified tool collision handling
Moved first-wins MCP tool-name deduplication and origin-aware warnings into one shared helper used by startup extension registration, SDK custom-tool assembly, and deferred refreshes.

Added an SDK startup regression proving colliding MCP proxy tools keep the first origin instead of silently overwriting it.

Fixes #6786
2026-07-27 10:49:59 +00:00
can1357 4fd3662114 fix(ci): reused sandbox trees to stop fd exhaustion on kata pods
The zig and xwin toolchains stage ~10k-file input trees per action;
building and async-deleting thousands of sandbox trees exhausted file
descriptors (EMFILE in unix_jni during sandbox setup). --reuse_sandbox_directories
under --config=ci removes the churn, with a raise-only ulimit guard in
the bazel-launching steps as belt and braces.
2026-07-27 12:48:57 +02:00
roboomp 6c96a5ee9f fix(mcp): filter disabled servers before dedup
Applied the denylist and per-server enabled:false exclusions before connection-equivalence deduplication, alongside project scope, so a disabled higher-priority server can no longer shadow a differently-named equivalent enabled server and leave no connection. Parameterized LoadOptions<T> so the pre-dedup filter sees the typed item.

Fixes #6786
2026-07-27 10:37:52 +00:00
roboomp 394eaaeae2 fix(mcp): filter project scope before dedup
Applied the project-scope filter before connection-equivalence deduplication so a project server can no longer shadow a differently-named but equivalent user server and then be dropped, leaving none.

Fixes #6786
2026-07-27 10:31:18 +00:00
roboomp dda720af41 fix(tui): allowed remote raw backspace opt-in
Windows Terminal identity is commonly lost across SSH and container hops,
leaving only the ambiguous raw 0x08 byte. Added the conservative
PI_TUI_RAW_BACKSPACE_IS_CTRL=1 opt-in so those sessions can map it to
ctrl+backspace without changing the default for terminals where 0x08 means
plain Backspace.

Restored the public isWindowsTerminalSession and matchesRawBackspace exports
and route the parser wrappers through matchesRawBackspace. Documented the
runtime flag and covered local WT, remote opt-in, SSH, and 0x7f behavior.

Fixes #6782
2026-07-27 10:28:00 +00:00
can1357 02c50eb6f3 fix(ci): moved bazel repo cache mount outside the runner home
kubelet creates missing subPath mountpoint parents as root, so mounting
the PVC repository cache under ~/.cache left the directory root-owned
and broke both bazel's default output root and zig's wrapper cache
compile (AccessDenied). The mount now lives at /opt/bazel-repo-cache.
2026-07-27 12:27:31 +02:00
can1357 2092f9330c fix(ci): moved bazel output root off the root-owned kata cache dir
kubelet materializes /home/runner/.cache as root when creating the
omp-bazel-repo subPath mountpoint, so bazel's default output_user_root
under it fails with EACCES. Kata jobs now point output_user_root at
RUNNER_TEMP via the bazel-cache rc fragment (pods are single-job
ephemeral; toolchain/crate downloads stay on the PVC repository cache),
and the runner image pre-owns ~/.cache for the next rebake.
2026-07-27 12:24:35 +02:00
roboomp ab8fb13eea fix(mcp): deduplicated aliased server connections
Deduplicated semantically identical MCP endpoints across provider-specific names while preserving provider priority and canonical direct names.

Kept the first registration on sanitized tool-name collisions and logged both origins.

Fixes #6786
2026-07-27 10:22:39 +00:00
can1357 8facd237d5 feat(build): migrated native pipeline to bazel with remote caching
- Replaced the napi-cli/cargo-zigbuild/cargo-xwin/sccache build path with
  Bazel: rules_rust + crate_universe over Cargo.lock, hermetic zig cc
  toolchains (linux-gnu pinned to glibc 2.17, linux-musl), host Xcode for
  darwin, and a repo-local hermetic clang-cl + llvm-ml + xwin toolchain for
  windows-msvc (bazel/toolchains/msvc).
- All eight shipped addons build as //:natives-<target> via the release
  transition in bazel/defs.bzl (opt, thin LTO, cgu=16, stripped, canonical
  .node naming); scripts/bazel-natives.ts is the single driver for local
  dev and CI.
- Rust validation moved to bazel test + clippy aspects (strict workspace
  policy for opted-in crates, default lints elsewhere, mirroring cargo
  semantics) and the rustfmt aspect; cargo stays as the dev-iteration
  surface, with brush-core/brush-builtins promoted to workspace members
  and excluded from cargo dev tasks to keep their historical scope.
- CI caches through an in-cluster bazel-remote action cache (TLS + basic
  auth, cluster-internal only); GitHub-hosted runners never touch the
  infrastructure and use an actions/cache-backed disk cache instead.
- Deleted the hand-rolled caching machinery: ci-target-cache,
  ci-native-artifact-cache, ci-build-native, native-source-hash,
  find-native-artifacts, restore-linux-native, native-prewarm workflow,
  ensure-* toolchain actions, and all sccache/Swatinem wiring.
- Warm native rebuilds drop from ~20 minutes to seconds; a cold client
  with a warm remote cache rebuilds the linux x64 pair in ~2.5 minutes.
2026-07-27 12:22:19 +02:00
roboomp 879707bd32 fix(coding-agent): preserved plan subagent providers
- Skipped extension-source reconciliation when restricted sessions intentionally load no extensions.
- Added a shared-registry regression covering the provider model, credential, and custom API.

Fixes #6783
2026-07-27 10:01:42 +00:00
roboomp 6460ba042a fix(tui): route editor word delete through keybindings registry
The multi-line prompt editor matched word/line delete and yank with
hardcoded chords via matchesKey() instead of the keybindings registry,
unlike cursor motion and the single-line Input component. As a result
ctrl+backspace (a declared default of tui.editor.deleteWordBackward)
never fired and keybindings.yml remaps of deleteWordBackward,
deleteWordForward, deleteToLineStart, deleteToLineEnd, yank, and yankPop
were silently ignored in the main prompt.

Route those six actions through kb.matches(). Also re-wire the Windows
Terminal raw 0x08 -> ctrl+backspace disambiguation into the TS
matchesKey/parseKey seam (where WT_SESSION is observable), replacing the
dead matchesRawBackspace helper that no longer had any call sites.

Fixes #6782
2026-07-27 09:54:01 +00:00
roboomp 0c1fd7f5d8 fix(shell): preserved negative pid when clap eats --
clap consumes the -- marker before execute for the default-signal and -s/-n forms, so kill -- -10 and kill -s TERM -- -10 previously misread the negative PID as a signal. Captured post-marker operands via a dedicated last=true field and treated a preselected -s/-n signal as closing the option position.

Added a regression covering both marker-consumed forms.

Fixes #6779
2026-07-27 09:42:32 +00:00
roboomp 0e0fa77a51 fix(shell): continued kill after target failures
Recorded per-target PID and jobspec errors while continuing through every remaining operand, then returned a non-zero aggregate status.

Added a regression with a stale PID between two live processes.

Fixes #6779
2026-07-27 09:32:21 +00:00
roboomp fb6a62c227 fix(shell): preserved negative pid operands in kill
Restricted -sigspec parsing to the option position and consumed the -- end-of-options marker, so negative PIDs (process groups) and post-marker operands are signaled rather than parsed as signals.

Added a process-group regression covering kill -TERM -- -<pgid> <pid>.

Fixes #6779
2026-07-27 09:27:57 +00:00
roboomp 38e143d7cf fix(shell): corrected kill signal handling
Accepted numeric signal specifications, signaled every process operand, and restored SIGTERM as the default.

Added process-level regressions for multi-target SIGKILL and graceful default termination.

Fixes #6779
2026-07-27 09:14:13 +00:00
Wolfgang Schoenberger 167892048e test(coding-agent): decouple changelog bundle probe from native addon resolution
The "reads the emitted changelog asset when run outside the bundle directory"
probe built its bundle by shelling out to `bun build`, which cannot take a
plugin. The real `@oh-my-pi/pi-utils` and the changelog module's `../config`
import therefore stayed in the graph, and both pull in the native addon loader.
The emitted bundle called `loadNative()` at startup and resolved
`pi_natives.<platform>.node` relative to its own directory, but the probe is
written to a temp dir and run from an unrelated cwd, so that lookup cannot
succeed. Whether the test passed depended on a platform native happening to be
resolvable next to the runner.

Build it with `Bun.build()` and the same `changelog-utils-stub` plugin the
compiled-binary probe in this file already uses, extracted into one shared
helper. The subject under test is emitted-asset resolution, not native loading.
2026-07-27 01:42:06 -07:00
Ivan Dergachev 23ec7e725b fix(tui): guarded terminal teardown against a revoked pty on disconnect
A recycled terminal pane revokes the pty. stdin EOFs, the disconnect path
runs, and stop() tries to restore raw mode on an fd that is no longer a
tty - Bun's node:tty shim throws ENOENT. That throw escaped stop() and
#markTerminalDisconnected(), preempting its own process.kill(SIGHUP), so
the process died with an uncaught exception instead of exiting 129.

Restoring raw mode on a dead fd is best-effort, matching what
emergencyTerminalRestore() already does, and the disconnect handler is
now wrapped so no teardown failure can preempt the exit.
2026-07-27 11:00:48 +04:00
roboomp 2361fc4e4f fix(changelog): moved live proxy entry to unreleased 2026-07-27 06:30:02 +00:00
roboomp 25c4ec07ed fix(live): honored standard proxies for sideband websocket
Centralized URL-aware proxy resolution so Codex WebSocket transports share standard proxy environment fallbacks and NO_PROXY handling.

Fixes #6770
2026-07-27 06:24:28 +00:00
can1357 5f988a8270 ci: configured native artifact caching and parallel execution in ci workflows
- Enhanced CI workflows and GitHub actions to support native artifact caching and parallel builds.
- Added composite actions and scripts for computing sources, finding artifacts, and managing caches.
- Updated infrastructure documentation and runner deployment scripts with revised resource limits.
2026-07-27 07:53:28 +02:00
roboomp 4bc71bdafc fix(tui): defer large command panels during streaming to stop scrollback dupes
/usage, /session, /advisor status, /jobs, /changelog, /context, and
/memory view mounted their finalized panel immediately via ctx.present()
instead of ctx.presentCommandOutput(), the streaming-deferral path added in
#5427 for /tools and /mcp. When invoked mid-turn, the panel landed above a
still-growing live block and the append-only scrollback contract recommitted
it lower down, so it appeared twice in native scrollback.

Route all six large command panels through presentCommandOutput() so they
defer until agent_end, matching /tools and /mcp.

Fixes #6767
2026-07-27 05:49:42 +00:00
can1357 4eb94125b2 fix(coding-agent/eval): filtered internal runner frames from python cell error tracebacks
- Filter out runner-internal frames from runtime exception tracebacks to start at user code.
- Omit full tracebacks for cell syntax errors to render only the caret display with `<cell>` filename.
2026-07-27 07:28:22 +02:00