feat(omp): add Oh My Pi platform support - #307
Conversation
|
+1 希望能增加omp支持,省token |
…l name (mindfold-ai#307) Two reviewer cleanups on top of the Oh My Pi platform work to ready the PR for merge review: 1. Remove personal Trellis dogfooding artifacts that crept into the diff while the platform was being developed. None of these belong in a reviewable PR — they leak the author's local workspace state into every reader's checkout: - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md` - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*` - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*` - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*` 2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/` and fix the inner `name:` frontmatter field. This anticipates the bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the dogfooded `.omp/` tree matches what `trellis update --omp` regenerates. Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the typoed name because the source template hasn't been renamed yet — that is intentional and self-corrects on the next dogfood pass after mindfold-ai#296. A `git merge origin/main` is still required before merge because main has moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest restoration in mindfold-ai#296). I left that conflict resolution to the maintainer at merge time rather than rebasing the contributor's commit history. Build / verification on the PR worktree: - `pnpm typecheck` clean - `pnpm test` 1049/1049 passing - `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
|
@VinciWu557 Thanks for the Oh My Pi work — this is a solid platform integration. I pushed one reviewer cleanup commit directly to the branch (47a28f7) to ready it for merge review. What the cleanup commit does1. Removed personal dogfooding files (14 files, ~700 lines). These crept in while you were developing the platform using Trellis itself, but they leak local workspace state into every reviewer's checkout:
The dogfooded 2. Renamed the dogfooded Still needed before merge
I didn't rebase for you because rebasing rewrites your 14 commits' history and you may want to keep the per-step trail for review (or squash them yourself in one pass). Your call. Verification on the cleanup commit
Looking forward to seeing this land. Ping me when rebased and I'll do a final pass. |
…l name (mindfold-ai#307) Two reviewer cleanups on top of the Oh My Pi platform work to ready the PR for merge review: 1. Remove personal Trellis dogfooding artifacts that crept into the diff while the platform was being developed. None of these belong in a reviewable PR — they leak the author's local workspace state into every reader's checkout: - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md` - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*` - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*` - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*` 2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/` and fix the inner `name:` frontmatter field. This anticipates the bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the dogfooded `.omp/` tree matches what `trellis update --omp` regenerates. Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the typoed name because the source template hasn't been renamed yet — that is intentional and self-corrects on the next dogfood pass after mindfold-ai#296. A `git merge origin/main` is still required before merge because main has moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest restoration in mindfold-ai#296). I left that conflict resolution to the maintainer at merge time rather than rebasing the contributor's commit history. Build / verification on the PR worktree: - `pnpm typecheck` clean - `pnpm test` 1049/1049 passing - `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
47a28f7 to
a2a5abd
Compare
…l name (mindfold-ai#307) Two reviewer cleanups on top of the Oh My Pi platform work to ready the PR for merge review: 1. Remove personal Trellis dogfooding artifacts that crept into the diff while the platform was being developed. None of these belong in a reviewable PR — they leak the author's local workspace state into every reader's checkout: - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md` - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*` - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*` - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*` 2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/` and fix the inner `name:` frontmatter field. This anticipates the bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the dogfooded `.omp/` tree matches what `trellis update --omp` regenerates. Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the typoed name because the source template hasn't been renamed yet — that is intentional and self-corrects on the next dogfood pass after mindfold-ai#296. A `git merge origin/main` is still required before merge because main has moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest restoration in mindfold-ai#296). I left that conflict resolution to the maintainer at merge time rather than rebasing the contributor's commit history. Build / verification on the PR worktree: - `pnpm typecheck` clean - `pnpm test` 1049/1049 passing - `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
a2a5abd to
0b32ee1
Compare
|
@taosu0216 已更新,感谢 review |
|
感谢 PR!omp 配置器本身写得干净 —— 复刻了 qoder/pi 的 extension-backed 模式, 1. [blocker] ~3900 行是纯重格式化噪声,请还原
这让 PR 的 +6694/-2014 几乎全是噪声,没法 review,也会跟其他 PR 频繁冲突。请:
2. [blocker] 缺 docs-site 平台同步 新增平台需要同步 docs(见
另外想确认一下:Oh My Pi 跟现有的 格式还原 + docs 补齐后就可以推进合并,再次感谢 🙏 |
我在用 omp,体感比 opencode 、claude code 要好。关于多平台的维护,感觉还是要把 skill 做成硬链接,都收敛到 trellis 中去,团队协同多平台的时候要会轻松很多。 |
…l name (mindfold-ai#307) Two reviewer cleanups on top of the Oh My Pi platform work to ready the PR for merge review: 1. Remove personal Trellis dogfooding artifacts that crept into the diff while the platform was being developed. None of these belong in a reviewable PR — they leak the author's local workspace state into every reader's checkout: - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md` - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*` - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*` - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*` 2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/` and fix the inner `name:` frontmatter field. This anticipates the bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the dogfooded `.omp/` tree matches what `trellis update --omp` regenerates. Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the typoed name because the source template hasn't been renamed yet — that is intentional and self-corrects on the next dogfood pass after mindfold-ai#296. A `git merge origin/main` is still required before merge because main has moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest restoration in mindfold-ai#296). I left that conflict resolution to the maintainer at merge time rather than rebasing the contributor's commit history. Build / verification on the PR worktree: - `pnpm typecheck` clean - `pnpm test` 1049/1049 passing - `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
0b32ee1 to
0a8b1a2
Compare
已按要求完成修改。
oh my pi 可以理解为一个开箱即用的 pi agent,它在 pi 内置了一系列的常用工具,如 lsp、subagent 等 |
|
Cool, can we get this reviewed and merged? Really like it. |
|
我重新基于最新
resolveCommands,
packages/cli/test/configurators/shared.test.ts 里这个 import 没用到,pnpm --filter @mindfoldhq/trellis lint 会报 @typescript-eslint/no-unused-vars。这个删掉就行。
Trellis 的 active task 是 per-session state,不是全局 current task。多个 AI session/window 同时存在时,.trellis/.runtime/sessions/*.json 里会有多个 session 文件。按 mtime 取最新 这里需要改成 session-aware:
这个规则和现有 Trellis resolve_active_task() 的行为一致:没有明确 session identity 时,多个 session 会拒绝猜,避免跨会话注入错误 task context。 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughOMP support is added across platform detection, CLI init/configuration, generated OMP assets, the OMP extension, workflow gating, and Trellis-local documentation/spec assets. Tests and platform-count references are updated to include the new platform. ChangesOMP Platform Support
Estimated code review effort: 4 (Complex) | ~75 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 16
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.trellis/spec/cli/backend/platform-integration.md (1)
807-815: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the agent-capable platform count.
The heading still says 11, but the list now has 12 platforms after adding
omp.Suggested fix
-| Command | Agent-capable platforms (11) | Agent-less platforms (3) | +| Command | Agent-capable platforms (12) | Agent-less platforms (3) |🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.trellis/spec/cli/backend/platform-integration.md around lines 807 - 815, The platform-count heading is stale and no longer matches the agent-capable list after adding `omp`. Update the summary in the platform-integration spec so the count used in the “Agent-capable platforms” header matches the actual list, and keep the `ctx.agentCapable` rule and the enumerated platforms in sync with the `continue`/`finish-work` table.
🧹 Nitpick comments (2)
packages/cli/test/regression.test.ts (1)
4332-4338: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the OMP command prefix here too.
This test still passes with the current broken
cmdRefPrefix, so it won't catch invalid OMP command references in generated templates.Suggested assertion
it("[omp] Oh My Pi platform is registered", () => { expect(AI_TOOLS).toHaveProperty("omp"); expect(AI_TOOLS.omp.configDir).toBe(".omp"); expect(AI_TOOLS.omp.cliFlag).toBe("omp"); expect(AI_TOOLS.omp.hasPythonHooks).toBe(false); + expect(AI_TOOLS.omp.templateContext.cmdRefPrefix).toBe("/trellis-"); expect(AI_TOOLS.omp.templateContext.agentCapable).toBe(true); expect(AI_TOOLS.omp.templateContext.hasHooks).toBe(true); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/test/regression.test.ts` around lines 4332 - 4338, The OMP regression test in the AI_TOOLS.omp block is missing coverage for the command reference prefix, so it won’t fail when cmdRefPrefix is wrong. Update the existing "[omp] Oh My Pi platform is registered" test to assert the OMP cmdRefPrefix value alongside the other AI_TOOLS.omp properties, using the same AI_TOOLS.omp object so this broken template reference is caught.packages/cli/test/templates/omp.test.ts (1)
36-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTighten the extension-marker assertion.
expect(extension).toContain("input")is too generic to guard the OMP integration path; it can pass for unrelated text. Drop it or replace it with a template-specific token so the test fails on real regressions.♻️ Proposed fix
expect(extension).toContain("before_agent_start"); - expect(extension).toContain("input"); expect(extension).toContain("session_start"); expect(extension).toContain("ExtensionAPI");🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/test/templates/omp.test.ts` around lines 36 - 42, The OMP template test is using an overly generic marker that can pass for unrelated content. Update the assertion in getExtensionTemplate’s test to remove the broad input check or replace it with a more specific OMP template token that uniquely identifies the extension path, so the test only passes when the intended integration markers are present.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.omp/skills/trellis-brainstorm/SKILL.md:
- Around line 219-223: The fenced markdown examples in SKILL.md are unlabeled,
which triggers MD040. Update both code fences in the affected examples to
include an explicit language tag, using the fenced example blocks around the
Main agent and Task snippets so markdownlint-cli2 stops warning on this file.
In @.omp/skills/trellis-meta/references/customize-local/change-agents.md:
- Around line 15-27: The common-paths table in the customization reference is
missing the OMP agent location, so update the table in the section that lists
platform-specific agent paths to include OMP with the supported path
`.omp/agents/trellis-*.md`. Keep the entry consistent with the existing platform
names and wildcard pattern so users can find the OMP customization location
alongside the other agent targets.
In
@.omp/skills/trellis-meta/references/customize-local/change-context-loading.md:
- Around line 57-70: The context-loading guidance only covers hook push and
agent pull, but misses extension-backed platforms, so update the
change-context-loading instructions to include the extension edit point used by
OMP. Make sure the guidance still preserves the required read order (active
task, prd.md, info.md if present, JSONL, then referenced spec/research) and
explicitly points to the OMP extension context injection path so it is clear
where to edit when the platform uses the extension-based flow.
In @.omp/skills/trellis-meta/references/platform-files/agents.md:
- Around line 21-35: The Common Paths table is missing the OMP agent location,
so update the agent-path mapping to include an OMP row for
.omp/agents/trellis-*.md alongside the existing platform entries. Keep the
change in the table under the same section and use the existing platform names
and pattern style used by the other rows so the new platform is discoverable.
In @.omp/skills/trellis-meta/references/platform-files/hooks-and-settings.md:
- Around line 17-30: The platform matrix is missing OMP’s extension-backed entry
point, so add `.omp/extensions/trellis/index.ts` to the OMP row in the
hooks-and-settings reference. Update the OMP entry in this table to clearly
distinguish it from settings/config-based platforms and point readers to the
extension entry point rather than a nonexistent settings file.
In @.omp/skills/trellis-meta/references/platform-files/overview.md:
- Around line 5-20: Add OMP to the platform-file overview so the directory list
and category table fully cover the new platform introduced by the PR. Update the
overview in the platform-files reference to include `.omp/` alongside the other
platform directories, and add any relevant `.omp` paths to the existing
settings/config, hooks/plugins/extensions, agents, skills, or commands/workflows
examples where they belong.
In @.omp/skills/trellis-meta/references/platform-files/platform-map.md:
- Around line 80-88: The fenced .omp/ layout block in platform-map.md is missing
a language label and is tripping markdownlint. Update the fenced block to use a
text label while keeping the directory layout content unchanged. Use the
existing fenced block around the .omp tree listing so the docs stay lint-clean.
- Around line 7-23: The main platform matrix is missing OMP, even though it is
referenced elsewhere in this reference. Update the primary table in
platform-map.md to include an OMP entry alongside the existing platforms, using
the same columns for CLI flag, main directory, skill directory, agent directory,
and hooks/extensions so the lookup map is complete.
In @.omp/skills/trellis-meta/references/platform-files/skills-and-commands.md:
- Around line 16-34: Add an OMP entry to the Common Paths table in
skills-and-commands.md so the platform discovery map includes both .omp/skills/
and .omp/commands/. Keep the row consistent with the existing platform names and
path formatting used by the other entries in the table.
In @.omp/skills/trellis-meta/SKILL.md:
- Around line 12-15: The default platform scope in the skill description is
missing the new OMP root, so update the platform directories list in SKILL.md to
explicitly include .omp/ alongside the other agent/platform roots. Keep the
wording consistent with the existing “Platform directories” section so agents
are directed to the project files introduced by this skill, and make sure the
change is reflected near the .trellis/ and .agents/skills/ references.
In @.omp/skills/trellis-spec-bootstrap/references/spec-writing.md:
- Around line 62-70: The fenced examples in the spec-writing guidance are
missing language identifiers, which triggers markdownlint MD040. Update the
affected fences in the spec-writing markdown so each example uses a language tag
such as text, and make the same change in the other referenced fenced block to
keep the lint checks clean.
In @.omp/skills/trellis-update-spec/SKILL.md:
- Around line 62-70: Both fenced examples in the SKILL.md snippet are missing
language identifiers, which triggers MD040. Update the fenced blocks in the spec
layout example to include an explicit language tag such as text on each fence,
and make the same fenced-code labeling fix in the other referenced example in
the same document.
In `@packages/cli/src/configurators/omp.ts`:
- Around line 42-45: The template collection in collectOmpTemplates() is using
raw agent.content while configureOmp()/writeAgents() rewrites agent content via
replacePythonCommandLiterals(), causing update hashes to drift. Update the
getAllAgents() loop in collectOmpTemplates() to apply the same write-time
transformation before storing each agent template, so the recorded template
matches what writeAgents() actually writes.
In
`@packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md`:
- Around line 92-100: The OMP tree fence in the platform-map documentation is
missing a language tag, which triggers markdownlint MD040. Update the fenced
block in the platform-map reference to use text so the docs lint cleanly,
keeping the existing tree content unchanged.
In `@packages/cli/src/templates/omp/extensions/trellis/index.ts.txt`:
- Around line 320-327: The session context export in the trellis bootstrap is
using the wrong platform key and can also preserve a stale value across
sessions. In the `TRELLIS_CONTEXT_ID` setup inside the OMP extension template,
switch the `buildContextKey(...)` call to use the `omp` platform so spawned
helpers resolve the correct runtime session file, and make sure the context ID
is refreshed per current session instead of only being set when the env var is
empty. Keep the change localized to the session-id derivation block that uses
`ctx.sessionManager.getSessionId()` and `buildContextKey(...)`.
In `@packages/cli/src/types/ai-tools.ts`:
- Around line 421-427: The template context is using the wrong command reference
prefix for OMP, which will produce broken slash-command cross-references in
shared templates. Update the cmdRefPrefix value in the templateContext setup to
match the existing trellis-<name> command naming used elsewhere, and keep the
change localized to the ai-tools template metadata so other fields like
executorAI and userActionLabel remain unchanged.
---
Outside diff comments:
In @.trellis/spec/cli/backend/platform-integration.md:
- Around line 807-815: The platform-count heading is stale and no longer matches
the agent-capable list after adding `omp`. Update the summary in the
platform-integration spec so the count used in the “Agent-capable platforms”
header matches the actual list, and keep the `ctx.agentCapable` rule and the
enumerated platforms in sync with the `continue`/`finish-work` table.
---
Nitpick comments:
In `@packages/cli/test/regression.test.ts`:
- Around line 4332-4338: The OMP regression test in the AI_TOOLS.omp block is
missing coverage for the command reference prefix, so it won’t fail when
cmdRefPrefix is wrong. Update the existing "[omp] Oh My Pi platform is
registered" test to assert the OMP cmdRefPrefix value alongside the other
AI_TOOLS.omp properties, using the same AI_TOOLS.omp object so this broken
template reference is caught.
In `@packages/cli/test/templates/omp.test.ts`:
- Around line 36-42: The OMP template test is using an overly generic marker
that can pass for unrelated content. Update the assertion in
getExtensionTemplate’s test to remove the broad input check or replace it with a
more specific OMP template token that uniquely identifies the extension path, so
the test only passes when the intended integration markers are present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ee105e73-336b-4611-8248-b28e8daa3846
📒 Files selected for processing (64)
.omp/agents/trellis-check.md.omp/agents/trellis-implement.md.omp/agents/trellis-research.md.omp/commands/trellis-continue.md.omp/commands/trellis-finish-work.md.omp/extensions/trellis/index.ts.omp/skills/trellis-before-dev/SKILL.md.omp/skills/trellis-brainstorm/SKILL.md.omp/skills/trellis-break-loop/SKILL.md.omp/skills/trellis-check/SKILL.md.omp/skills/trellis-meta/SKILL.md.omp/skills/trellis-meta/references/customize-local/add-project-local-conventions.md.omp/skills/trellis-meta/references/customize-local/change-agents.md.omp/skills/trellis-meta/references/customize-local/change-context-loading.md.omp/skills/trellis-meta/references/customize-local/change-hooks.md.omp/skills/trellis-meta/references/customize-local/change-skills-or-commands.md.omp/skills/trellis-meta/references/customize-local/change-spec-structure.md.omp/skills/trellis-meta/references/customize-local/change-task-lifecycle.md.omp/skills/trellis-meta/references/customize-local/change-workflow.md.omp/skills/trellis-meta/references/customize-local/overview.md.omp/skills/trellis-meta/references/local-architecture/context-injection.md.omp/skills/trellis-meta/references/local-architecture/generated-files.md.omp/skills/trellis-meta/references/local-architecture/overview.md.omp/skills/trellis-meta/references/local-architecture/spec-system.md.omp/skills/trellis-meta/references/local-architecture/task-system.md.omp/skills/trellis-meta/references/local-architecture/workflow.md.omp/skills/trellis-meta/references/local-architecture/workspace-memory.md.omp/skills/trellis-meta/references/platform-files/agents.md.omp/skills/trellis-meta/references/platform-files/hooks-and-settings.md.omp/skills/trellis-meta/references/platform-files/overview.md.omp/skills/trellis-meta/references/platform-files/platform-map.md.omp/skills/trellis-meta/references/platform-files/skills-and-commands.md.omp/skills/trellis-spec-bootstrap/SKILL.md.omp/skills/trellis-spec-bootstrap/references/mcp-setup.md.omp/skills/trellis-spec-bootstrap/references/repository-analysis.md.omp/skills/trellis-spec-bootstrap/references/spec-task-planning.md.omp/skills/trellis-spec-bootstrap/references/spec-writing.md.omp/skills/trellis-update-spec/SKILL.md.trellis/scripts/common/cli_adapter.py.trellis/scripts/common/task_store.py.trellis/spec/cli/backend/platform-integration.md.trellis/workflow.mdREADME.mdREADME_CN.mddocs-sitemarketplacepackages/cli/src/cli/index.tspackages/cli/src/commands/init.tspackages/cli/src/configurators/index.tspackages/cli/src/configurators/omp.tspackages/cli/src/configurators/shared.tspackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.mdpackages/cli/src/templates/omp/agents/trellis-check.mdpackages/cli/src/templates/omp/agents/trellis-implement.mdpackages/cli/src/templates/omp/agents/trellis-research.mdpackages/cli/src/templates/omp/extensions/trellis/index.ts.txtpackages/cli/src/templates/omp/index.tspackages/cli/src/templates/trellis/scripts/common/cli_adapter.pypackages/cli/src/templates/trellis/scripts/common/task_store.pypackages/cli/src/templates/trellis/workflow.mdpackages/cli/src/types/ai-tools.tspackages/cli/test/configurators/shared.test.tspackages/cli/test/regression.test.tspackages/cli/test/templates/omp.test.ts
| ``` | ||
| Main agent: WebFetch(url-A) → WebFetch(url-B) → Bash(gh api ...) | ||
| → WebSearch(q1) → WebSearch(q2) → ... (10+ inline calls) | ||
| → Write(research/topic.md) | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add languages to these fenced examples.
Lines 219 and 227 trigger MD040, so markdownlint-cli2 will keep warning on this file until both fences are labeled.
Suggested fix
-```
+```text
Main agent: WebFetch(url-A) → WebFetch(url-B) → Bash(gh api ...)
→ WebSearch(q1) → WebSearch(q2) → ... (10+ inline calls)
→ Write(research/topic.md)
-```
+```
-```
+```text
Main agent: Task(subagent_type="trellis-research",
prompt="Research topic A; persist to research/topic-a.md")
+ Task(subagent_type="trellis-research",
prompt="Research topic B; persist to research/topic-b.md")
+ Task(subagent_type="trellis-research",
prompt="Research topic C; persist to research/topic-c.md")
→ Reads research/topic-{a,b,c}.md after they finish.
-```
+```Also applies to: 227-235
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 219-219: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.omp/skills/trellis-brainstorm/SKILL.md around lines 219 - 223, The fenced
markdown examples in SKILL.md are unlabeled, which triggers MD040. Update both
code fences in the affected examples to include an explicit language tag, using
the fenced example blocks around the Main agent and Task snippets so
markdownlint-cli2 stops warning on this file.
Source: Linters/SAST tools
| | Platform | Path | | ||
| | --- | --- | | ||
| | Claude Code | `.claude/agents/trellis-*.md` | | ||
| | Cursor | `.cursor/agents/trellis-*.md` | | ||
| | OpenCode | `.opencode/agents/trellis-*.md` | | ||
| | Codex | `.codex/agents/trellis-*.toml` | | ||
| | Kiro | `.kiro/agents/trellis-*.json` | | ||
| | Gemini CLI | `.gemini/agents/trellis-*.md` | | ||
| | Qoder | `.qoder/agents/trellis-*.md` | | ||
| | CodeBuddy | `.codebuddy/agents/trellis-*.md` | | ||
| | Factory Droid | `.factory/droids/trellis-*.md` | | ||
| | Pi Agent | `.pi/agents/trellis-*.md` | | ||
|
|
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the OMP agent path to the table.
.omp/agents/trellis-*.md is now a supported location, but the common-paths table stops at Pi Agent. That leaves OMP customization undocumented.
♻️ Suggested patch
| Pi Agent | `.pi/agents/trellis-*.md` |
+| Oh My Pi (OMP) | `.omp/agents/trellis-*.md` |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | Platform | Path | | |
| | --- | --- | | |
| | Claude Code | `.claude/agents/trellis-*.md` | | |
| | Cursor | `.cursor/agents/trellis-*.md` | | |
| | OpenCode | `.opencode/agents/trellis-*.md` | | |
| | Codex | `.codex/agents/trellis-*.toml` | | |
| | Kiro | `.kiro/agents/trellis-*.json` | | |
| | Gemini CLI | `.gemini/agents/trellis-*.md` | | |
| | Qoder | `.qoder/agents/trellis-*.md` | | |
| | CodeBuddy | `.codebuddy/agents/trellis-*.md` | | |
| | Factory Droid | `.factory/droids/trellis-*.md` | | |
| | Pi Agent | `.pi/agents/trellis-*.md` | | |
| | Platform | Path | | |
| | --- | --- | | |
| | Claude Code | `.claude/agents/trellis-*.md` | | |
| | Cursor | `.cursor/agents/trellis-*.md` | | |
| | OpenCode | `.opencode/agents/trellis-*.md` | | |
| | Codex | `.codex/agents/trellis-*.toml` | | |
| | Kiro | `.kiro/agents/trellis-*.json` | | |
| | Gemini CLI | `.gemini/agents/trellis-*.md` | | |
| | Qoder | `.qoder/agents/trellis-*.md` | | |
| | CodeBuddy | `.codebuddy/agents/trellis-*.md` | | |
| | Factory Droid | `.factory/droids/trellis-*.md` | | |
| | Pi Agent | `.pi/agents/trellis-*.md` | | |
| | Oh My Pi (OMP) | `.omp/agents/trellis-*.md` | |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.omp/skills/trellis-meta/references/customize-local/change-agents.md around
lines 15 - 27, The common-paths table in the customization reference is missing
the OMP agent location, so update the table in the section that lists
platform-specific agent paths to include OMP with the supported path
`.omp/agents/trellis-*.md`. Keep the entry consistent with the existing platform
names and wildcard pattern so users can find the OMP customization location
alongside the other agent targets.
| ## Common Paths | ||
|
|
||
| | Platform | Agent path | | ||
| | --- | --- | | ||
| | Claude Code | `.claude/agents/trellis-*.md` | | ||
| | Cursor | `.cursor/agents/trellis-*.md` | | ||
| | OpenCode | `.opencode/agents/trellis-*.md` | | ||
| | Codex | `.codex/agents/trellis-*.toml` | | ||
| | Kiro | `.kiro/agents/trellis-*.json` | | ||
| | Gemini CLI | `.gemini/agents/trellis-*.md` | | ||
| | Qoder | `.qoder/agents/trellis-*.md` | | ||
| | CodeBuddy | `.codebuddy/agents/trellis-*.md` | | ||
| | Factory Droid | `.factory/droids/trellis-*.md` | | ||
| | Pi Agent | `.pi/agents/trellis-*.md` | | ||
|
|
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add an OMP agent-path row.
The table skips .omp/agents/trellis-*.md, so readers have no entry for the new platform’s agents.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.omp/skills/trellis-meta/references/platform-files/agents.md around lines 21
- 35, The Common Paths table is missing the OMP agent location, so update the
agent-path mapping to include an OMP row for .omp/agents/trellis-*.md alongside
the existing platform entries. Keep the change in the table under the same
section and use the existing platform names and pattern style used by the other
rows so the new platform is discoverable.
| ``` | ||
| .trellis/spec/ | ||
| ├── <layer>/ # Per-layer coding standards (e.g., backend/, frontend/, api/) | ||
| │ ├── index.md # Overview and links | ||
| │ └── *.md # Topic-specific guidelines | ||
| └── guides/ # Thinking checklists (NOT coding specs!) | ||
| ├── index.md # Guide index | ||
| └── *.md # Topic-specific guides | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Label the fenced examples so markdownlint stops flagging them.
Both fences are missing language identifiers, so MD040 will keep warning here. Add a language tag such as text to each fence.
Also applies to: 335-341
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 62-62: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.omp/skills/trellis-update-spec/SKILL.md around lines 62 - 70, Both fenced
examples in the SKILL.md snippet are missing language identifiers, which
triggers MD040. Update the fenced blocks in the spec layout example to include
an explicit language tag such as text on each fence, and make the same
fenced-code labeling fix in the other referenced example in the same document.
Source: Linters/SAST tools
| // Agents (class-1: no pull-based prelude) | ||
| for (const agent of getAllAgents()) { | ||
| files.set(`.omp/agents/${agent.name}.md`, agent.content); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Mirror the write-time rewrite in template collection.
configureOmp() writes agents through writeAgents(), which applies replacePythonCommandLiterals(), but collectOmpTemplates() stores agent.content verbatim. That makes the update hash diverge from the file that was actually written whenever the platform-specific Python command is not python3, so trellis update can report false drift.
♻️ Proposed fix
// Agents (class-1: no pull-based prelude)
for (const agent of getAllAgents()) {
- files.set(`.omp/agents/${agent.name}.md`, agent.content);
+ files.set(
+ `.omp/agents/${agent.name}.md`,
+ replacePythonCommandLiterals(agent.content),
+ );
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Agents (class-1: no pull-based prelude) | |
| for (const agent of getAllAgents()) { | |
| files.set(`.omp/agents/${agent.name}.md`, agent.content); | |
| } | |
| // Agents (class-1: no pull-based prelude) | |
| for (const agent of getAllAgents()) { | |
| files.set( | |
| `.omp/agents/${agent.name}.md`, | |
| replacePythonCommandLiterals(agent.content), | |
| ); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/cli/src/configurators/omp.ts` around lines 42 - 45, The template
collection in collectOmpTemplates() is using raw agent.content while
configureOmp()/writeAgents() rewrites agent content via
replacePythonCommandLiterals(), causing update hashes to drift. Update the
getAllAgents() loop in collectOmpTemplates() to apply the same write-time
transformation before storing each agent template, so the recorded template
matches what writeAgents() actually writes.
| ``` | ||
| .omp/ | ||
| ├── commands/ # Slash commands (flat .md) | ||
| ├── skills/ # Auto-triggered skills (SKILL.md per dir) | ||
| ├── agents/ # Agent definitions (.md) | ||
| └── extensions/ | ||
| └── trellis/ | ||
| └── index.ts # Trellis extension (context injection) | ||
| ``` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Mark the OMP tree fence as text.
The new code block is missing a language tag, which triggers markdownlint MD040 in this repo. Use text so the docs lint cleanly.
♻️ Suggested patch
-```
+```text📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ``` | |
| .omp/ | |
| ├── commands/ # Slash commands (flat .md) | |
| ├── skills/ # Auto-triggered skills (SKILL.md per dir) | |
| ├── agents/ # Agent definitions (.md) | |
| └── extensions/ | |
| └── trellis/ | |
| └── index.ts # Trellis extension (context injection) | |
| ``` |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 92-92: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md`
around lines 92 - 100, The OMP tree fence in the platform-map documentation is
missing a language tag, which triggers markdownlint MD040. Update the fenced
block in the platform-map reference to use text so the docs lint cleanly,
keeping the existing tree content unchanged.
Source: Linters/SAST tools
| templateContext: { | ||
| cmdRefPrefix: "/trellis:", | ||
| executorAI: "Bash scripts or Task calls", | ||
| userActionLabel: "Slash commands", | ||
| agentCapable: true, | ||
| hasHooks: true, | ||
| cliFlag: "omp", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Fix the OMP command reference prefix.
Line 422 sets OMP to /trellis:, but the platform is wired everywhere else as trellis-<name> slash commands. That will generate broken cross-references in shared templates for every OMP install.
Suggested fix
templateContext: {
- cmdRefPrefix: "/trellis:",
+ cmdRefPrefix: "/trellis-",
executorAI: "Bash scripts or Task calls",
userActionLabel: "Slash commands",
agentCapable: true,
hasHooks: true,
cliFlag: "omp",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| templateContext: { | |
| cmdRefPrefix: "/trellis:", | |
| executorAI: "Bash scripts or Task calls", | |
| userActionLabel: "Slash commands", | |
| agentCapable: true, | |
| hasHooks: true, | |
| cliFlag: "omp", | |
| templateContext: { | |
| cmdRefPrefix: "/trellis-", | |
| executorAI: "Bash scripts or Task calls", | |
| userActionLabel: "Slash commands", | |
| agentCapable: true, | |
| hasHooks: true, | |
| cliFlag: "omp", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/cli/src/types/ai-tools.ts` around lines 421 - 427, The template
context is using the wrong command reference prefix for OMP, which will produce
broken slash-command cross-references in shared templates. Update the
cmdRefPrefix value in the templateContext setup to match the existing
trellis-<name> command naming used elsewhere, and keep the change localized to
the ai-tools template metadata so other fields like executorAI and
userActionLabel remain unchanged.
- Add .omp/ dogfood directory with commands, skills, agents, and extension - Register OMP in AI_TOOLS registry (ai-tools.ts) with extension-backed pattern - Add --omp CLI flag and InitOptions field - Create configurator (omp.ts) with configureOmp + collectOmpTemplates - Add template module (templates/omp/) with agents and extension source - Register in PLATFORM_FUNCTIONS with collectTemplates for update tracking - Update cli_adapter.py: Platform type, detect_platform, config_dir_name, etc. - Update task_store.py: add .omp to _SUBAGENT_CONFIG_DIRS - Add 'Oh My Pi' to workflow.md platform blocks - Update README.md and README_CN.md platform lists - Add omp.test.ts (template tests) and regression.test.ts entries Extension implements session_start, before_agent_start, and input handlers with TurnContextCache (1.5s TTL) for workflow-state + task context injection. No tool_call/subagent handlers needed — OMP native task tool covers both.
…My Pi in skill lists
…ontext - session_start: invoke get_context.py (default mode) for full project map (git/spec/task/developer/journal), matching Claude hook behavior - session_start (sub-agent): inject only agent-relevant jsonl files via PI_BLOCKED_AGENT detection (implement→implement.jsonl, check→check.jsonl, research→prd+info only) - before_agent_start: simplified to workflow-state-only (lightweight per-turn) - Remove dead buildSessionOverview() that called non-existent script mode - Update omp.test.ts with new feature marker assertions
…re injection - Add context event handler as safety net for post-compaction continuations - Add session_before_compact listener to track compaction boundaries - Use reverse-scan with fast-path skip when no compaction occurred - Simplify input handler to only pre-warm cache (no message injection) - before_agent_start remains the persistent injection point
OMP commands require `description` (and optional `argument-hint`) in YAML frontmatter for the `/` command picker. The configurator was writing raw template body without wrapping. Add `wrapWithOmpFrontmatter()` to shared.ts, wire it into both `collectOmpTemplates()` and `configureOmp()`, and add unit + integration tests.
…l name (mindfold-ai#307) Two reviewer cleanups on top of the Oh My Pi platform work to ready the PR for merge review: 1. Remove personal Trellis dogfooding artifacts that crept into the diff while the platform was being developed. None of these belong in a reviewable PR — they leak the author's local workspace state into every reader's checkout: - `.trellis/workspace/VinciWu557/index.md` + `journal-1.md` - `.trellis/tasks/archive/2026-05/05-22-add-omp-platform-support-to-trellis/*` - `.trellis/tasks/archive/2026-05/05-26-omp-trellis-context-injection/*` - `.trellis/tasks/archive/2026-06/06-03-omp-configurator-missing-command-frontmatter/*` 2. Rename the dogfooded `.omp/skills/trellis-spec-bootstarp/` → `trellis-spec-bootstrap/` and fix the inner `name:` frontmatter field. This anticipates the bundled-skills source rename in mindfold-ai#296 so that once mindfold-ai#296 merges, the dogfooded `.omp/` tree matches what `trellis update --omp` regenerates. Until mindfold-ai#296 lands, `trellis init --omp` on the PR HEAD still produces the typoed name because the source template hasn't been renamed yet — that is intentional and self-corrects on the next dogfood pass after mindfold-ai#296. A `git merge origin/main` is still required before merge because main has moved on since this branch was opened (PR mindfold-ai#324 + the historical-manifest restoration in mindfold-ai#296). I left that conflict resolution to the maintainer at merge time rather than rebasing the contributor's commit history. Build / verification on the PR worktree: - `pnpm typecheck` clean - `pnpm test` 1049/1049 passing - `trellis init --omp --skip-existing -y` smoke test produces a valid `.omp/` tree
Blocker 1: revert reformatting noise in cli/index.ts, init.ts, configurators/index.ts. Rebase onto main and re-apply only the omp registration lines (7 lines net, down from ~3900 lines of 3-space reindentation noise). Blocker 2: sync docs-site for the Oh My Pi platform. - start/install-and-first-task.mdx (en + zh): add --omp flag, bump platform count 16 -> 17, add Oh My Pi row to platform config table - advanced/multi-platform.mdx (en + zh): bump platform count, add Oh My Pi to capability matrix and platform list, add Oh My Pi section (extension-backed, like Pi Agent, no settings.json) - marketplace/workflows/native/workflow.md: mirror the bundled workflow.md Oh My Pi platform markers Submodule pointers updated to the synced docs-site and marketplace commits on the feat/support-oh-my-pi branches of their forks.
- Remove unused resolveCommands import in shared.test.ts - Replace mtime-based session picking with context-key lookup - Derive TRELLIS_CONTEXT_ID from ctx.sessionManager.getSessionId() in session_start - Fall back to single-session file only when exactly one exists; refuse to guess with 2+ - Remove dead PI_SESSION_ID env check (OMP does not export it)
fad5cd6 to
9286fac
Compare
There was a problem hiding this comment.
Actionable comments posted: 6
♻️ Duplicate comments (9)
.omp/skills/trellis-brainstorm/SKILL.md (1)
219-235: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winLabel both fenced examples.
These two code blocks still trigger MD040. Add a language tag (for example
text) so the warning clears.Suggested fix
-``` +```text Main agent: WebFetch(url-A) → WebFetch(url-B) → Bash(gh api ...) → WebSearch(q1) → WebSearch(q2) → ... (10+ inline calls) → Write(research/topic.md) -``` +``` -``` +```text Main agent: Task(subagent_type="trellis-research", prompt="Research topic A; persist to research/topic-a.md") + Task(subagent_type="trellis-research", prompt="Research topic B; persist to research/topic-b.md") + Task(subagent_type="trellis-research", prompt="Research topic C; persist to research/topic-c.md") → Reads research/topic-{a,b,c}.md after they finish. -``` +```🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.omp/skills/trellis-brainstorm/SKILL.md around lines 219 - 235, The two fenced examples in the SKILL.md section are unlabeled, which triggers MD040. Update both code blocks to include a language tag such as text using the fenced examples shown in the “Good” and “Bad” snippets, so the markdown linter recognizes them; target the examples around the Main agent / Task(subagent_type="trellis-research") snippets.Source: Linters/SAST tools
.omp/skills/trellis-meta/references/platform-files/overview.md (1)
8-20: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winInclude
.omp/in the platform-file overview.The platform list and category table still omit OMP, so this overview doesn't fully cover the new platform.
🛠 Proposed fix
-Platform files**: `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.kilocode/`, `.agent/`, `.windsurf/`, and similar directories. +Platform files**: `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.kilocode/`, `.agent/`, `.windsurf/`, `.omp/`, and similar directories.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.omp/skills/trellis-meta/references/platform-files/overview.md around lines 8 - 20, The platform-file overview is missing OMP from both the top-level platform list and the category table, so update the overview to explicitly include .omp/ alongside the other supported tool directories. Make sure the platform-file summary and the category mapping stay consistent by adding the OMP-specific path(s) in the appropriate row(s), using the existing overview structure as the guide..omp/skills/trellis-meta/references/platform-files/skills-and-commands.md (1)
18-33: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winDocument the OMP skill and command paths.
The Common Paths table still omits
.omp/skills/and.omp/commands/, so discovery for OMP is incomplete.🛠 Proposed fix
| Factory Droid | `.factory/skills/`, `.factory/commands/` | | Pi Agent | `.pi/skills/` | +| Oh My Pi (OMP) | `.omp/skills/`, `.omp/commands/`, `.omp/extensions/trellis/` |🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.omp/skills/trellis-meta/references/platform-files/skills-and-commands.md around lines 18 - 33, The Common Paths table is missing OMP’s skill and command locations, so update the entries in the skills-and-commands documentation to include `.omp/skills/` and `.omp/commands/` alongside the other platform mappings. Keep the change confined to the Common entries table in this document and make sure the OMP row/entries are listed consistently with the existing platform symbols like Claude Code, Cursor, and OpenCode..omp/skills/trellis-meta/references/platform-files/platform-map.md (2)
80-88: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winLabel the
.omp/layout fence.markdownlint is still flagging this block as an unlabeled fence; add
textto keep the docs lint-clean.🛠 Proposed fix
-``` +```text .omp/ ├── commands/ # Slash commands (flat .md) ├── skills/ # Auto-triggered skills (SKILL.md per dir) ├── agents/ # Agent definitions (.md) └── extensions/ @@ -``` +```text🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.omp/skills/trellis-meta/references/platform-files/platform-map.md around lines 80 - 88, The fenced code block in platform-map.md is unlabeled and markdownlint is flagging it; update the `.omp/` layout example so the fence uses a text label. Locate the block by the `.omp/` directory tree content in the platform map docs and change the opening and closing fence markers consistently so the Markdown stays lint-clean.Source: Linters/SAST tools
7-22: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd OMP to the main platform matrix.
The primary table still stops at Pi Agent, so
.omp/is only mentioned later and the lookup map is incomplete.🛠 Proposed fix
| Factory Droid | `--droid` | `.factory/` | `.factory/skills/` | `.factory/droids/` | `.factory/hooks/` + settings | | Pi Agent | `--pi` | `.pi/` | `.pi/skills/` | `.pi/agents/` | `.pi/extensions/trellis/` + `.pi/settings.json` | +| Oh My Pi (OMP) | `--omp` | `.omp/` | `.omp/skills/` | `.omp/agents/` | `.omp/extensions/trellis/` |🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.omp/skills/trellis-meta/references/platform-files/platform-map.md around lines 7 - 22, The platform lookup matrix is missing the OMP entry, so the main table in platform-map.md is incomplete. Add OMP to the table alongside the other platforms using the correct CLI flag and directories, keeping the existing naming and column structure consistent with the symbols already present in the matrix. Make sure the new row is placed in the main platform list rather than only being referenced elsewhere..omp/skills/trellis-meta/references/platform-files/agents.md (1)
23-34: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd the OMP agent-path row.
The Common Paths table still omits
.omp/agents/trellis-*.md, so OMP agents aren't discoverable from this reference.🛠 Proposed fix
| Pi Agent | `.pi/agents/trellis-*.md` | +| Oh My Pi (OMP) | `.omp/agents/trellis-*.md` |🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.omp/skills/trellis-meta/references/platform-files/agents.md around lines 23 - 34, The Common Paths table in agents.md is missing the OMP entry, so add a new row for OMP pointing to .omp/agents/trellis-*.md. Update the platform mapping alongside the existing Claude Code, Cursor, OpenCode, and Codex rows so the reference includes OMP agent discoverability.packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md (1)
94-102: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winTag the OMP tree fence as
text.This fenced block still trips MD040, and the same lint issue was already called out previously.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md` around lines 94 - 102, The OMP directory tree fence in the platform-map markdown is missing a language tag and is still triggering MD040. Update the fenced block in the platform-files platform-map content so the tree diagram is explicitly tagged as text, keeping the existing structure but changing the fence used for the .omp/ example.Source: Linters/SAST tools
packages/cli/src/templates/omp/extensions/trellis/index.ts.txt (1)
323-327: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRefresh the session key on every start.
TRELLIS_CONTEXT_IDcan stay stale across sessions, and the key is still built withpiinstead ofomp, so active-task resolution can land on the wrong runtime session file.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/templates/omp/extensions/trellis/index.ts.txt` around lines 323 - 327, Update the TRELLIS_CONTEXT_ID initialization in the trellis extension startup flow so it is refreshed on every start instead of only when missing, and switch the context key prefix from pi to omp in the session-based path. Use the existing session lookup via ctx.sessionManager.getSessionId and the buildContextKey helper, but ensure the value is always rebuilt for the current session so active-task resolution points to the correct runtime session file..omp/skills/trellis-update-spec/SKILL.md (1)
62-70: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winMark both fences as
text.These code blocks still trigger MD040, and the same lint issue was already called out in the prior review.
Also applies to: 335-341
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.omp/skills/trellis-update-spec/SKILL.md around lines 62 - 70, The fenced diagram blocks in SKILL.md are still being treated as code, which triggers MD040; update both fence openings and closings in the trellis-spec structure example to use a text fence so they render as plain documentation. Make the same change in the other referenced diagram block as well, keeping the content and indentation the same while ensuring the fences are marked as text.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.omp/extensions/trellis/index.ts:
- Around line 323-327: Avoid writing the session-derived TRELLIS_CONTEXT_ID into
process.env in the trellis extension; that process-global value can be reused
across sessions and leak the wrong runtime context. Update the logic in the
trellis index flow that uses buildContextKey and ctx.sessionManager.getSessionId
so the computed context key is kept in extension-local state and passed
explicitly to the code that needs it, rather than persisted on process.env.
- Around line 192-198: The task-context file loading in the trellis index parser
trusts row.file too directly and can read paths outside the project root. Update
the logic around the JSONL processing and readFileSync(join(projectRoot, file))
flow to resolve the candidate path first, verify it stays under projectRoot, and
skip any escaping entries before adding them to fileChunks. Use the existing
row.file, fileChunks, and projectRoot handling in index.ts as the place to apply
the guard.
In @.omp/skills/trellis-break-loop/SKILL.md:
- Around line 126-128: The generated skill still instructs users to sync
templates into the Trellis source-tree path, which is not valid in end-user
projects. Update the step in the skill document to remove the reference to
src/templates/markdown/spec/ and instead keep the workflow focused on the
project-local .trellis/spec/ updates, using the existing Sync templates step
wording in the skill as the place to adjust.
In
@.omp/skills/trellis-meta/references/customize-local/change-skills-or-commands.md:
- Line 3: Update the OMP entry-point documentation in the customize-local
guidance so it explicitly points users to the platform locations for
customizations: .omp/skills/, .omp/commands/, and
.omp/extensions/trellis/index.ts. Make sure the section that mentions
auto-trigger rules and explicit command behavior names the relevant entry points
and explains that these are the places to edit for this platform, rather than
only referring generically to local platform directories.
In @.omp/skills/trellis-meta/references/platform-files/hooks-and-settings.md:
- Line 10: Update the workflow-state hook description so it matches the actual
runtime behavior of the hook. In the hooks-and-settings.md entry for
workflow-state, revise the sentence currently describing it as parser-only in
the workflow-state section to also mention the generic fallback emitted when no
matching status block is found. Keep the wording aligned with the hook’s
observed output and reference the workflow-state hook and .trellis/workflow.md
description.
In @.trellis/spec/cli/backend/platform-integration.md:
- Line 821: The capability matrix header count is out of sync with the updated
`agentCapable && hasHooks` platform list, which now includes `omp`. Update the
count in the surrounding matrix header or label so it matches the 11 entries
shown in the list, and keep the `agentCapable && hasHooks` section in
`platform-integration.md` consistent.
---
Duplicate comments:
In @.omp/skills/trellis-brainstorm/SKILL.md:
- Around line 219-235: The two fenced examples in the SKILL.md section are
unlabeled, which triggers MD040. Update both code blocks to include a language
tag such as text using the fenced examples shown in the “Good” and “Bad”
snippets, so the markdown linter recognizes them; target the examples around the
Main agent / Task(subagent_type="trellis-research") snippets.
In @.omp/skills/trellis-meta/references/platform-files/agents.md:
- Around line 23-34: The Common Paths table in agents.md is missing the OMP
entry, so add a new row for OMP pointing to .omp/agents/trellis-*.md. Update the
platform mapping alongside the existing Claude Code, Cursor, OpenCode, and Codex
rows so the reference includes OMP agent discoverability.
In @.omp/skills/trellis-meta/references/platform-files/overview.md:
- Around line 8-20: The platform-file overview is missing OMP from both the
top-level platform list and the category table, so update the overview to
explicitly include .omp/ alongside the other supported tool directories. Make
sure the platform-file summary and the category mapping stay consistent by
adding the OMP-specific path(s) in the appropriate row(s), using the existing
overview structure as the guide.
In @.omp/skills/trellis-meta/references/platform-files/platform-map.md:
- Around line 80-88: The fenced code block in platform-map.md is unlabeled and
markdownlint is flagging it; update the `.omp/` layout example so the fence uses
a text label. Locate the block by the `.omp/` directory tree content in the
platform map docs and change the opening and closing fence markers consistently
so the Markdown stays lint-clean.
- Around line 7-22: The platform lookup matrix is missing the OMP entry, so the
main table in platform-map.md is incomplete. Add OMP to the table alongside the
other platforms using the correct CLI flag and directories, keeping the existing
naming and column structure consistent with the symbols already present in the
matrix. Make sure the new row is placed in the main platform list rather than
only being referenced elsewhere.
In @.omp/skills/trellis-meta/references/platform-files/skills-and-commands.md:
- Around line 18-33: The Common Paths table is missing OMP’s skill and command
locations, so update the entries in the skills-and-commands documentation to
include `.omp/skills/` and `.omp/commands/` alongside the other platform
mappings. Keep the change confined to the Common entries table in this document
and make sure the OMP row/entries are listed consistently with the existing
platform symbols like Claude Code, Cursor, and OpenCode.
In @.omp/skills/trellis-update-spec/SKILL.md:
- Around line 62-70: The fenced diagram blocks in SKILL.md are still being
treated as code, which triggers MD040; update both fence openings and closings
in the trellis-spec structure example to use a text fence so they render as
plain documentation. Make the same change in the other referenced diagram block
as well, keeping the content and indentation the same while ensuring the fences
are marked as text.
In
`@packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md`:
- Around line 94-102: The OMP directory tree fence in the platform-map markdown
is missing a language tag and is still triggering MD040. Update the fenced block
in the platform-files platform-map content so the tree diagram is explicitly
tagged as text, keeping the existing structure but changing the fence used for
the .omp/ example.
In `@packages/cli/src/templates/omp/extensions/trellis/index.ts.txt`:
- Around line 323-327: Update the TRELLIS_CONTEXT_ID initialization in the
trellis extension startup flow so it is refreshed on every start instead of only
when missing, and switch the context key prefix from pi to omp in the
session-based path. Use the existing session lookup via
ctx.sessionManager.getSessionId and the buildContextKey helper, but ensure the
value is always rebuilt for the current session so active-task resolution points
to the correct runtime session file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6ebedb19-5873-431d-9be2-7a7e0c832609
📒 Files selected for processing (66)
.omp/agents/trellis-check.md.omp/agents/trellis-implement.md.omp/agents/trellis-research.md.omp/commands/trellis-continue.md.omp/commands/trellis-finish-work.md.omp/extensions/trellis/index.ts.omp/skills/trellis-before-dev/SKILL.md.omp/skills/trellis-brainstorm/SKILL.md.omp/skills/trellis-break-loop/SKILL.md.omp/skills/trellis-check/SKILL.md.omp/skills/trellis-meta/SKILL.md.omp/skills/trellis-meta/references/customize-local/add-project-local-conventions.md.omp/skills/trellis-meta/references/customize-local/change-agents.md.omp/skills/trellis-meta/references/customize-local/change-context-loading.md.omp/skills/trellis-meta/references/customize-local/change-hooks.md.omp/skills/trellis-meta/references/customize-local/change-skills-or-commands.md.omp/skills/trellis-meta/references/customize-local/change-spec-structure.md.omp/skills/trellis-meta/references/customize-local/change-task-lifecycle.md.omp/skills/trellis-meta/references/customize-local/change-workflow.md.omp/skills/trellis-meta/references/customize-local/overview.md.omp/skills/trellis-meta/references/local-architecture/context-injection.md.omp/skills/trellis-meta/references/local-architecture/generated-files.md.omp/skills/trellis-meta/references/local-architecture/overview.md.omp/skills/trellis-meta/references/local-architecture/spec-system.md.omp/skills/trellis-meta/references/local-architecture/task-system.md.omp/skills/trellis-meta/references/local-architecture/workflow.md.omp/skills/trellis-meta/references/local-architecture/workspace-memory.md.omp/skills/trellis-meta/references/platform-files/agents.md.omp/skills/trellis-meta/references/platform-files/hooks-and-settings.md.omp/skills/trellis-meta/references/platform-files/overview.md.omp/skills/trellis-meta/references/platform-files/platform-map.md.omp/skills/trellis-meta/references/platform-files/skills-and-commands.md.omp/skills/trellis-spec-bootstrap/SKILL.md.omp/skills/trellis-spec-bootstrap/references/mcp-setup.md.omp/skills/trellis-spec-bootstrap/references/repository-analysis.md.omp/skills/trellis-spec-bootstrap/references/spec-task-planning.md.omp/skills/trellis-spec-bootstrap/references/spec-writing.md.omp/skills/trellis-update-spec/SKILL.md.trellis/scripts/common/cli_adapter.py.trellis/scripts/common/task_store.py.trellis/spec/cli/backend/platform-integration.md.trellis/workflow.mdREADME.mdREADME_CN.mddocs-sitemarketplacepackages/cli/src/cli/index.tspackages/cli/src/commands/init.tspackages/cli/src/configurators/index.tspackages/cli/src/configurators/omp.tspackages/cli/src/configurators/shared.tspackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.mdpackages/cli/src/templates/omp/agents/trellis-check.mdpackages/cli/src/templates/omp/agents/trellis-implement.mdpackages/cli/src/templates/omp/agents/trellis-research.mdpackages/cli/src/templates/omp/extensions/trellis/index.ts.txtpackages/cli/src/templates/omp/index.tspackages/cli/src/templates/trellis/scripts/common/cli_adapter.pypackages/cli/src/templates/trellis/scripts/common/task_store.pypackages/cli/src/templates/trellis/workflow.mdpackages/cli/src/types/ai-tools.tspackages/cli/test/commands/update.integration.test.tspackages/cli/test/configurators/shared.test.tspackages/cli/test/regression.test.tspackages/cli/test/templates/omp.test.tspackages/cli/test/templates/trellis.test.ts
✅ Files skipped from review due to trivial changes (19)
- docs-site
- .omp/commands/trellis-continue.md
- README.md
- .omp/skills/trellis-meta/references/customize-local/add-project-local-conventions.md
- .omp/skills/trellis-meta/references/customize-local/change-context-loading.md
- .omp/skills/trellis-meta/references/local-architecture/task-system.md
- README_CN.md
- .omp/skills/trellis-meta/references/customize-local/change-spec-structure.md
- .omp/skills/trellis-check/SKILL.md
- .omp/agents/trellis-check.md
- .omp/skills/trellis-meta/references/customize-local/change-agents.md
- .omp/skills/trellis-before-dev/SKILL.md
- .omp/skills/trellis-meta/references/local-architecture/context-injection.md
- .omp/skills/trellis-spec-bootstrap/references/repository-analysis.md
- .omp/skills/trellis-spec-bootstrap/references/spec-writing.md
- .omp/agents/trellis-implement.md
- packages/cli/src/templates/omp/agents/trellis-implement.md
- .omp/skills/trellis-meta/references/local-architecture/workflow.md
- .omp/skills/trellis-meta/references/customize-local/change-hooks.md
🚧 Files skipped from review as they are similar to previous changes (18)
- packages/cli/src/templates/omp/index.ts
- packages/cli/src/configurators/index.ts
- packages/cli/src/templates/omp/agents/trellis-research.md
- packages/cli/src/configurators/omp.ts
- packages/cli/src/cli/index.ts
- packages/cli/src/templates/omp/agents/trellis-check.md
- .omp/skills/trellis-spec-bootstrap/references/mcp-setup.md
- packages/cli/test/templates/omp.test.ts
- packages/cli/src/templates/trellis/scripts/common/task_store.py
- .trellis/scripts/common/task_store.py
- .omp/commands/trellis-finish-work.md
- .trellis/scripts/common/cli_adapter.py
- packages/cli/src/types/ai-tools.ts
- packages/cli/src/templates/trellis/scripts/common/cli_adapter.py
- packages/cli/test/configurators/shared.test.ts
- .omp/agents/trellis-research.md
- packages/cli/src/configurators/shared.ts
- .trellis/workflow.md
| 2. **Sync templates** - After updating `.trellis/spec/`, sync to `src/templates/markdown/spec/` | ||
|
|
||
| 3. **Commit the spec updates** - This is the primary output, not just the analysis text |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Remove the source-repo template sync step from this generated skill.
This skill is emitted into end-user projects, but Line 126 sends the agent to src/templates/markdown/spec/, which is a Trellis source-tree path. In a normal trellis init workspace that path does not exist, so the workflow points the agent at the wrong target.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.omp/skills/trellis-break-loop/SKILL.md around lines 126 - 128, The
generated skill still instructs users to sync templates into the Trellis
source-tree path, which is not valid in end-user projects. Update the step in
the skill document to remove the reference to src/templates/markdown/spec/ and
instead keep the workflow focused on the project-local .trellis/spec/ updates,
using the existing Sync templates step wording in the skill as the place to
adjust.
| @@ -0,0 +1,78 @@ | |||
| # Change Local Skills, Commands, Prompts, And Workflows | |||
|
|
|||
| When the user wants to change AI entry points, auto-trigger rules, or explicit command behavior, edit skills, commands, prompts, or workflows in local platform directories. | |||
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Document the OMP entry points here.
This page says it covers auto-trigger rules, but it never points OMP users to .omp/skills/, .omp/commands/, or .omp/extensions/trellis/index.ts, where those customizations actually live for this platform.
Also applies to: 54-61
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
@.omp/skills/trellis-meta/references/customize-local/change-skills-or-commands.md
at line 3, Update the OMP entry-point documentation in the customize-local
guidance so it explicitly points users to the platform locations for
customizations: .omp/skills/, .omp/commands/, and
.omp/extensions/trellis/index.ts. Make sure the section that mentions
auto-trigger rules and explicit command behavior names the relevant entry points
and explains that these are the places to edit for this platform, rather than
only referring generically to local platform directories.
| settings/config files usually register: | ||
|
|
||
| - session-start hook: injects a Trellis overview when a new session starts or context resets. | ||
| - workflow-state hook: parses `[workflow-state:STATUS]` blocks from `.trellis/workflow.md` and emits the body matching the current task `status` on each user input. Parser-only; the script does not embed fallback content. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Match the workflow-state description to runtime behavior.
The hook is not parser-only: when no matching block exists, it now emits the generic Refer to workflow.md for current step. fallback. Please update this sentence so the docs match the actual hook output.
🛠 Suggested wording update
-- workflow-state hook: parses `[workflow-state:STATUS]` blocks from `.trellis/workflow.md` and emits the body matching the current task `status` on each user input. Parser-only; the script does not embed fallback content.
++ workflow-state hook: parses `[workflow-state:STATUS]` blocks from `.trellis/workflow.md` and emits the body matching the current task `status` on each user input, falling back to `Refer to workflow.md for current step.` when no matching block exists.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - workflow-state hook: parses `[workflow-state:STATUS]` blocks from `.trellis/workflow.md` and emits the body matching the current task `status` on each user input. Parser-only; the script does not embed fallback content. | |
| workflow-state hook: parses `[workflow-state:STATUS]` blocks from `.trellis/workflow.md` and emits the body matching the current task `status` on each user input, falling back to `Refer to workflow.md for current step.` when no matching block exists. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.omp/skills/trellis-meta/references/platform-files/hooks-and-settings.md at
line 10, Update the workflow-state hook description so it matches the actual
runtime behavior of the hook. In the hooks-and-settings.md entry for
workflow-state, revise the sentence currently describing it as parser-only in
the workflow-state section to also mention the generic fallback emitted when no
matching status block is found. Keep the wording aligned with the hook’s
observed output and reference the workflow-state hook and .trellis/workflow.md
description.
| **Rule**: filter is by `ctx.agentCapable && ctx.hasHooks` — **both flags required** (changed in 0.6.4; the prior single-flag rule silently dropped `start` from Codex / ZCode / OpenCode / Reasonix). `agentCapable` alone is not a proxy for "has a session-start mechanism" because four agent-capable platforms ship without a SessionStart-equivalent hook and rely on user-invocable `start` instead. | ||
|
|
||
| - `agentCapable && hasHooks`: `claude-code, cursor, kiro, gemini, qoder, codebuddy, copilot, droid, pi, trae` | ||
| - `agentCapable && hasHooks`: `claude-code, cursor, kiro, gemini, qoder, codebuddy, copilot, droid, pi, trae, omp` |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the platform count.
Adding omp makes this list 11 entries, but the header still says 10. Please keep the count in sync so the capability matrix doesn't drift.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.trellis/spec/cli/backend/platform-integration.md at line 821, The
capability matrix header count is out of sync with the updated `agentCapable &&
hasHooks` platform list, which now includes `omp`. Update the count in the
surrounding matrix header or label so it matches the 11 entries shown in the
list, and keep the `agentCapable && hasHooks` section in
`platform-integration.md` consistent.
|
这版先别合。我本地用 #307 的原始 extension 代码做了最小 harness,发现三个阻塞问题。
把模板源码机械复制成 触发点是加载期直接调用: export default function(pi: ExtensionAPI): void {
pi.setLabel("Trellis");
当前代码: const file = typeof row.file === "string" ? row.file.trim() : "";
try { content = readFileSync(join(projectRoot, file), "utf-8"); } catch { }我在临时工程里让
当前代码只在 env 为空时写入: if (!process.env.TRELLIS_CONTEXT_ID) {
const sessionId = ctx.sessionManager.getSessionId?.();
process.env.TRELLIS_CONTEXT_ID = buildContextKey("pi", "session", sessionId);
}同进程里连续触发 {
"envAfterA": "pi_sess-A",
"envAfterB": "pi_sess-A",
"sentContainsTaskB": false
}第二个 session 继续使用第一个 session 的 task context。这里不能用进程级 env 作为当前 session 的唯一状态;至少要按当前 sessionId 重新计算本轮 context key,并避免把旧 session key 留给后续 handler。 另外,这个 PR 也和 #368 有同类问题:每轮 workflow state 仍然通过 |
…blockers # Conflicts: # .trellis/spec/cli/backend/platform-integration.md # docs-site # packages/cli/src/templates/trellis/scripts/common/task_store.py # packages/cli/src/types/ai-tools.ts # packages/cli/test/commands/update.integration.test.ts
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.omp/extensions/trellis/index.ts (1)
75-107: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winSession resolution still guesses when contextKey is known but unmatched.
When
contextKeyis truthy but nosessionsDir/<contextKey>.jsonexists yet (e.g. this session's file hasn't been written, or was cleaned up), the code falls through to the "exactly one file" fallback instead of returningno_task. If a different, concurrently-running session already has exactly one session file on disk, this session will silently borrow that other session'scurrent_task/taskDir— the same cross-session mixing this fix was meant to eliminate (per PR discussion: "avoiding guesses when multiple session files exist"). The fallback should only apply when identity is genuinely unknown (contextKey === null), not when it's known but simply unresolved.🔒 Proposed fix: don't fall back when identity is known
let sessionFilePath: string | null = null; if (contextKey) { - // 有身份标识:直接定位文件 - const candidate = join(sessionsDir, `${contextKey}.json`); - if (existsSync(candidate)) { - sessionFilePath = candidate; - } - } - - if (!sessionFilePath) { - // 单 session fallback:恰好 1 个文件时使用,否则拒绝猜测 + // 有身份标识:直接定位文件,未命中则视为无任务,不猜测 + const candidate = join(sessionsDir, `${contextKey}.json`); + if (existsSync(candidate)) { + sessionFilePath = candidate; + } else { + return { status: "no_task", taskDir: null, taskTitle: null }; + } + } else { + // 无身份标识:单 session fallback,恰好 1 个文件时使用,否则拒绝猜测 let sessionFiles: string[]; try { sessionFiles = readdirSync(sessionsDir).filter((f) => f.endsWith(".json")); } catch { return { status: "no_task", taskDir: null, taskTitle: null }; } if (sessionFiles.length === 1) { sessionFilePath = join(sessionsDir, sessionFiles[0]); } else { - // 0 或 ≥2 个文件且无身份标识:返回 no_task,不跨会话猜测 return { status: "no_task", taskDir: null, taskTitle: null }; } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.omp/extensions/trellis/index.ts around lines 75 - 107, In resolveActiveTaskStatus, the fallback to the single-session file should not run when contextKey is present but its exact session file is missing. Update the control flow so that a truthy contextKey only resolves via the matching <contextKey>.json candidate and otherwise returns no_task immediately, while the one-file fallback is used only when contextKey is null.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.omp/extensions/trellis/index.ts:
- Around line 342-346: rememberContextKey currently falls back to
currentContextKey when deriveContextKey(ctx) returns nothing, which can leak the
previous hook’s session identity. Update rememberContextKey in trellis index.ts
so it only updates and returns a key when deriveContextKey(ctx) resolves one,
and otherwise returns null instead of reusing currentContextKey. Keep the
behavior aligned with deriveContextKey and the TRELLIS_CONTEXT_ID assignment
path so later hook invocations without identity do not inherit stale context.
---
Outside diff comments:
In @.omp/extensions/trellis/index.ts:
- Around line 75-107: In resolveActiveTaskStatus, the fallback to the
single-session file should not run when contextKey is present but its exact
session file is missing. Update the control flow so that a truthy contextKey
only resolves via the matching <contextKey>.json candidate and otherwise returns
no_task immediately, while the one-file fallback is used only when contextKey is
null.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 73b0ae5a-b23d-4628-97f5-06d1c437c429
📒 Files selected for processing (13)
.omp/extensions/trellis/index.ts.trellis/scripts/common/task_store.py.trellis/spec/cli/backend/platform-integration.mdREADME_CN.mddocs-sitepackages/cli/src/configurators/index.tspackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.mdpackages/cli/src/templates/omp/extensions/trellis/index.ts.txtpackages/cli/src/templates/trellis/scripts/common/task_store.pypackages/cli/src/types/ai-tools.tspackages/cli/test/commands/update.integration.test.tspackages/cli/test/regression.test.tspackages/cli/test/templates/omp.test.ts
💤 Files with no reviewable changes (1)
- .trellis/spec/cli/backend/platform-integration.md
✅ Files skipped from review due to trivial changes (3)
- docs-site
- README_CN.md
- packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md
🚧 Files skipped from review as they are similar to previous changes (6)
- .trellis/scripts/common/task_store.py
- packages/cli/src/templates/trellis/scripts/common/task_store.py
- packages/cli/test/templates/omp.test.ts
- packages/cli/src/configurators/index.ts
- packages/cli/src/types/ai-tools.ts
- packages/cli/src/templates/omp/extensions/trellis/index.ts.txt
概述
为 Trellis 新增 Oh My Pi (omp) 平台支持。Oh My Pi 是一个 AI 编码助手,本次改动使其能够通过
trellis init安装 Trellis 工作流文件。改动内容
新增 Oh My Pi 平台目录
.omp/agents/— trellis-check、trellis-implement、trellis-research 子代理commands/— trellis-continue、trellis-finish-work 命令skills/— trellis-before-dev、trellis-brainstorm、trellis-check、trellis-meta、trellis-update-spec 等技能extensions/trellis/index.ts— 平台扩展入口新增配置器
packages/cli/src/configurators/omp.tscollectOmpTemplates()和configureOmp(),处理 agents、commands、skills、extension 的生成新增模板
packages/cli/src/templates/omp/agents/— 三个子代理模板extensions/trellis/index.ts.txt— 扩展模板index.ts— 模板导出源码改动
packages/cli/src/types/ai-tools.ts— 新增omp平台定义packages/cli/src/cli/index.ts— 注册 omp 配置器packages/cli/src/commands/init.ts— 同上packages/cli/src/configurators/index.ts— 导出 omp 配置器现有模板更新(添加 Oh My Pi 到支持平台列表)
packages/cli/src/templates/trellis/workflow.mdpackages/cli/src/templates/trellis/scripts/common/cli_adapter.pypackages/cli/src/templates/trellis/scripts/common/task_store.py测试
packages/cli/test/templates/omp.test.tspackages/cli/test/regression.test.ts验证
pnpm lint通过(0 errors)pnpm typecheck通过(0 errors)trellis init --omp可正常生成.omp/目录Summary by CodeRabbit
trellis init --ompnow generates OMP assets (commands, skills, agents) including OMP-aware continue and finish-work instructions.