Behavior Changes
Session-scoped active task runtime
active task state 改为写入每个 session 自己的 runtime 文件:.trellis/.current-task 不再作为 active task fallback。
| 命令 | 行为 |
|---|---|
task.py start <task> | 把当前 task 写入解析到的 session 文件 |
task.py current --source | 从解析到的 session 文件读取当前 task |
task.py finish | 删除解析到的 session 文件 |
task.py archive <task> | 移动 task 前,删除仍指向该 task 的 session 文件 |
task.py start 以 exit code 1 退出:
Bootstrap and joiner tasks
trellis init 仍会创建 bootstrap 和 joiner task 目录,但不再写 .trellis/.current-task。
生成的 PRD 会说明:AI 应在能提供 Trellis session identity 的 session 中启动该 task。
Workflow task-creation policy
workflow.md 和 hook fallback breadcrumb 放宽了 task 创建策略。
| 范围 | 之前行为 | beta.15 行为 |
|---|---|---|
no_task 触发词 | 命中触发词就要求创建 task | 命中触发词表示建议创建 task |
| 简单任务 | 没有明确豁免 | 同时满足三项时不要求创建 task:本轮不写文件、一次回复能完成、无需超过读取 1-2 个 repo 文件的研究 |
| 用户显式跳过 | hook prompt 未说明 | 当前轮出现 skip trellis、no task、just do it、跳过 trellis、别走流程、先别建任务 等短语时,本轮跳过 task 创建 |
in_progress 实现 | main session 被要求不要直接改代码 | 默认仍派 trellis-implement / trellis-check;当前轮明确出现 do it inline、main session 写就行、不用 sub-agent 等短语时,允许 main session 直接实现 |
Platform Integration
Shell session identity handling
不同宿主暴露 session identity 的方式不一样。beta.15 为task.py start/current/finish 增加宿主侧处理。
| 平台 | 变更 |
|---|---|
| Claude Code | session-start.py 通过 CLAUDE_ENV_FILE 写入 TRELLIS_CONTEXT_ID |
| Codex | task.py 直接识别 Codex 命令环境里的 CODEX_SESSION_ID 和 Codex Desktop 的 CODEX_THREAD_ID |
| Cursor | beforeShellExecution 为匹配的 task.py 命令写入短生命周期 .trellis/.runtime/cursor-shell/*.json ticket |
| OpenCode | Bash tool command 前置 TRELLIS_CONTEXT_ID |
| Pi | Bash tool call 和嵌套 pi --mode json sub-agent run 接收 TRELLIS_CONTEXT_ID |
.trellis/.runtime/sessions/ 存储 active task state,但 beta.15 没有为它们新增 shell-command 处理。
| 平台组 | beta.15 状态 |
|---|---|
| GitHub Copilot | 平台专用 SessionStart hook 会为上下文注入解析 session identity。宿主导出 COPILOT_* session env 时,task.py 可以直接使用;否则手动 shell start 仍需显式 TRELLIS_CONTEXT_ID。 |
| Gemini CLI、Qoder、CodeBuddy、Droid、Kiro | shared hook 从 hook input 或平台 env 解析 session identity。beta.15 没有新增 shell-command bridge;宿主不导出 session id 时,手动 shell start 仍使用 TRELLIS_CONTEXT_ID。 |
| Kilo、Antigravity、Windsurf | 没有 hook 集成。使用各自 workflow/command 文件;手动运行 task.py start 时显式传入 TRELLIS_CONTEXT_ID。 |
.agents/skills consumers | 没有 Trellis 管理的 hook 层。使用 .trellis/ core 和宿主自己的 prelude/env 注入能力。 |
Cursor sub-agent hook matching
Cursorhooks.json 现在同时匹配两个 tool name:
inject-subagent-context.py 也能解析 Cursor custom-agent payload:
Pi Agent session runtime
Pi Agent 现在从.trellis/.runtime/sessions/ 读取 active task state。
context key 来源优先级:
| 来源 | 示例 |
|---|---|
| 显式 env | TRELLIS_CONTEXT_ID |
| Pi session manager | sessionManager.getSessionId() |
| Pi env | PI_SESSION_ID, PI_SESSIONID |
| Transcript path | transcript_path / transcriptPath |
| Process fallback | pi_process_<hash> |
TRELLIS_CONTEXT_ID。
Workflow-state override copy
workflow-state breadcrumb 现在使用准确的 Trellis agent 名称:
Bug Fixes
OpenCode sub-agent name normalization
OpenCode 现在:- 识别
OPENCODE_RUN_ID作为 session identity - 匹配 sub-agent 名称前去掉
trellis-前缀 - 保持重命名 agent 的
implement.jsonl/check.jsonl注入可用
Git-backed private registries
Template registry 下载现在支持私有 Git-backed registry。registry source 需要本机 Git 凭证时,Trellis 会通过 Git 读取index.json 并复制 template 目录,不再依赖匿名 raw HTTP。
这覆盖 self-hosted GitLab / GitHub Enterprise source 和 SSH registry URL。registry 错误会区分 authentication failure、missing ref、missing path、invalid index.json 和 network failure,trellis init --registry 不再把这些情况误判成 direct-download mode。
Shared-hook cleanup
writeSharedHooks 和 collectSharedHooks 现在使用同一张平台能力表:
.claude/hooks/statusline.py,也不会在 .claude/settings.json 里配置 statusLine。
manifest 包含 11 条 hash-verified safe-file-delete entry,用于清理曾写入项目但现在已经孤立或默认禁用的 hook。
| 删除路径 | 原因 |
|---|---|
.claude/hooks/statusline.py | Claude Code statusLine 默认禁用 |
.cursor/hooks/statusline.py | Cursor 没有 statusLine event |
.codex/hooks/statusline.py | Codex 没有 statusLine event |
.gemini/hooks/statusline.py | Gemini 没有 statusLine event |
.qoder/hooks/statusline.py | Qoder 没有 statusLine event |
.github/copilot/hooks/statusline.py | Copilot 没有 statusLine event |
.codebuddy/hooks/statusline.py | CodeBuddy 没有 statusLine event |
.factory/hooks/statusline.py | Factory Droid 没有 statusLine event |
.kiro/hooks/statusline.py | Kiro 没有 statusLine event |
.kiro/hooks/session-start.py | Kiro 只暴露 agentSpawn |
.kiro/hooks/inject-workflow-state.py | Kiro 只暴露 agentSpawn |
Docs
Beta task docs
beta 文档现在描述:- current task state 位于
.trellis/.runtime/sessions/<session-key>.json - task 归属按 session 计算,不再使用全局项目指针
continue/finish-work是主要用户命令task.py start是 session-bound operation- Cursor、Codex、Claude Code、OpenCode、Pi 的 hook/sub-agent 行为
Multi-agent docs
beta multi-agent 文档改为描述原生 Git worktree 加 Trellis task。移除 Trellis 托管/trellis:parallel 和 worktree.yaml 相关说明。
Upgrade
已有项目:--migrate gate。
已有 task 目录和 jsonl 文件保持有效。已有 .trellis/.current-task 文件会保留,但新的 active-task resolver 会忽略它。
手动 shell 使用需要显式 context id: