* local script for npm releases
* Keep the release Docker VM from freezing the Mac
build refuses a Docker VM with more than half the host's RAM and caps
rustc to about one job per 2 GB of VM memory. RELEASING.md now
recommends colima with 4 CPUs and 6 GB on a 16 GB Mac.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Recover the release Docker build from a crashed VM's caches
build-cross.sh drops empty .crate downloads (and their unpacked sources)
before building, so cargo fetches them again instead of failing with
"invalid gzip header". A new reset-cache command deletes the Docker
build-cache volumes for anything worse.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Skip the release frontend build when nothing changed
The server embeds packages/local-web/dist, so rerunning Vite on every
build made cargo recompile and relink the server for all targets.
build now reuses dist when the frontend sources, VITE_ values and the
existing output match the last build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Use cargo-zigbuild 0.23.4 for the release cross builds
nightly-2026-08-01 passes --fix-cortex-a53-843419 when linking for
aarch64 Linux, which zig rejects ("unsupported linker arg"). cargo-zigbuild
filters it out from 0.23.0 on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Build release platforms separately and check they match at publish
build accepts the groups macos, linux and windows as well as single
platforms, so the Mac can be tested without Docker. Each platform records
the commit it was built from, and publish refuses unless all six come
from HEAD on a clean tree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep the smoke-test app running until Enter, and check its UI
The release app opens a browser tab on start, and smoke stopped the
server right after /api/health, so the tab lost it while loading images.
smoke now checks the embedded frontend and a few images are served, then
keeps the app running until Enter when run in a terminal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Use cargo-xwin 0.23.1 for the release Windows builds
cargo-xwin 0.20.2 fails to set up the MSVC CRT with the current Microsoft
manifest ("unable to find x86_64 headers for Win11SDK_10.0.26100").
0.23.1 handles it. The resulting binaries import the same DLLs as the
0.1.44 CI builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Resume interrupted release uploads and catch reused npm versions
gh uploads all assets in one call, and a single dropped HTTP/2 stream
failed the whole release. publish now creates a draft, uploads one asset
at a time with retries, skips assets already uploaded with the same
sha256, and only then makes the pre-release public, so a rerun resumes.
npm never reuses a version, even an unpublished one, which
`npm view pkg@version` cannot see. Check npm's time field instead, so
publish stops before touching GitHub.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: bump version to 0.1.46
* Update the Cargo.lock files for 0.1.46
cargo set-version bumped every Cargo.toml but left the root, remote and
relay-tunnel lock files at 0.1.45, so --locked checks failed and a
release build would rewrite Cargo.lock and count as dirty.
bump-version.sh now refreshes the three lock files offline after
set-version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* test(executors): fail when the Codex npm pin and protocol crate tags drift apart
* fix(executors): bump Codex to 0.132.0, whose macOS signature is valid
OpenAI revoked the certificate that signed Codex 0.124.0, so Gatekeeper
blocks it on macOS. 0.132.0 is the oldest release signed with a valid
certificate that resolves against the workspace's sqlx 0.8.
Adapt to the 0.132 protocol: service_tier is a string, attestation
requests are unhandled like other capability-gated requests, and the
legacy delta events map to their content-delta equivalents. Backfill the
timestamps and thread sessionId that 0.132 made required, so logs from
earlier Codex versions still replay.
Fixes#3499
* Make it explicit that release builds collect no usage analytics or crash reports
- Read POSTHOG_API_KEY / POSTHOG_API_ENDPOINT / SENTRY_DSN from the runtime
environment only in debug builds; release builds use compiled-in values
only, and empty values count as unset.
- Settings > Privacy: builds without a PostHog key show a plain line instead
of the "Enable Telemetry" checkbox (all 7 locales).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Show the telemetry toggle whenever the backend can send data
Settings → Privacy decided whether anything is collected from the
frontend's VITE_POSTHOG_API_KEY alone. That missed backend keys (the
Docker image compiles POSTHOG_API_KEY into the backend but never sets
the Vite name), Sentry DSNs, and debug backends that read the runtime
env. In those cases the UI hid the opt-out and said nothing is
collected while events were being sent.
/api/info now reports `telemetry: { analytics, crash_reports }` from
the server itself (PostHog configured, Sentry initialized). The UI
shows the "doesn't collect" notice only when the backend reports
neither and this frontend build has no PostHog key+endpoint or Sentry
DSN. A server too old to report its status keeps the toggle.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Turn off usage analytics and crash reports
Replace the compiled-key / backend-status approach with a plain switch-off:
- AnalyticsConfig::new() returns None, so the server, MCP and desktop app
never send PostHog events.
- SentrySource::dsn() returns None, so Sentry is never initialized.
- local-web no longer initializes Sentry or PostHog; remote-web no longer
initializes PostHog.
- Settings -> Privacy shows a fixed notice instead of the telemetry toggle.
Drops the telemetry_env helper, the /api/info telemetry field and the
frontend collectsTelemetry helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Restore edition-2024 import ordering so cargo fmt --check passes on main
after the version bump in #3454.
Closes#3469
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(ui): restore the Sign in button for agents that need setup
The legacy cleanup (139b18158, #2790) removed NextActionCard, the only
caller of runAgentSetup, so needs_setup was computed but never shown.
The next-action row now reaches the conversation list only when
needs_setup is set, and renders a Sign in button for agents with the
SETUP_HELPER capability. It calls runAgentSetup with the failed turn's
own executor profile (carried as NextAction.executor_profile_id), so a
variant signs in with its own config.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cursor): detect the sign-in error from the renamed agent CLI
Cursor's CLI now says "run 'agent login'" instead of
"run 'cursor-agent login'", so the exact-message match missed it and the
error was tagged Other, with no Sign in button. Match on "Authentication
required" and "login" instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(acp): treat -32000 from the agent as "setup required"
A signed-out ACP agent rejects session/new with -32000 (AuthRequired),
and an expired token does the same on session/prompt. The harness
flattened every error into a string, so the user saw a generic error.
The run's exit error is now logged as AcpEvent::AuthRequired when its
code is -32000, and normalize_logs turns that into a SetupRequired error
entry, which is what offers the Sign in button. Other errors are
unchanged. Session history skips the new event, like Error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(server): share the agent setup runner between Codex and Cursor
run_codex_setup and run_cursor_setup repeated the same steps: chain the
workspace's latest coding-agent action after the setup action, ensure
the container, find or create a session, and start it as a setup
script. That's now start_agent_setup in agent_setup.rs, and each agent
keeps only its own setup action. No change in behaviour; this is so the
Copilot sign-in doesn't add a third copy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(copilot): sign in from the Sign in button
Copilot now has the SetupHelper capability, and the agent setup API has
a Copilot branch. It runs `<copilot base> login --device-code` as a
setup script, then the failed prompt again.
- Copilot::login_command() takes the package from base_command(), so it
matches the run (cached registry, no network) and honours
base_command_override. It drops the run args (--acp) and ignores
additional_params, which are run flags login would reject.
- --device-code prints a code and link in the conversation, needs no
browser on the backend's machine, and works without a TTY.
- The script carries no env: it's saved in the database and shown in
the output, and profile env can hold tokens. Copilot's sign-in doesn't
depend on env.
- On Unix the program and args are shell-quoted, so paths with spaces
work.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(ui): show the device sign-in code in the conversation
A login script waiting for a device code printed "visit <url> and enter
code <code>" only to its logs, so the conversation showed just
"Tool Install Script - Running".
While a script runs, its output is now checked for a link and a code on
the same line (parseDeviceCode, not agent-specific). If both are there,
a card under the script shows the code and a "Copy code and open <host>"
button. The button copies the code in the user's browser, then opens the
page, and only then says the code was copied. A CLI's own copy lands on
the backend's machine, which isn't the user's when it runs remotely.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(copilot): don't open a browser tab from the login script
In device-code mode Copilot opens the sign-in page on the backend's
machine, which took the user away before they saw the code card. The
login script now runs with BROWSER=true (Copilot honours BROWSER, and
`true` does nothing), so the user stays in the conversation and opens
the page from the card. Unix only; Windows keeps Copilot's default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* feat(acp): say "Not signed in" in the model selector
Option discovery opens a throwaway session with session/new, so a
signed-out agent fails it with -32000 too. The model selector then
showed the agent's message plus the last stderr line. It now shows
"Not signed in. Start a task and click Sign in." instead. The text is
agent-agnostic, and the failure is still not cached. A Unix test runs
run_live against a fake sh agent that rejects session/new with -32000.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(acp): don't point registry agents at a Sign in button they lack
Registry agents share the discovery code but don't get SetupHelper, so
"Start a task and click Sign in." sent their users to a button that never
appears. The model selector now says "Not signed in to this agent."
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(ui): show the device-code card only for Tool Install Scripts
parseDeviceCode ran on every running script, including the user's own
setup and cleanup scripts, so a line with a link and something like a
request ID or ticket key (ABCD-1234) could show "Enter this code to sign
in" with a button opening that link. Only the app's own install/login
scripts run as Tool Install Script, so the card now needs that too. The
parser stays generic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(acp): show each model once
Copilot sends `auto` twice: as its own entry and again in the model list.
We kept both, so the selector showed Auto twice. Keep the first choice for
each value, and drop repeats from lists already saved in the disk cache.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(acp): refresh the model selector after signing in
Discovery runs once per stream connection, and a failure is kept for 30s,
so after signing in the selector kept showing "Not signed in" and the old
list until the page was reloaded.
- When a run opens a session, forget the agent's failed discovery: the
agent works now. Copilot and registry agents pass their discovery key.
- When the dropdown opens while it shows an error, reconnect the stream
so discovery runs again.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat: add ACP 3.4 harness and move Copilot to it (mode and model still todo)
* refactor: make BaseCodingAgent a string type instead of an enum
* refactor: always pass the approval bridge to executors
* feat: show ACP registry agents in agent settings (static mock data)
* feat: load ACP registry agents from the registry with memory and disk cache
* feat: install and uninstall ACP registry agents
* feat: run ACP registry agents through the ACP harness
* chore: bump Rust nightly to 2026-08-01
macOS 27.2's dyld rejects the sqlx-macros dylib built by
nightly-2025-12-04 ("mis-aligned LINKEDIT string pool"), so crates
using sqlx no longer compile. nightly-2026-08-01 is new enough to avoid
that and old enough that allocative (via codex) still compiles; later
nightlies alias Infallible to `!`, which breaks allocative's impls.
Fix the clippy lints the newer toolchain adds:
- box the large tungstenite errors in ws-bridge and relay-client
- allow result_large_err where axum Response is the error type,
matching the existing allows
- sort_by_key, checked_div, mem::take, collapsible match, unneeded
wildcard patterns, unused test imports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* chore: use underscore clippy lint names in Cargo.toml
Newer cargo deprecates hyphenated lint names in [lints] tables and
warns that they will stop working in a future edition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* bugfix: copilot sessions are now stored in dedicated 'copilot_sessions' namespace instead of 'gemini_sessions'
* feat(migration): move Copilot session files from gemini_sessions/ to copilot_sessions/
Before the namespace was made explicit, Copilot shared the gemini_sessions/
directory. On first startup after upgrade, migrate_copilot_sessions() queries
the DB for all agent_session_ids belonging to COPILOT sessions, then moves
their .jsonl files to copilot_sessions/ using a new SessionManager::migrate_session_from
helper. A marker file prevents the migration from re-running.
Changes:
- db: add CodingAgentTurn::find_agent_session_ids_for_executor()
(+ .sqlx cache entry for the new query)
- executors: add SessionManager::migrate_session_from()
- server/startup: call migrate_copilot_sessions() at startup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* add scripts/ci-local.sh to run CI checks locally
Mirrors .github/workflows/test.yml jobs without checkout/install steps.
Supports running individual jobs or all defaults via CLI args.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(ci-local): add group aliases and git-based auto-detection
- Add `backend` group that runs schema + clippy + test together
- Treat frontend/backend/backend-remote as first-class groups matching CI
- Auto-detect which groups to run from `git diff` vs main when no args given
- Deduplicate atomic jobs when overlapping groups/jobs are specified
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: replace declare -A with bash 3 compatible deduplication
macOS ships bash 3.2 where associative arrays (declare -A) are not
available. Replace with a plain array + loop membership check.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* FE lint fixes
* fix: correctly propagate step failures within CI jobs
When job functions are called inside `if job_fn; then`, bash suppresses
set -e inside the function. A failing run_step would log ✗ but execution
continued, and if the last step passed the whole job was marked PASSED.
Fix by tracking failures explicitly with `|| failed=1` in every job
function that contains multiple run_step calls.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* BE clippy fixes
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: an Enter that confirms an IME candidate is not an Enter
event.isComposing alone is not enough. Safari fires compositionend BEFORE the
confirming Enter's keydown, so the flag is already false when the handler runs
and the keypress goes through — the line submits half-composed. Chrome and
Firefox fire it after, which is why the naive guard looks correct there and the
bug reads as Safari-only.
Adds isImeConfirmation(): isComposing, OR a composition that ended within the
last 30ms. Composition is tracked on window in the capture phase, so one that
ends after focus moves still closes, and blur closes an abandoned one.
Wired into the two places that guard today: the shared useSemanticKey hook,
which covers every registered shortcut, and Input.tsx. The helper is duplicated
into each package because @vibe/ui does not depend on @vibe/web-core and this
change is not the place to create that edge.
* refactor: keep the IME helper in @vibe/ui, and fix three defects in it
Per review, the helper lives only in packages/ui and web-core imports it from
@vibe/ui/lib/imeComposition. Copying it into both packages was my mistake, not
a judgement call: I checked whether @vibe/ui depends on @vibe/web-core, which
is the wrong direction — @vibe/web-core already depends on @vibe/ui as
workspace:*, and the package exports ./lib/*.
Three defects found while re-reading it:
lastCompositionEndAt started at 0, and performance.now() counts from the page's
time origin, so `now - 0` was inside the window for the first 30ms of the page
and swallowed an Enter that no composition preceded.
The 30ms window applied to every key. useSemanticKey guards every registered
shortcut, so for 30ms after any composition ended, esc, j, k and the rest were
dropped too. An open composition still swallows every key, because none of them
reached the application, but the window after it is Enter-only: it exists for
the keystroke that CONFIRMS a candidate, and that keystroke is Enter. The
comment at that call site claimed Enter while the code did not; it says what
the code does now.
@vibe/ui declared sideEffects: false while this module registers window
listeners on import. The declaration now names this file, so a bundler cannot
drop the registration on that claim.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ni96VmLBK6aQbAW5x84XbR
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
main.rs open-coded its own initialization sequence, which had drifted from
server::startup::initialize_deployment. The inline path never called
migrate_legacy_attachment_directories, so the legacy attachment directory
migration did not run for anyone starting the server through this binary.
Replaces the duplicated block with the shared function, which also covers
sentry scope, orphan execution cleanup and the existing backfills.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
When only one stream had content the labels were reversed, so stdout-only
failures were reported under '--- stderr' and stderr-only failures under
'--- stdout'. Makes git command failures misleading to debug.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Opening a workspace whose agent wrote a lot to stderr could hang the
page. On one Codex workspace, three of seven stored transcripts never
finished streaming and one delivered nothing at all.
The cost is in PlainTextLogProcessor::process, which ends by emitting a
patch that replaces the whole current entry, rebuilt from the entire line
buffer, once per chunk it is handed. That is what makes a live stream
appear to type itself out, and the buffer is only flushed by a time gap,
so it stays small while an agent is running and output trickles in.
Replaying a stored session has no gaps. history_plus_stream hands the
consumer every chunk at once, the buffer never flushes, it grows to the
length of the whole log, and the rebuild runs once per chunk:
O(chunks * total bytes). Codex logs heavily to stderr, which is where it
showed, but every executor that uses stderr_chunked_stream feeds the same
processor.
It also corrupted the view rather than just slowing it. The redundant
giant patches flooded MsgStore's 100MB history ring and evicted the real
conversation: the same log yielded 29 patches before this change and 746
after.
So coalesce chunks that are already available into one before they reach
the consumer. A live stream yields a chunk at a time, so batches are size
1 and streaming behaviour is unchanged. A replay collapses into a single
pass.
Measured on a 4.0MB Codex transcript: 40.3s to 0.105s, and linear from
there. The seven transcripts of the workspace that would not open now
normalize in 0.03s to 0.26s each.
Three tests: the coalescing itself, which fails against the previous
implementation with four chunks where one is expected; ordering with
interleaved stdout; and that the stream still stops at Finished.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
native-tls only depends on openssl-sys on linux; macos uses
Security.framework and windows uses schannel. The previous global
openssl/vendored dep dragged openssl-sys onto windows-msvc, where
its build script invokes perl ./Configure VC-WIN64A and aborts
because linux perl produces forward-slash paths.
Move the vendored openssl dep into a [target.'cfg(target_os = "linux")']
block so only musl cross-compile vendors openssl, and windows-msvc /
macos backend builds skip openssl-sys entirely.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Codex 0.121 transitively enables reqwest's default-tls (via codex-protocol's
reqwest dep), which pulls openssl-sys into the build. cargo zigbuild and
cargo xwin have no system OpenSSL, so the openssl-sys build script aborts
when cross-compiling for musl/windows-msvc targets. Enabling openssl/vendored
forces openssl-sys to build from bundled C source.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* chore: bump claude-code to 2.1.112 and add xhigh effort variant
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: send default model to Claude Code CLI when no model explicitly selected
The model selector showed "opus" pre-selected (from default_model in
default_discovered_options) but never included model_id in the submitted
executor_config unless the user explicitly clicked a model. This caused
Claude Code to fall back to its own built-in default (Sonnet).
Two changes fix this:
- claude.rs get_preset_options(): fall back to default_discovered_options()
.model_selector.default_model when self.model is None, so the DEFAULT
preset advertises model_id: "opus"
- useExecutorConfig.ts useEffectiveOverrides(): remove the
variantWasUserSelected gate so presetOptions is always consulted as the
lowest-priority fallback. This is safe because the higher-priority
sources (userSelections, scratchConfig, lastUsedConfig) already respect
explicit user choices; the gate was overly conservative.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add cloud data export feature for service shutdown
Users can export all their cloud data as a ZIP file containing
denormalized CSVs compatible with Jira, Linear, and Asana imports.
Backend: POST /v1/export endpoint generates ZIP with issues.csv,
projects.csv, tags.csv, relationships.csv, pull_requests.csv,
users.csv, and optionally comments.csv and attachments (actual files
downloaded from Azure Blob Storage).
Frontend: 4-step export flow (Introduction, Choose Projects, Options,
Download) accessible at /export in the remote web app, with reusable
UI components in web-core.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Simplify remote data export
Remove tags, relationships, comments, and pull requests from the export flow. Use SQLx macros for export queries and scope exported project data through organization membership checks.
* Simplify export frontend flow
Fold attachment selection into project selection, remove the separate export options step, and fix auto-download filename handling.
* Streamline shutdown export UX
* Remove cloud migration flow
* Committed the migration removal.
Commit: `e5cd10c45 Remove cloud migration flow`
Only the pre-existing unrelated `crates/remote/Dockerfile` change remains uncommitted.
* Add local export access
* Refine local export UX
* Show export banner in remote app
* Update cloud shutdown banner copy
* Clarify export page copy
* Refine export page copy
* Disable new cloud signups and billing
* Add shutdown details link to banner
* Restore free org creation while keeping Stripe checkout closed
* Restore organization creation UI flow
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: kill process group on natural executor exit to prevent orphaned MCP processes
The exit monitor's OS exit path (Branch 2) never called kill_process_group(),
leaving child processes like vibe-kanban-mcp running as orphans after the
executor exited naturally. This mirrors the cleanup already done in the
exit signal path (Branch 1).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: kill process group on natural executor exit to prevent orphaned MCP processes
When an executor (e.g. claude) exits naturally, its child processes like
vibe-kanban-mcp were left running as orphans because no one sent a signal
to the process group.
Two changes:
1. spawn_os_exit_watcher now kills the process group immediately after
detecting the leader has exited, cleaning up orphaned children at the
single choke point for natural exit detection.
2. kill_process_group() handles ESRCH from getpgid() by falling back to
using the leader PID as the PGID (always correct for group_spawn
children which use setpgid(0,0)). Previously it returned early when
the leader had already exited, never sending any signals to the group.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
refactor: introduce TrackedChild and centralize execution cleanup
Replace scattered process group cleanup with a principled approach:
- TrackedChild captures the pgid at spawn time, so kill_process_group
always works — even after the group leader has exited (no getpgid
lookup or ESRCH fallback needed).
- New reap_execution() method on LocalContainerService consolidates
process group kill + resource cleanup (child handle, msg store, DB
stream) into a single idempotent function. Replaces duplicated
teardown logic in stop_execution and spawn_exit_monitor finalization.
- Update opencode's OpencodeServer Drop impl to use TrackedChild.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
refactor: use command_group's built-in signal() instead of TrackedChild
command_group already stores the pgid internally at spawn time and
exposes it via UnixChildExt::signal(). Rewrite kill_process_group to
use this instead of the manual getpgid + killpg dance (which failed
after the leader exited) or our TrackedChild wrapper (which duplicated
what command_group already does).
- Remove TrackedChild — no longer needed
- kill_process_group uses child.signal(sig) via command_group's
re-exported Signal type (nix 0.27, matching command_group's dep)
- Keep reap_execution() consolidation and simplified stop_execution /
exit monitor finalization from the previous commit
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: remove duplicate kill_process_group from exit signal branch
The exit monitor's select! now purely determines exit status —
reap_execution at the end is the single place that kills the process
group. This eliminates a redundant full kill_process_group call in the
exit signal branch that added ~2s of unnecessary delay.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: kill process group on natural executor exit to prevent orphaned MCP processes
When an executor exits naturally, child processes like vibe-kanban-mcp
were left running because nobody signaled the process group.
Two minimal changes:
1. kill_process_group() now uses command_group's UnixChildExt::signal()
which calls killpg() with the pgid captured internally at spawn time.
The old getpgid() + killpg() approach failed with ESRCH after the
group leader exited.
2. The exit monitor now calls kill_process_group() during finalization
(right before removing the child from the store) to clean up any
surviving child processes on both exit paths.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: check try_wait before signaling in kill_process_group to avoid unnecessary 2s sleep
Move the try_wait check to the top of the signal escalation loop so
that if the process group is already dead (cached exit status), we
break immediately without sending a signal or sleeping 2 seconds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: use start_kill instead of full kill_process_group in exit monitor finalization
Replace the full signal escalation (SIGINT→2s→SIGTERM→2s→SIGKILL) in
finalization with a single start_kill() call (killpg SIGKILL). At this
point the executor is already done — we're just cleaning up orphaned
children like MCP servers that don't need graceful shutdown.
This avoids redundant 2s sleeps when the group was already killed in
the exit-signal branch, and avoids the escalation loop being skipped
entirely in the natural-exit branch (where try_wait returns cached
status before any signals are sent).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add missing mut for start_kill call
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Handle exited process group
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: include hostId in session cache invalidation keys to match query key
The workspaceSessions query key includes hostId as the second element,
but all four invalidation sites omitted it, causing React Query prefix
matching to fail silently. This left stale cache after session creation,
making the sessions dropdown appear empty until page refresh.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: centralize workspaceSessions query key into workspaceSessionKeys helper
Follows the existing pattern (workspaceSummaryKeys, workspaceRecordKeys, etc.)
so the key shape is defined in one place and invalidation sites can't drift.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: close running-process stream controllers on workspace switch to prevent conversation history leakage
When switching workspaces while a process is running, the new component
reads stale execution processes from the Zustand store (which lags one
render behind). The running-process effect starts a persistent WebSocket
stream for the stale process via loadRunningAndEmit. When the store
updates and the process disappears, the stream is never closed because
the controller is local to the Promise closure with no external handle.
The orphaned stream continues merging old workspace entries into the
display refs, causing conversation history from the previous workspace
to leak into the current one.
Replace streamingProcessIdsRef (Set<string>) with
activeStreamControllersRef (Map<string, {close}>) so the reset effect
can proactively close all active stream controllers when scopeKey
changes. Controllers are stored in the map on creation inside
loadRunningAndEmit and removed on natural completion (onFinished) or
after the full backoff sequence (.finally). On error/retry the entry
persists in the map to prevent duplicate streams during backoff waits.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* debug: add console logs to trace conversation history leakage on workspace switch
Adds [EPP], [CH:*], [CLC] prefixed logs to trace the execution processes
store updates, all write paths in useConversationHistory, and the
ConversationListContainer mount/unmount/flush lifecycle. This will
identify which code path delivers stale entries after a workspace switch.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Revert "fix: close running-process stream controllers on workspace switch to prevent conversation history leakage"
This reverts commit 7b97a073f7.
* Revert "debug: add console logs to trace conversation history leakage on workspace switch"
This reverts commit 685cf06784.
* fix: clear execution processes store on session change to prevent conversation history leakage
Add sessionId to the cleanup effect dependency array in
ExecutionProcessesProvider so the store is cleared when the session
changes, not just on unmount. This prevents children from reading stale
execution processes from the previous session during the one-render
window before the provider's store-update effect runs.
Previously reverted in 552fe226b because the clear interacted with
the old loadedInitialEntries timing (set before await) to create a
stuck spinner. That interaction no longer applies since 552fe226b
moved the flag after the await and ConversationList remounts via key
on session change, giving fresh refs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: update execution processes store during render to prevent conversation history leakage
The Zustand migration in 06a6ae18b replaced React Context (synchronous
value propagation during render) with a Zustand store updated via
useEffect (deferred until after children's effects). This created a
one-render lag where children read stale execution processes from the
previous session/workspace, causing conversation history from one
workspace to leak into another.
Move the store update from useEffect to render-time with a ref-guarded
dependency check, restoring the synchronous parent-to-child data flow
that Context provided. Children now always see current data when their
effects run. The cleanup effect reverts to unmount-only ([]) since the
render-time update keeps the store current — the [sessionId] dep added
in 022790fb3 was addressing a symptom of the deferred update.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: revert execution processes from Zustand store to React Context to fix conversation history leakage
The Zustand migration in 06a6ae18b replaced React Context with a store
updated via useEffect. This deferred the store write until after
children's effects, creating a one-render lag where children read stale
execution processes from the previous workspace/session and started
streams for wrong processes. Conversation history from one workspace
leaked into another.
Revert to React Context which propagates data synchronously during
render — children always see current data when their effects run. The
atomic selector optimization from Zustand is lost (all context consumers
re-render on any field change), but with only 6 consumers — 2 of which
subscribed to the full array anyway — the impact is negligible.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Zustand store retained stale data when switching workspaces because
the cleanup effect only ran on unmount (empty deps). Since React runs
child effects before parent effects, ConversationList would read stale
isLoading=false from the store and prematurely set loadedInitialEntries,
preventing the actual history from loading. Adding sessionId to the
dependency array ensures the store is cleared during the cleanup phase
before any child setup effects read from it.
debug: add console logs to trace conversation history load on workspace switch
Adds [EPP], [CH], [CLC] prefixed logs to trace the execution processes
store writes, conversation history load effect decisions, and empty state
rendering to diagnose why switching workspaces shows empty conversation.
Cleanup script changes for workspace 1e47a3e4-b64b-490e-a507-d9c6e59ebbb6
fix: don't block conversation history reload after empty-initial emit
When switching workspaces, selectedSessionId transitions through
undefined before settling on the new session. During this transitional
state, useExecutionProcesses returns isLoading=false (since
!!undefined===false) with 0 processes. The load effect in
useConversationHistory treated this as a genuinely empty session and set
loadedInitialEntries=true, permanently blocking future loading — even
after real processes arrived for the new session.
Fix: remove loadedInitialEntries=true from the empty-initial branch.
The emittedEmptyInitialRef guard already prevents duplicate emissions,
and loadedInitialEntries is correctly set in the branch that actually
loads entries. This allows the load effect to re-run and pick up
processes when they arrive.
Also reverts useLayoutEffect back to useEffect in
ExecutionProcessesProvider (not needed with this fix) and removes
debug console.log statements.
fix: revert cleanup effect to unmount-only to fix spinner on second workspace switch
Revert the cleanup effect dependency from [sessionId] back to [] (as in
06a6ae18b). The [sessionId] dep was clearing the store on every session
change, creating a stuck isLoading=true state on the second workspace
switch. The consumer fix in useConversationHistory handles stale data
gracefully without needing the store cleared on session change.
fix: move loadedInitialEntries guard after await to fix stale data blocking
The loadedInitialEntries flag was set before the async
loadHistoricEntries call. When the Zustand store has stale execution
processes from the previous session (due to the async store update
introduced in 06a6ae18b), the load effect would start loading wrong
entries and set the flag, permanently blocking re-loads when the correct
session's processes arrived.
Moving the flag after the await+cancelled check ensures that if the
effect is cancelled (because the store updated with correct data and
deps changed), the flag stays false and the new effect run proceeds
to load the right data.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The worker file `@pierre/diffs/worker/worker.js` has bare module
specifiers (shiki, diff, @shikijs/transformers) that require a bundler
to resolve. Vite only bundles workers when it sees the exact pattern
`new Worker(new URL(...), ...)`, but the code stored the URL in a
variable first, so Vite emitted the file as a static asset without
bundling its dependencies. Browsers cannot resolve bare specifiers in
module workers, causing immediate worker errors and leaving all diff
shadow roots empty.
Switch to `worker-portable.js` which is the pre-bundled variant with
all dependencies inlined (0 bare imports, ~490KB self-contained).
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pierre's PatchDiff splits unified-format patches on /^---\s+\S/gm to
find file boundaries. This collides with deleted lines whose original
content starts with "-- " (e.g. SQL comments), causing
"FileDiff: Provided patch must contain exactly 1 file diff" errors.
Prepend `diff --git a/<path> b/<path>` to the header so Pierre uses
/^diff --git/gm instead, which is unambiguous.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pnpm requires patch files referenced in pnpm-lock.yaml to be present
during install. The patches/ dir was not copied, causing the build to
fail with ENOENT on @pierre__diffs@1.1.4.patch.
Fixes#3300
Co-authored-by: Claude Code <claude@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>