* feat(server): branch off a pull request and list every git worktree A workspace.create worktree source with action "branch-off" and a checkoutSource used to check the pull request out, because core took any change request as a checkout. Branch-off now fetches the pull request's head into a remote-tracking ref (origin/<head> for a same-repo head, paseo-pr-<N>/<head> otherwise) and starts the new branch there, with no upstream and no remote added. A request with no action still checks the pull request out, as older clients expect. checkout.worktrees.list returns all git worktrees of the repository, not only the ones Paseo created, so the New workspace screen can offer any of them. Bare and prunable entries are left out. Hosts advertise both through server_info.features: worktreeRefActions and checkoutWorktreeList. Older hosts ignore the branch-off action on a pull request, so the app must gate on the flag. * feat(app): pick an existing worktree, and branch off or check out a ref Isolation now offers Project directory (was "Local"), New worktree, and Existing worktree. Existing worktree is a local workspace at the chosen worktree's path, not a third isolation value, so plugins, preferences, and the create request still see "local". The list comes from checkout.worktrees.list, so it includes worktrees Paseo did not create. The ref picker gains Branches / Pull requests pills and a Branch off / Check out toggle with a tooltip per action. Branches default to Branch off and pull requests to Check out. On a host without worktreeRefActions the toggle is hidden and the defaults apply. Git keeps a branch in one worktree at a time. Picking a held branch in Check out mode moves to the worktree that holds it, and creating from a held branch that was never picked fails with an explanation. Without this the server would silently check out a "<branch>-1" copy. * docs: describe Existing worktree and Branch off / Check out * fix(server): give a fork pull request branch-off a base the repository has A branch off a fork's pull request stored the fork's head as its base, under refs/remotes/paseo-pr-<N>. Create PR then asked for a pull request into a branch the base repository does not have, and the ref piled up in base branch pickers because no remote owns it. The new branch now starts at the fetched head, kept under refs/paseo/change-requests/<N>, and its base is the pull request's base branch. A same-repository branch-off still stacks on the pull request's branch. A routed create_workspace with a prNumber and no mode checks the pull request out again, as before branch-off could start from a pull request. The worktree list skips a locked worktree whose directory is gone, since it cannot be opened. * fix(app): start an existing worktree's agent in that worktree Existing worktree created the workspace at the worktree, but the composer and terminal still used the project directory, so the daemon rejected the first agent as outside the workspace. The screen now derives one working directory from the isolation and uses it for the workspace, the composer, and the terminal. A worktree that left the list is no longer a choice. The ref picker names change requests the way the project's forge does, so a GitLab project shows Merge requests. The schedule form uses the isolation labels Project directory and New worktree. * fix(server): compare a fork pull request branch-off against the remote base The base was stored as the bare branch name, which resolves to the local branch first. A local main behind origin/main put upstream commits in the workspace's changes for its whole life, and a base branch the clone never fetched failed creation. The base branch is now fetched from origin and stored as its remote-tracking ref. * fix(server): take a pull request's base and a checked-out branch from the remote that has them A fork branch-off fetched its base from origin. In a clone whose base repository is upstream, origin is the user's fork or missing, so the base was stale or the create failed. The base now comes from the remote that served the pull request, and a failed base fetch falls back to the bare branch name. Check out of a branch that only a remote other than origin has failed with an unknown branch. The local branch is now created from the one remote-tracking ref with that name, tracking it, as git does. The fork branch-off test passes a git identity to commit-tree, which CI runners do not have. * fix(server): branch off a pull request from the remote that serves it A same-repository pull request's head was fetched into refs/remotes/origin. In a fork clone, upstream serves the pull request and origin is the fork, so the base refresh replaced the head with the fork's branch of the same name and the new branch started from code that is not the pull request. The head now lands under refs/paseo/change-requests/<N>, the branch starts there, and the base is fetched from the remote that served the head. A routed create_workspace that branches off a pull request is refused, as it is on the local host. * fix(app): branch off a plugin's base ref whatever the branch action setBaseRef chose the base but kept the user's Check out switch, so a plugin's base became a checkout or a held-branch error. A base is what a new worktree starts from, so setBaseRef switches branches back to Branch off.
2.9 KiB
2.9 KiB
title, description, nav
| title | description | nav |
|---|---|---|
| 定时任务 | 按 cron 计划运行新的 Agent,或用 heartbeat 唤醒已有的 Agent。 | 概览 |
定时任务
定时任务按 cron 节奏为你启动一个新的 Agent:在这个时间,在这个仓库里,用这些 Agent 设置运行这段提示词。
Paseo 还有 heartbeat。heartbeat 会定期向一个已有的 Agent 发送提示词,让它重新评估并继续同一段对话。
两者使用同一个 cron 引擎,但在产品中是分开的:
- 定时任务每次运行都会创建一个新的 Agent。你可以查看、暂停、恢复、运行一次、更新或删除它们。
- heartbeat 针对一个已有的 Agent,刻意保持轻量:通过 MCP 创建或删除;在 CLI 中还可以只更新它们的 cron 周期。
cron 是标准的节奏表示。CLI 接受 5m 或 1h 这样的简单预设,但会把它们编译成 cron,而不是另存一种间隔类型。
两者都按你设定的节奏运行。如果想由外部事件(比如一条评论或一次提及)启动 Agent,请参见 Hub。
用途
- 全新的周期性任务:为每日分拣、报告或维护启动一个干净的 Agent。
- heartbeat:让当前 Agent 定期重新评估状态并继续推进。
- 盯构建:让一个 Agent 持续检查 CI、EAS、Docker 或发布构建,直到通过。
- 每日分拣:每天早上扫描 issue、PR 和失败的检查。
- 维护巡检:更新依赖、审核文档或清理过期分支。
创建方式
- 在应用中:打开定时任务视图,设置 Agent、cron 节奏、仓库和提示词来创建。这是创建和管理定时任务的主要方式。
- 在聊天中:在聊天中告诉 Agent,它会为你创建定时任务。
- 通过 CLI:
paseo schedule create,适用于无界面的机器和脚本。 - 通过 MCP:Agent 以编程方式创建和管理定时任务。
保留运行工作区
新建 Agent 的定时任务每次运行都会创建一个工作区。Archive on finish 默认开启:运行结束时,Paseo 会归档该工作区及其 Agent。使用 worktree 隔离时,最后一个使用该 worktree 的活跃工作区被归档后,归档还会删除这个 worktree。
要保留运行结果,在应用的定时任务视图中打开该定时任务,关闭 Archive on finish 并保存。Paseo 会让每次运行的工作区和 Agent 保持活跃,直到你手动归档;在创建 Agent 之前就失败的运行仍会被清理。该选项同样适用于 Project directory 隔离;归档该工作区不会删除项目目录。
存储的选项是 target.config.archiveOnFinish,一个布尔值,省略时默认为 true。CLI 和 MCP 的定时任务工具不提供这个选项;请在应用中修改。heartbeat 使用已有的 Agent,没有这个选项。