The delete RPC fences the record against writes before closing the agent.
Since a failed history delete now leaves the record in place, the fence
stayed up for the rest of the process, so a later rename reported success
and never reached disk. The fence now ends when the delete aborts.
- Opening a stored agent with no provider session ran the fresh-create
cleanup, which deleted its saved timeline. Now that history survives a
restart, that open erased it; the record-based open now clears only the
previous session's runtime state.
- The delete RPC removed the registry record first and swallowed a failed
history delete, replying agent_deleted while the transcript stayed on
disk with no record to retry from. History now goes first and a failure
reaches the client as rpc_error with the agent still listed.
- The chat outline built its prompt index from every active row, which on
SQLite decodes all replies and tool output. Backends now return the
active prompt rows, which the rewind and import paths already read.
- paseo.db and its WAL files are set to mode 0600 on every open. They
hold every prompt and reply.
- Internal agents keep their history in memory. Before this change it
went to paseo.db and outlived a crash, which broke the rule that
nothing about an internal agent is on disk.
- Text chunks are stored as JSON strings. node:sqlite reads a TEXT
value only up to its first NUL, and a chunk can end inside a
surrogate pair.
- A turn's handler now changes the agent's state before any timeline
write. Before, a failed metrics stamp skipped the turn_completed
handler, so a turn the provider started stayed running.
- Node 22.13, which has node:sqlite but not isTransaction, is refused
at open.
- If the checkpoint worker cannot start, the daemon logs it and falls
back to SQLite's auto-checkpoint. Before, the error reported an
already committed write as failed.
Agent history now survives a daemon restart, and closed or archived
agents hold no timeline in memory. A history fetch reads paseo.db and
starts no provider.
The daemon opens one SQLite database at $PASEO_HOME/paseo.db with
node:sqlite. Each schema module owns its tables and migrations, and
records a min_reader_version, so an older daemon refuses a database
it cannot read instead of corrupting it. Node 22.16 is the floor,
because DatabaseSync needs it.
A worker thread runs the WAL checkpoints. A checkpoint syncs the
file, and on the daemon thread it stalled the event loop for up to
119 ms on whichever write crossed the auto-checkpoint threshold. If
the worker exits, the daemon returns to SQLite's auto-checkpoint.
A turn's final event now ends the run even when the timeline fails
to write it. Before this change the error escaped handleStreamEvent
before settleTerminalRun, so the agent stayed running and its waiters
hung. The durable store makes that write fallible, and shutdown made
it fail: settled() rejected after close.
After a rewind of the first prompt and a new turn, a `before` page whose
cursor fell in the retired prefix found no active row before the cursor. The
whole-turn loop then read the row at index -1 and threw, and ordinary paging
returned the first later row's seq as the start, past the page's end.
The child tests merged from main build a `ProviderSubagentStore` with no
timeline and read `list()` synchronously. On this branch the store keeps
children in the agent's timeline, so it takes one and its reads resolve
asynchronously. Each `apply` queues on the parent's timeline before its first
await, so an awaited `list` observes every event emitted before it.
Conflicts resolved by keeping both intents:
- turn-boundary: main reads the reply through getAssistantReply (plugin
cards); this branch narrows the fork cursor to epoch and seq.
- codex rewind: this branch's fork-and-verify flow, with main's
threadDeveloperInstructions() for the developer instructions.
- agent-manager: this branch's ProviderHistoryReconcile type next to
main's Omit<..., "signal"> query options.
Main's new plugin-card tests gain the anchorSeq this branch's cursors carry.
* fix(opencode): clear deleted subagents from the track
Handle provider deletion events before fetching the missing session, and reconcile removals after complete parent listings so reconnects also clear stale rows. Keep descendant cleanup scoped to the deleted child.
* fix(opencode): retain live subagents skipped during reconnect
* fix(opencode): reconcile skipped subagent descendants
* fix(opencode): restore live subagents after reconnect
A deleted child rejects environment restoration before reconnect can clean up its row. Let the child tracker remove confirmed deletions and continue restoring live descendants.
* fix(opencode): clear deleted subagents after reconnect
Let the OpenCode SDK decode missing-session responses in both runtimes. The child tracker can then remove the stale row and restore the live children when it reconnects.
---------
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Codex uses a thread's developerInstructions in place of the
developer_instructions in its config. Paseo now reads the configured
value through config/read and sends it ahead of the agent, daemon, and
plugin instructions on thread/start, thread/resume, and rewind forks.
Closes#10644
* fix(server): avoid event-loop stalls and timeouts during Git watcher scans
Compile file-observer and Git ignore root lists into ancestor-Set matchers so directory scans check direct children in O(1) instead of scanning all ignored roots per entry. Add cooperative time-sliced yielding and mid-directory abort/ignore checks to NativeRecursiveBackend and LinuxBackend directory scans, and enforce the monotonic watcher subscription deadline after Promise.race so late microtask resolutions cannot bypass timeouts.
* fix(server): attach Linux directory watches before scanning entries
Attach the inotify watcher for each newly discovered directory before calling readdir() in LinuxBackend.scan(), so writes that land during readdir() or mid-directory scan yields are captured live rather than missed between the snapshot and post-scan watch attachment.
* fix(server): track Linux directory watch inode identity across replacements
Store each Linux directory watcher with its (dev, ino) identity so watch attachment and scan reconciliation detect when a directory at a watched path is moved aside and replaced. Close stale watchers, rebind to the replacement inode, and re-verify identity after attach, readdir, and scan yields.
Schedules created through the CLI or MCP archived every run's workspace and agent, and only the app's switch could change that. Add --archive-on-finish and --no-archive-on-finish to paseo schedule create and update, and archiveOnFinish to create_schedule and update_schedule. Omitting the option stores nothing, so the default stays on.
A repeated named create_schedule that changes only Archive on finish refreshes the existing schedule instead of creating a duplicate, and keeps the saved value when the request omits it.
Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
* fix: bound import listing and clean up ACP probes
* fix(server): keep the full Import Session deadline
Start ACP probe cleanup when the agent manager stops waiting. Keep the 90-second window for listings that still have time to finish.
Co-authored-by: Chirag Singhal <76880977+chirag127@users.noreply.github.com>
* fix: show import provider errors and retry progress
* fix(server): return Import Session results before probe cleanup finishes
A timely ACP listing was discarded when process shutdown crossed the listing deadline. Return the completed rows and let the adapter finish reclaiming the probe.
* fix(server): preserve timely ACP listing errors during cleanup
A provider error returned within the listing window can still be displayed while its probe shuts down.
* fix(server): preserve timely ACP initialization errors during listing
* test(server): give Worktrunk integration fixtures time to finish
* fix(app): scope Import Session results to the selected host
Co-authored-by: derek <174018435+derek-geekdive@users.noreply.github.com>
* Keep pending session imports tied to their original host
* fix(server): reclaim ACP listing providers after launcher exit
---------
Co-authored-by: Chirag Singhal <76880977+chirag127@users.noreply.github.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: derek <174018435+derek-geekdive@users.noreply.github.com>
Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
* fix(server): keep watcher retries on schedule after reconnect
A watcher that timed out lost its pending delay when its last observer disconnected. Keep the retry with the watched path so registering the same workspace again uses polling until the scheduled scan.
* fix(server): preserve the scheduled watcher retry deadline
The ordinary recovery delay can exceed the setup-timeout delay when a watcher reports an error before timing out. Retain the scheduled deadline so reopening waits the full interval.
---------
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
* fix(cli): print the one-click Hub login URL
`paseo hub login` opened verificationUriComplete in a browser but printed
the bare verificationUri. Over SSH or on a remote host the browser launch
does nothing, so users had to open the bare page and type the code by hand.
Print the URL that carries ?code= and keep the code next to it so the user
can check it matches the Hub approval page.
* fix(providers): report uninstalled plugin providers as unavailable
A fresh host with only Claude Code installed listed Muse Code as an
error ("muse not found on PATH"). The snapshot manager resolves a
provider's catalogue key before it checks availability, and treats any
failure there as an error. For a plugin provider with a command, the key
lookup required a resolved executable and threw when it was missing.
A command that does not resolve has no catalogue identity. Fall back to
the target key so the availability check runs and reports unavailable.
* fix(providers): keep a removed plugin executable off its cached catalogue
The previous fix returned no catalogue key for a missing executable. A
plugin that returns no key asks for a per-workspace catalogue, so after
its executable was removed the next read bound to the catalogue cached
while it was installed and kept reporting ready.
Give a missing executable its own key. Removal now moves the provider to
a fresh catalogue, and its refresh reports unavailable.
* refactor(server): share the MCP client connection that providers host
OMP connected MCP servers itself; OpenCode v2 now needs the same client to
host per-session servers. The shared connection also ends Streamable HTTP
sessions explicitly on close, because a stateful server keeps them otherwise.
* fix(opencode): run agent MCP servers and env on shared v2 servers
Agents with MCP servers or a launch environment failed on any OpenCode v2
server Paseo did not start, with "require an isolated server". OpenCode's MCP
configuration is shared by every session in a location, so Paseo answered by
starting a dedicated server, which a reused server cannot do.
Paseo now hosts each session's MCP servers itself and the v2 plugin exposes
their tools only to that session and its descendants, under OpenCode's
`<server>_<tool>` names. The plugin runs OpenCode's permission check before
each call, so preapproved grants still apply; that API exists from OpenCode
2.0.29, and older servers or stale plugins fail at session creation. Launch
env reaches shells through session.environment, which children do not
inherit, so the plugin asks Paseo to adopt each child before its first model
request. No agent gets a dedicated server any more, including on Paseo's own
helper.
A registered service is skipped when the provider env configures the OpenCode
process, so a service.json no longer breaks catalogs and launches for those
setups. An explicit server URL still reports those variables.
Fixes#9669
* fix(opencode): keep user tools, child instructions, and MCP call cleanup on shared servers
- A Paseo MCP tool replaced a same-named tool from the user's own OpenCode
configuration, and the context hook then removed it from unrelated sessions.
The plugin now captures that tool when it registers, keeps it for sessions
without their own Paseo tool, and runs it for them.
- MCP instructions were an instruction entry written when a child was adopted.
OpenCode loads entries before the context hook runs, so the child's first
request missed them. The context hook now adds them to every request.
- Structured-only MCP results reached OpenCode with empty content. The bridge
now adds them as text, as it already does for Paseo tools.
- The bridge listened for the request's `aborted` event, which never fires
once the body is read, so Stop left the MCP call running. It now aborts when
the response closes before it finishes.
- Closing an HTTP MCP connection waited on a session DELETE with no deadline.
It now waits at most two seconds before closing the transport, which aborts
the DELETE.
* test(server): run daemon OpenCode tests with the bridge the daemon always starts
These tests built the OpenCode v2 client without a bridge, so the client
reported no native Paseo tools and the daemon injected its internal MCP
server instead. OpenCode v2 now hosts agent MCP servers through the bridge
and rejects them without one. The daemon always starts the bridge, so the
tests now do too.
* fix(server): reconnect expired MCP sessions and bound the MCP handshake
- The OpenCode plugin copied a same-named user tool's input schema into the
shared registration. OpenCode validates arguments against the registration,
so the agent's own calls failed the user's schema. The registration keeps a
permissive schema, and the context hook gives each session its own.
- A stateful HTTP MCP server answers 404 after it restarts or expires a
session, and the SDK kept sending the old session ID. A call that gets 404
now opens a new session once and retries.
- The SDK times out only the `initialize` request, so a server that never
answered the `initialized` notification stalled agent creation. The whole
handshake now has a 10-second deadline.
A direct client sees activity only after a complete WebSocket message arrives. Send large responses in existing transport chunks so the client sees progress while it waits for the full response.
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Ouyang Xingyuan <galaxyroaming@qq.com>
* fix(claude): restore stopped background subagents as canceled
Resolve task-only replay notifications through the parent launch identity so stopped children keep their recorded outcome after reopening. Preserve transcript order across task and tool notifications.
* test(claude): name replay notification fixture options
* fix(claude): restore all children in grouped task notifications
A session-end notification can contain several task IDs. Apply its outcome to each linked child during transcript replay so every stopped child restores as canceled.
* fix(claude): keep quoted notices from changing replayed child status
Claude marks delivered task notifications with an origin. Require that origin for user records and require a standalone notice for queue records so prompts that quote a notice do not override a recorded outcome.
* fix(claude): keep replay task links tied to subagent results
Ignore unrelated tool results when collecting task identities so echoed launch logs cannot overwrite the link used to restore a stopped child.
---------
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
* Keep MCP server headers off the Claude Code command line
The Claude Agent SDK defaults to sending MCP servers in one --mcp-config
flag, so the Paseo MCP server's bearer token (and any user MCP server
headers or env) was readable by every local account through ps or
/proc/<pid>/cmdline. Anyone who read it could call the daemon's agent MCP
endpoint.
Set mcpServersDelivery: "initialize" so the SDK sends the servers over
stdin in the initialize request. The SDK only supports that with the
Claude Code bundled with it (2.1.326) or newer, so an older Claude Code,
or a wrapper command that reports no version, keeps the command-line
delivery and the daemon logs a warning once.
A spawn test feeds Paseo's options to the real SDK and checks that the
token reaches stdin and not the launch arguments.
* fix(server): warn about MCP argv delivery only with configured servers
An empty session used the client's one-time warning before any MCP server headers would be passed to the provider. Warn on the first session that configures a server.
* fix(server): detect MCP delivery support on each provider launch
A running daemon kept selecting command-line delivery after the installed provider gained stdin support. Resolve the installed version when building SDK options for a launch with MCP servers.
* fix(server): probe MCP delivery support in the launch environment
Version-selecting wrappers can run a different binary in the workspace. Use the session working directory and environment when probing the configured command.
---------
Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
Install and reload, reviewed updates, and staging cleanup each run against a fresh service. Their npm subprocesses no longer draw from one test's deadline.
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
* fix(server): stop liveness pings on plugin sessions
Every DaemonClient pings its daemon every 10 s to notice a silently dead socket. A plugin's
session runs over its IPC channel (or an in-process queue for built-in plugins), whose loss is
reported directly, and the daemon already exempts plugin sockets from the application lease those
pings renew. The pings only woke both processes: about 2 wakeups a second in an idle daemon with
nine plugins and the built-ins.
DaemonClient gets a livenessHeartbeat option (default on); the plugin host turns it off.
Explicit verification (ensureConnected({ verify: true })) still pings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(server): exit a plugin process when its daemon's channel closes
A plugin host only noticed that its daemon worker had died through the liveness ping: about 11 s
later the ping failed and the process exited with code 1. With the pings off it would not notice
at all and kept running as an orphan.
The plugin process now exits as soon as the IPC channel closes without the plugin closing it
itself. A normal shutdown still closes the channel from the plugin side and lets work in flight
(a provider connection that resolves late) finish.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Brandon Elliott <923787+Brandon168@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Supersedes #5787.
- Add best-effort daemon hardware detection (macOS ioreg/sysctl, Linux containers, WSL, device-tree boards, cloud/VM DMI, SMBIOS chassis) exposed as optional `machineKind` on `server_info` and `/api/status`.
- Add configurable per-host icons in Host Settings -> Appearance (`Auto` plus 9 icons across all 9 locales), keeping `icon` omitted while untouched for rollback compatibility and preserving unknown future icons on disk.
- Redesign `HostPicker` and `HostChooserModal` with resolved host icons, connection type (`Local`, `Tailscale`, `Relay`, `SSH`, `Direct`, `Via`) + endpoint, on-demand round-trip latency, aligned leading and content rails, and full keyboard navigation.
- Update the website host mockup to match.
Co-authored-by: Taras Kornichuk <dread9ko@gmail.com>
Windows timed out while the fixture printed 12,050 rows before signaling readiness. Batch the initial writes and keep the live burst and replay assertions.
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
* fix(server): skip teardown commands when archiving unapproved checkouts
`archiveByScope` previously treated `assertWorkspaceAutomationAllowed` as optional and did not skip `runWorktreeTeardownCommands` when `untrustedBacking` was already true or when archiving an unrecorded worktree directory. Four callers (`CreateAgentLifecycleDispatch`, `archiveIfSafe`, `paseo-tools` `archive_workspace`, and `handlePaseoWorktreeArchiveRequest`) also omitted `assertWorkspaceAutomationAllowed`, letting `paseo.json` teardown commands run during failed agent creation cleanup, first-turn auto-archive, auto-archive on merge, MCP workspace archive, and worktree archive RPCs.
Make `assertWorkspaceAutomationAllowed` and `isCheckoutUntrusted` required on `ArchiveDependencies`, skip teardown whenever the backing checkout is untrusted, any workspace on the checkout is blocked, or no active workspace record exists, and wire the guard through all archive callers.
* fix(server): scope archive teardown check to active checkout workspaces
`isCheckoutUntrusted` scans all workspace records by path, including previously archived records, so gating teardown on it suppressed `paseo.json` teardown for a fresh approved worktree that reused a previously archived unapproved slug path.
Keep teardown approval scoped to the active workspaces sharing the backing checkout at archive start (the records being archived plus active siblings), drop the null-workspace fallback target for unrecorded worktree-scope archives so they never run teardown or flip `untrustedBacking`, and verify caller wiring reaches `assertWorkspaceAutomationAllowed` directly.
* fix(server): inherit untrustedSource when unarchiving onto an active unapproved checkout
Unarchiving a previously approved workspace onto an existing directory that currently holds an active unapproved checkout left the restored workspace without `untrustedSource`. If the unapproved sibling was archived first, the directory remained on disk and archiving the restored workspace could run teardown commands.
Inherit `untrustedSource` from active workspaces sharing the checkout root in `ensureWorkspaceRecordUnarchived`, while ignoring already-archived historical records so restoring an approved checkout onto a reused path stays approved.
* fix(server): bind automation approval state to checkout worktree metadata
Keeping `untrustedSource` only on workspace records meant a retained unapproved worktree directory could lose its teardown block if its last unapproved workspace was archived and an older approved workspace was unarchived onto that path, while scanning archived records by path blocked fresh worktrees that reused a deleted slug.
Persist `untrustedSource` on the checkout itself in `paseo/worktree.json` when creating or restoring an unapproved worktree, clear it in `clearWorkspaceAutomationBlock` when setup is approved, and read it in both `workspace-archive-service` and `workspace-provisioning-service`. Deleting the worktree removes its metadata automatically, so fresh worktrees reusing the path start clean while retained checkouts keep their block across workspace archives and restores.
* fix(server): backfill worktree metadata when archiving retained unapproved checkouts
Unapproved checkouts created before `paseo/worktree.json` stored `untrustedSource` carry their block only in the workspace record. If archive keeps the directory on disk (such as a retained sibling or nested worktree), backfilling `untrustedSource` into `paseo/worktree.json` before removal ensures the retained checkout keeps its block even after its unapproved workspace record is archived.
* fix(server): never propagate archived untrustedSource onto fresh checkouts
Both archive metadata backfill and directory workspace creation previously consulted already-archived records matching a path, allowing an old archived unapproved record to copy `untrustedSource` onto a fresh approved worktree that reused the same slug path.
Ignore `untrustedSource` on already-archived records during archive target resolution and metadata backfill (only backfill when active workspaces are being archived), and share one `resolveCheckoutUntrustedSource` rule across `createWorkspaceForDirectory` and `ensureWorkspaceRecordUnarchived` that checks `paseo/worktree.json` first and falls back only to active workspaces.
* fix(server): align unarchived workspace approval state with the live checkout
Unarchiving an old unapproved workspace onto a path already owned by an active approved checkout kept the old record's stale `untrustedSource`, causing a later re-archive of that workspace to backfill the block onto the fresh checkout's metadata.
Align `ensureWorkspaceRecordUnarchived` symmetrically with the live checkout: adopt `untrustedSource` from `paseo/worktree.json` or active workspaces on the checkout when present, and drop stale `untrustedSource` when live active workspaces own an approved checkout at that path.
* fix(server): preserve block when opening a pre-upgrade retained checkout
Opening a pre-upgrade retained checkout directory whose last unapproved workspace was already archived before this change has no active workspace on the path and no `untrustedSource` in `paseo/worktree.json`.
In `resolveCheckoutUntrustedSource`, prefer `paseo/worktree.json`, then active workspaces on the checkout when any exist (so a fresh approved worktree at a reused path stays approved), and only when zero active workspaces exist on the directory fall back to the most recently archived record for that path.
* fix(server): share one checkout approval lookup across open and unarchive
* fix(server): resolve checkout approval state only from metadata and active workspaces
* fix(server): keep archive read-only on worktree approval metadata
* fix(server): serialize setup approval with archive checkout lock and backfill retained metadata
* fix(server): fail setup approval before clearing records when worktree metadata write fails
Preserve the confirmed at_target cut via RewindAppliedError when plugin session replay fails after session.revert succeeds, so reloading recovers even a first-message rewind. Carry turnMetrics on live timeline events appended by Reload agent so open chats match fresh timeline pages. Fix three async-timeline timing expectations in mcp-server and codex-async-questions tests.
Define plugin session.revert completion as an exact rewind to the supplied token (at_target), allow plugin timeline items to reuse stable ids after a rewind, append session.initialTimeline only when creating a new timeline, and centralize provider-history prompt acknowledgement inside AgentTimeline.
* fix(server): run resolved forge CLI executables directly
The GitHub, GitLab, and Gitea adapters resolved gh, glab, and tea with findExecutable, then discarded the resolved path and spawned the bare command name. On Windows, spawning an extensionless bare name routes through cmd.exe, which resolves commands against cwd first, expands %VAR% references, and truncates multiline arguments such as gh api graphql queries.
Forward the resolved executablePath from each forge adapter and auth probe into the shared runner, resolve bare binary names inside createForgeCliRunner when omitted, and restrict bare-name PATH discovery in findExecutable to absolute PATH directories.
* fix(server): re-resolve cached forge CLI paths if the binary disappears
Cached CLI path resolvers now support targeted invalidation, and forge adapters plus createForgeCliRunner invalidate and retry once when a previously resolved executable disappears at launch time (ENOENT, or a missing Windows batch launcher). This preserves cached lookups on normal runs while recovering automatically when a user uninstalls or relocates an installation while another copy remains on PATH.
* fix(server): refresh cached forge CLI path on any unlaunchable spawn error
Match executable-resolution's unlaunchable spawn error set (ENOENT, EACCES, ENOEXEC, UNKNOWN) when deciding whether to invalidate and re-resolve a cached forge CLI path, so losing execute permission falls back to another working copy on PATH.
* fix(git): offer Push and Pull for a branch whose remote is not origin
A checkout whose only remote has another name, with main tracking that
remote's main, got no Push, Pull or Pull and push. The app gated all three
on hasRemote, which is true only when origin is configured, and the
daemon's pull refused to run without origin.
Neither action needs origin. The daemon now reports where each one goes for
the current branch (pullRemote, pushRemote) and the app offers the actions
from those. One resolver picks the push destination for both the status and
the push, so the offer and the push cannot disagree.
Without origin, Push follows the upstream only when the upstream branch has
the branch's own name and git pushes the branch to that remote. A branch
such as feature tracking upstream/main can be pulled and is not pushed.
With origin, every push goes where it went before.
firstPushRemote stays on the wire for apps that predate pushRemote.
* fix(git): follow Git's own push destination when origin is missing
Without origin, Push compared the upstream's remote with the remote Git
pushes the branch to. That missed a push refspec: with
remote.<upstream>.push set, plain `git push` updates another branch, and
Paseo still updated the upstream. A regular checkout with a push refspec on
branch.<name>.pushRemote was pushed there and stayed ahead of its upstream.
Push now asks Git where `git push` sends the branch (%(push)) and follows
the upstream only when that is the upstream. This also covers
push.default. A Paseo worktree keeps the push refspec Paseo configures for
a PR checkout.
Pull no longer requires a configured upstream before it runs. Git decides,
so a branch with no upstream in a single-branch clone pulls again.
* fix(git): compare the push remote by name when origin is missing
Push compared Git's push destination with the upstream as remote-tracking
refs. Two remotes whose fetch refspecs map onto the same tracking namespace
give the same ref for different repositories, so a branch Git pushes to one
remote was sent to the other. The remote Git pushes to is now compared by
name as well.
* fix(git): leave a matching-mode push to the user when origin is missing
Under push.default=matching, git push sends a branch only when the remote still has it. The checkout's remote-tracking ref can outlive a branch deleted on the remote, so the daemon cannot tell from local metadata that the push would go to the upstream, and its explicit push would recreate the branch. Without origin, Push is now refused in that mode.
Stage the generated additions so both diff paths can read their patches in bulk while still comparing against HEAD.
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
* fix(git): offer Push for never-pushed branches and non-origin remotes
The Changes pane decided whether to offer Push from two daemon fields that
answered a different question. `aheadOfOrigin` is null both when a branch has
no upstream and when its upstream was deleted, so the app could only treat
null as a first push inside Paseo worktrees; a never-pushed branch in a
regular checkout got no Push. `hasRemote` is true only for a remote named
origin, so a branch tracking any other remote got "not connected to a remote"
while the daemon's push would have used the tracked remote.
The daemon now reports the two facts the decision needs: `upstreamState`
(tracked, none, gone, unknown) and `pushRemote`, resolved by the same
function `pushCurrentBranch` uses, so the button and the push cannot
disagree. A deleted upstream stays out of first-push in regular checkouts
so Paseo does not silently re-publish a branch whose remote copy was removed;
Paseo worktrees keep re-publishing, as before.
Both fields are optional on the wire. Against an older daemon the app keeps
the previous rule, tagged COMPAT(checkoutPushTarget).
* fix(git): keep a published branch out of first push in single-branch clones
A `--single-branch` or `--depth` clone keeps no remote-tracking ref for a
feature branch, so git reports a blank upstream even after `push -u` set
`branch.<name>.remote` and `.merge`. The daemon read that blank as "never
pushed", and a regular checkout then offered Push, which re-created the
branch after it was deleted on the remote.
A blank upstream is now "none" only when no upstream is configured. A
configured upstream git cannot resolve is "unknown". Paseo worktrees keep
publishing in that state, as they did before upstreamState existed.
* fix(git): do not push to the upstream when git pushes the branch elsewhere
With `branch.<name>.pushRemote` or `remote.pushDefault` naming a fork, git
pushes a branch that tracks `upstream/main` to the fork. The daemon ignored a
push remote that has no HEAD push refspec and pushed HEAD to the tracked
branch instead, which is the shared base. Offering Push for remotes not named
origin made that reachable in checkouts that have no origin.
The push target is now empty when git's push remote differs from the remote
the daemon would use, so status reports no push remote and the push refuses
with a message that names git's push remote. Push remotes Paseo configures
itself carry a HEAD push refspec and are unaffected.
* fix(git): withhold Pull and push when Push has no remote to send to
Pull and push checked only that origin exists, so it stayed available when the daemon reports no push remote. It then pulled, which can create a merge commit, and failed at the push. It now uses the same push remote check as Push.
* fix(git): do not extend pushes to a differently named upstream branch
The daemon pushes a tracked branch to its upstream branch whatever that
branch is called, so `feature` tracking `main` pushes to `main`. The app
offered Push only in checkouts that have origin. Reporting a push remote for
any tracked remote made the same push reachable without origin, for example
`feature` tracking `upstream/main`.
Without origin, the upstream is now a push target only when its branch has
the same name as the local branch, which is the push git itself makes by
default. Checkouts that have origin behave as before.
* fix(git): limit the Push fix to never-pushed branches
Push for branches that track a remote other than origin is removed from
this change. Supporting it means following Git's push settings
(branch.<name>.pushRemote, remote.pushDefault, push.default) for every
remote, and each review round found another setup where the push would
have gone to the wrong place.
The daemon's push is the same as before this branch again. What stays is
upstreamState on the checkout status, which lets the app tell a
never-pushed branch from one whose remote copy was deleted, and the app
rule that offers a first push in a regular checkout.
* fix(git): withhold first Push when git pushes the branch to another remote
The daemon publishes a branch with no upstream to origin. Git picks the
remote for a push from branch.<name>.pushRemote, then remote.pushDefault,
so in a fork setup `git push` sends a new branch to the fork while Push
sent it to origin. Offering a first push in regular checkouts made that
reachable there.
The checkout status now reports firstPushRemote: origin when git would
push the branch to origin too, null otherwise. A regular checkout offers
a first push only when it is set. Paseo worktrees and the daemon's push
are unchanged.
The never-pushed browser test read the branch's upstream as soon as the
remote had the branch. Git writes the upstream after that, so the test
now waits for it.
* fix(git): check the first push destination again before pushing
The app offers a first push from a checkout status that can be older
than the git configuration. If remote.pushDefault or
branch.<name>.pushRemote changed after the status loaded, Push still
published the branch to origin.
The daemon now makes the same check when it pushes: in a regular
checkout, a branch with no upstream is published to origin only when git
would push it there too. Otherwise the push is refused with a message
that names git's remote. Paseo worktrees, and branches whose upstream is
a local branch, push as before.
* fix(git): describe a missing upstream without blaming the remote
A branch can track a local branch. When that branch is deleted, git reports the upstream as gone, and the Push menu said the branch was deleted on the remote, which never happened. The message now says the tracked branch no longer exists, which is true for a local and a remote upstream.
* test(server): expect the Paseo home in the session push call
The checkout session now gives pushCurrentBranch the Paseo home, so the push can tell a Paseo worktree from a regular checkout. The session test still asserted the old single argument.
* fix(git): read a branch's Git settings under its real name when a tag shares it
With a tag of the same name, git spells the current branch heads/<name>. The daemon used that spelling to read branch.<name>.* settings and the branch ref, so it found none of them. A never-pushed branch set to push to a fork was reported as publishable to origin and was pushed there, a branch whose remote copy was deleted was reported as never pushed, and a branch tracking a fork was pushed to origin.
The status and push paths now read those settings and the ref under the name from the symbolic HEAD ref. getCurrentBranch, the branch name sent to clients, and the refspec of the first push keep git's short spelling, which is the right one for a revision.
* fix(hermes): show the full command of Hermes terminal calls
Hermes titles a terminal call with its own summary ("terminal: echo ... + 5
commands") and sends the full command only as "$ <command>" start content,
which the completion update replaces. It sends no rawInput, so the generic
ACP adapter fell back to the title and the full command was never stored.
Hermes now runs as a bundled runAcpProvider plugin. Its terminal transformer
lifts the start text into input.command and carries it across the
completion through context.previous; any other shape passes through, so an
upstream format change shows the title again instead of breaking.
The plugin ACP shim now builds the standard row for each ACP tool kind, so
read/search/fetch rows keep their shape after the move. Transformers still
see raw input, output and content, and a detail they set wins.
Moving Hermes surfaced two regressions, both fixed:
- The activity curator printed "[Shell] null" for typed rows whose name
looks namespaced (Hermes titles contain ":"); the raw-input fallback now
applies only to unknown rows.
- Agents saved by the generic adapter stored Hermes session-mode IDs, but
the shim uses Hermes's edit_approval_policy config option as ACP prefers,
so resume failed with invalid_params. legacyModes translates them.
Legacy extends:"acp" Hermes configs migrate on load, keeping a custom
command, gated on server_info.features.hermesProvider.
* fix(acp): keep Hermes approvals, Auto Accept, and session import after bundling
Moving Hermes from the generic ACP adapter to the plugin ACP shim dropped
behavior the adapter had:
- Approvals were built without a detail, so the approval card had no diff.
Approvals with no rawInput also failed with "Invalid params".
- The shim had no unattended mode, and agents that saved the adapter's
`auto_accept` toggle sent it back to Hermes as an unknown config option.
Hermes now offers a Full access mode, and a saved `auto_accept: true`
resumes in it.
- Session listing read only the first page of `session/list`, so the import
picker lost sessions past the first 50.
- Edit rows whose result is text lost that text instead of showing it as
the diff, unlike the generic adapter.
* fix(acp): keep a mode chosen after a saved Auto Accept toggle
The generic ACP adapter's `auto_accept` setting stays in the agent's saved
options after the move to a bundled ACP provider. It put the agent back in
the unattended mode on every reopen, even after the user chose another
mode, so approvals stopped asking again after a reload. The toggle now
counts only while the saved mode is one the generic adapter wrote, which
the agent no longer offers.
* fix(acp): keep whitespace-only text in Edit rows
The standard Edit row read old and new text with the same helper as
titles and paths, which skips blank strings. An edit that replaces text
with spaces lost its new text, so the app drew it as a deletion. File
text is now kept as written, as the previous formatter did.
* fix(server): deliver urgent messages to archived agents
An out-of-band probe rejected urgent messages before normal dispatch could restore the archived recipient. Decline the probe so the existing dispatch path restores the recipient and delivers the prompt.
Co-authored-by: Thomas Van <9481872+thomasvan@users.noreply.github.com>
* fix(server): deliver urgent messages during agent restore
When restore closes the history session, the stored agent still exists. Let normal dispatch reopen it instead of treating the missing session as a dispatch failure.
---------
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Van <9481872+thomasvan@users.noreply.github.com>
Observe a loop turn before the first filesystem request. Timer gaps also count CPU work that belongs to other callbacks.
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
* fix(server): keep git from adopting bare-repository-shaped directories
Git discovery treats any directory holding `HEAD`, `config`, `objects/` and
`refs/` as a bare repository, at the working directory or in a parent. Daemon
git commands then ran with that directory's config. They now pass
`-c safe.bareRepository=explicit`. The flag is left off only when the working
directory is a bare repository that a linked worktree's `.git` file points back
to, so the bare + linked-worktree layout keeps working.
The diff reader ran `git status` inside every submodule path. An uninitialized
submodule has no `.git`, so git walked up to whatever repository sat above it.
The reader now skips submodules without `.git` and pins `GIT_DIR=.git` for
initialized ones.
The worktree-include plugin spawns git directly and gets the same flags.
* fix(server): stop bare-repository discovery on Git before 2.38
Git releases before 2.38 ignore `safe.bareRepository`, so the runner's flag
did nothing there. On those releases the runner now follows git's discovery
order from `cwd` itself. If it reaches a directory that looks like a bare
repository before any `.git`, it pins `GIT_DIR` to the missing `<cwd>/.git`
and git reports that no repository was found, which matches what newer
releases do with the flag. The git version is read once per process.
The worktree-include plugin needs no fallback: it runs git at a checkout
root, where discovery stops at that checkout's own `.git`.
* test(server): keep fixtures independent of git discovery timing
The fetch fixture ran `update-server-info` from inside a plain bare remote.
With `safe.bareRepository=explicit`, git now refuses that unless the
repository is named, so the fixture passes `--git-dir`.
The slow-cadence poll test let the service read `remote.origin.url` through
real git while timers were faked. The runner now checks the working directory
before it spawns, and fake timers do not wait for that file-system work. The
test now injects the repository host and slug like its neighbors do.
* fix(server): refresh live diffs when an uninitialized submodule's commit changes
Skipping `git status` for an uninitialized submodule left its worktree
identity empty, so staging a different commit kept the same identity. Open
diffs then reused the previous patch. The identity is now the commit that the
comparison's index records for that path.
* fix(server): read an uninitialized submodule's commit at stage 0 explicitly
A path such as `0:sub` made `:<path>` read as stage 0 of `sub`. Naming stage 0 keeps the rest of the argument as the full path.
* test(server): supply repository identity to fake-timer poll tests
The poll tests advance a fake clock, but their repository host and slug
lookups ran real git. Git launches now read the filesystem before
spawning, so that real work could finish after the clock had already
advanced, and the expected reads were missed intermittently.
* fix(server): name a recorded bare repository root explicitly for git
Git commands at a bare repository root used to run only while a linked
worktree pointed back to it. After the last checkout of a bare repository
was archived, that link was gone, so Restore failed with "cannot use bare
repository". A bare repository with no checkouts has the same files on disk
as a bare-repository-shaped directory, so the files cannot tell them apart.
Git now never discovers a bare repository by its directory. Worktree
creation, archive, and Restore receive their repository root from Paseo's
records, and they run inside runWithRepositoryRoot. That scope names a bare
root through GIT_DIR, for commands at that exact root only. It is read when
a command is submitted, because the git scheduler can start the process
from another async context.
* fix(server): list worktrees of a bare repository that only Paseo checkouts use
Archiving by slug or branch lists worktrees at the recorded repository root.
When that root is a bare repository with no `.git`, explicit bare-repository
handling made `git worktree list` fail there. Listing, branch-off preparation
and ref fetching now name the recorded root the same way creating and
removing worktrees already do.
* test(server): give the bare-repository restore fixture a commit identity
A bare clone does not copy the source checkout's local user.name and user.email, so the fixture commit failed on runners without a global identity.
* test(server): make bare-repository tests hold on Windows runners
The tests compared 8.3 short temp paths with the long paths that git and
async realpath report, compared git's forward-slash paths as raw strings, and
read files that the runner's core.autocrlf had converted to CRLF. Temp
directories now resolve through realpathSync.native, git paths go through
path.resolve, and the bare fixtures set their config on the bare repository,
because a bare clone does not copy the source checkout's local config.
Claude Code supports Auto mode on Bedrock and Vertex, but Paseo removed it from the catalog and rejected explicit selections before reaching Claude Code. Remove that obsolete eligibility gate while preserving the existing default modes and SDK error handling.
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
* fix(server): keep the daemon alive when a plugin session closes after its process dies
PluginSessionSocket.close() sent paseo_close to the plugin child without a
callback. Node does not throw when that send fails: it emits "error" on the
ChildProcess, and the runtime has no error listener, so the failure became an
uncaught exception. The try/catch around the send never ran.
When a plugin process dies, a frame write to its session fails with EPIPE, the
websocket server's outbound transport closes the socket, and the close's own
send then crashed the daemon with "write EPIPE" (or ERR_IPC_CHANNEL_CLOSED once
Node has seen the disconnect). Passing a callback makes the failed send a
handled result.
* test(server): skip the POSIX-only plugin EPIPE test on Windows
Trigger save validation used the host-wide provider catalog, so it rejected models offered by the workspace catalog. Pass the optional working directory through to provider discovery.
MCP startup failures previously reached only the unhandled trace log. Keep a diagnostic summary at warning level and omit raw error text from tracing because it can contain credentials and response bodies.
* fix(server): serve agent MCP over the 2026-07-28 protocol
Reasoning:
- The bundled `@modelcontextprotocol/sdk@1.29.0` only speaks up to protocol `2025-11-25`, while current MCP clients (Claude Code, Codex, Grok CLI, ACP harnesses) send `mcp-protocol-version: 2026-07-28` and get `400 Bad Request: Unsupported protocol version` on the first request after `initialize`. The agent then runs without any Paseo tool, so `list_agents`, `create_agent`, and the rest silently disappear from the tool surface (#3009).
- Widening the accepted version list (the approach in #4570 / #4375) hides the rejection but leaves the server implementing 2025 semantics while telling the client it speaks 2026-07-28.
Changes:
- Replace the v1 `StreamableHTTPServerTransport` wiring in `bootstrap.ts` with the v2 dual-era `createMcpHandler(..., { legacy: "stateless" })` plus `toNodeHandler` from `@modelcontextprotocol/node`. Modern 2026-07-28 requests and 2025-era clients are served by the same handler; per-request stateless serving is unchanged.
- Move `agent/mcp-server.ts` to `@modelcontextprotocol/server` (`McpServer`, `ServerContext`, `context.mcpReq.signal`).
- Keep `@modelcontextprotocol/sdk` for the existing client-side integrations (e.g. the OMP MCP bridge).
- Assert the JSON-RPC `-32602` rejection in `mcp-server.test.ts`: a call to an unregistered tool is a protocol error, which the v1 server folded into an `isError` result.
Verification:
- `npx tsc -p packages/server/tsconfig.server.json` clean; `npm run typecheck` clean; `oxfmt`/`oxlint` clean on the touched files.
- `npm ci --dry-run` accepts the lockfile.
- `packages/server`: `mcp-server.test.ts` 194/194, `agent-mcp.e2e.test.ts` 8/8, `mcp-parity.e2e.test.ts` 38/38.
- Manual check on macOS against a real daemon: a `dsh` agent (sends 2026-07-28) lists Paseo tools (`create_workspace`, `list_workspaces`, `create_agent`) and the daemon logs zero `MCP transport error` / `Unsupported protocol version` entries.
* test(server): cover the modern MCP envelope on the agent endpoint
Reasoning:
- Greptile flagged that the tool registration used a `registerTool` re-cast, which defeats the SDK's type check on a path every agent tool call goes through.
- The modern (2026-07-28) path had no regression coverage, so a looser "accept the version header" implementation would also pass the existing tests.
Changes:
- Narrow only the schema at the registration boundary (`inputSchema as StandardSchemaWithJSON`) and document why: Paseo declares schemas through the `zod` root entry, the SDK types them through `zod/v4` core; same runtime, distinct type identities.
- Add a modern-protocol test that drives `createMcpHandler` with a per-request envelope (`_meta` protocol version + `mcp-method` header) and asserts the catalog tools come back.
Verification:
- `npx vitest run src/server/agent/mcp-server.test.ts` 195/195.
- `npx tsc -p packages/server/tsconfig.server.json` clean; `oxfmt` / `oxlint` clean.
* test(server): expect the agent MCP handler's own rejection
The stateless MCP handler answers a body-less POST with 415 (unsupported
media type) instead of the old transport's 406. The smoke test only needs the
route to be live before the reload and gone after it, so assert that answer and
say why the code changed.
* fix(server): give native host tools the schema the agent MCP serves
The agent MCP endpoint now registers tools with @modelcontextprotocol/server,
which converts input schemas with zod at the draft 2020-12 target. The OpenCode
bridge and OMP host tools still serialized through the v1 SDK internals as
draft-07, so the plugin parity test (native schema equals advertised schema)
failed. Serialize with the same zod conversion so one schema reaches both paths,
and drop the dependency on unexported v1 SDK internals.
OpenCode reads both dialects and defaults to 2020-12. OMP rewrites draft-07 to
2020-12 before sending to a model.
* test(server): negotiate the agent MCP with pinned, auto and legacy clients
Drive a real daemon's /mcp/agents with @modelcontextprotocol/client 2.4.0:
- pinned to 2026-07-28: fails on the v1 transport ("server did not offer
pinned protocol version 2026-07-28").
- auto: falls back to 2025-11-25 on the v1 transport. The test also asserts
that the daemon logs no transport errors.
- legacy: the 2025-era compatibility guard.
Run the block in test:integration so CI keeps it, and translate the modern
envelope test comment to English.
* test(ci): route the agent MCP negotiation block through server integration
The block shares the existing name-filtered vitest invocation, so it adds no extra vitest start to the Windows integration job.
* test(website): play the orchestration scene on a held page clock
The scene player advances at most 64ms per animation frame, so on a CI
runner where headless WebKit paints a few frames a second the scene ran
in slow motion and missed the 20s wait for the subagents pill. The test
now pauses Playwright's page clock after hydration, checks the empty
chat, then runs the clock past the scene before asserting the roster.
---------
Co-authored-by: Ouyang Xingyuan <galaxyroaming@qq.com>
* Use the filesystem’s capitalization in directory suggestions
* fix(server): preserve conversations across path casing changes
A case-insensitive volume can resolve the old and new record paths to the file installed by the same atomic write. Check file identity before removing the old entry so startup recovery preserves both the record and its workspace.
* fix(server): keep case-only symlink names in directory suggestions
A case-sensitive volume can store a symlink whose name differs from its target only by capitalization. Inspect the changed components before using the resolved spelling so Add Project receives the visible path.
* fix(server): preserve symlinks under case-distinct parents
A symlink can point into a parent whose name differs only in case while keeping the same basename. Inspect each changed path component before choosing the resolved spelling.
---------
Co-authored-by: yz <43207690+yzim@users.noreply.github.com>
* fix(opencode): replace stale bridge tool definitions instead of failing the bind
The shared bridge plugin keeps tool definitions in an in-memory cache
(state.mjs) that survives OpenCode's plugin reloads. When the Paseo daemon
upgrades and ships a changed tool definition (e.g. the description or input
schema changes), the next bind finds a signature mismatch and throws
"Conflicting Paseo tool definition", leaving every existing session in that
location unable to rebind. This is the upgrade path: the bridge changed, not
a second live bridge.
Treat a changed definition as a refresh, not a conflict: dispose the stale
registration and re-register the new one. Track the whole installed manifest
per location and reconcile on each bind so removed tools also disappear,
instead of letting the first per-tool difference fail the bind.
Add tests covering a definition upgrade (bind succeeds, tool reflects the
new schema) and a manifest drift (a removed tool leaves the registry).
* fix(opencode): resume sessions after bridge tool definitions change
A retired bridge can leave tool definitions cached in a shared OpenCode location. Replace a conflicting definition once the bound sessions confirm that it is unused. Preserve tools that other live sessions still use.
Co-authored-by: Peanut-HZM <34237301+Peanut-HZM@users.noreply.github.com>
* test(server): wait for the worktree manager ready marker
The marker confirms that the plugin entered the create hook. Give the hook the same deadline as the other worktree fixture handshakes, and observe the pending request if teardown closes the client.
---------
Co-authored-by: huazhongmin <peanut_hzm@163.com>
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
Co-authored-by: Peanut-HZM <34237301+Peanut-HZM@users.noreply.github.com>
agy lists `thought_level` choices only for the selected model, and drops
the option entirely for Orchestrator and GPT-OSS. ACP catalog discovery
read one session/new and copied the startup model's levels onto every
model, so the composer offered and defaulted to a thinking level for
Orchestrator. Opening the draft session then set the model, found no
`thought_level`, and failed with "ACP session does not expose thinking
configuration".
The new `acpOptions.perModelThinkingOptions` makes discovery select each
model in the throwaway catalog session and record the levels the agent
lists for it, or none; Antigravity turns it on. It is opt-in because
selecting a model can reset other options in some agents. The server
also stops giving a model the catalog's default when the model brings
its own options, since that default came from another model's list.
Closes#10468
Release the fixture connection from plugin cleanup so the parent test runner does not have to write a file before the runtime shutdown deadline.
Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>