[luv-336] fix: route OpenCode project pages by encoded cwd; drop ## Unreleased from changelog#335
[luv-336] fix: route OpenCode project pages by encoded cwd; drop ## Unreleased from changelog#335NiveditJain merged 4 commits intomainfrom
## Unreleased from changelog#335Conversation
Align `ProjectFolder.name` for OpenCode projects with the URL-slug encoding every other CLI uses (`encodeFolderName(worktree)`), replacing the prior `proj.name`/`basename(worktree)` fallback. Fixes a 404 on the project page for OpenCode-only sessions (e.g. /project/dev-purge → 404) while session URLs already worked via `encodeCwdForUrl(cwd)`. As a side benefit, OpenCode projects now merge with their Claude/Codex/Copilot/ Cursor/Pi/Gemini siblings into one row in `mergeProjectFolders`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughExports for OpenCode projects now compute folder ChangesOpenCode Folder-Name Encoding Standardization
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@CHANGELOG.md`:
- Line 6: The changelog entry on line 6 is overly detailed; replace the long
paragraph with a single concise one-line bullet that summarizes the change and
references the PR (e.g., "Align OpenCode project folder naming with CLI URL
encoding to fix project links and merging (`#336`)"), and move the implementation
details (references to lib/opencode-projects.ts ProjectFolder.name,
encodeFolderName(worktree), getOpenCodeSessionsByEncodedName,
mergeProjectFolders, decodeFolderName(folder.name), and related test updates in
__tests__/lib/opencode-projects.test.ts) into the PR description or commit
message instead of the CHANGELOG.md.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d25c167e-5db4-4fd0-be9b-7f102bc732f3
📒 Files selected for processing (3)
CHANGELOG.md__tests__/lib/opencode-projects.test.tslib/opencode-projects.ts
Switches the changelog convention so every feature PR's entry lands
directly under a versioned `## <version> — <YYYY-MM-DD>` section
(matching package.json's current version + today's date). The `##
Unreleased` heading is gone — feature PRs already ship release-ready,
so a separate cut PR is no longer required for the changelog rename.
- `.failproofai/policies/workflow-policies.mjs`:
- new `release-prep-check` policy fires on `gh pr create` and
instructs the agent to put entries under a dated versioned heading,
creating that heading above the previous version's section if needed
- `changelog-check` updated to drop the `## Unreleased` reference
- `CHANGELOG.md`: drop the empty `## Unreleased` heading; this PR's
entry now sits directly under `## 0.0.10-beta.10 — 2026-05-09`
- `CLAUDE.md`: update the Changelog section to describe the new
no-`Unreleased` flow
Version bumps in `package.json` remain reserved for `luv-cut-*` PRs by
the existing `block-version-bumps` policy.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
## Unreleased from changelog
The `release-prep-check`, `changelog-check`, `docs-check`, and `pr-description-check` policies used unanchored regexes against the Bash command string, so the literal phrases (`gh pr create`, `git commit`, `git push`) matched anywhere — including inside HEREDOC bodies or quoted arguments. Concrete failure: editing a PR body that contained the words "gh pr create" inside backticks fired the new `release-prep-check` policy on the `gh pr edit` invocation. Extracts a shared `matchesCommand(cmd, verbPattern)` helper that anchors the verb-phrase match to a command boundary (`^`, `;`, `&&`, `||`, `|`, or newline). All four policies route through it. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Per CLAUDE.md:425-435 the changelog convention is one short line per entry with the PR number; the prior verbose paragraph form has been trimmed to match. Implementation detail lives in commit messages and the PR description. CodeRabbit flagged the previous verbosity on PR #335. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Fix the OpenCode project-page 404
lib/opencode-projects.ts: setProjectFolder.nametoencodeFolderName(worktree)(matches every other CLI's URL-slug encoding) instead ofproj.name/basename(worktree). Fixes a 404 on the project detail page for OpenCode-only sessions — e.g./home/nivedit/dev-purgewas being linked as/project/dev-purge, but the route resolvergetOpenCodeSessionsByEncodedNamematches viaencodeFolderName(p.worktree) === nameand so expected/project/-home-nivedit-dev-purge(which is the form that already worked for session URLs built viaencodeCwdForUrl(cwd)inapp/policies/hooks-client.tsx).mergeProjectFolderskeys byf.name, so an OpenCode project sharing a cwd with Claude/Codex/Copilot/Cursor/Pi/Gemini now collapses into a single Projects-page row with multiple CLI badges instead of appearing as two rows.decodeFolderName(folder.name)in the Projects list now renders the full path (/home/nivedit/dev-purge) instead ofdev/purge, consistent with every other CLI.Drop
## Unreleased— every feature PR ships release-ready.failproofai/policies/workflow-policies.mjs:release-prep-checkpolicy fires ongh pr createand instructs the agent to ensure CHANGELOG entries land under a versioned## <version> — <YYYY-MM-DD>heading (creating that heading above the previous version's section if needed)changelog-checkupdated to drop the## Unreleasedreferencechangelog-check,docs-check,pr-description-check,release-prep-check) now route their verb-phrase match through a sharedmatchesCommandhelper that anchors to command boundaries (^,;,&&,||,|, newline) so the literal phrases no longer false-positive when they appear inside HEREDOC bodies or quoted arguments (concrete repro:gh pr edit --body "...gh pr create..."previously firedrelease-prep-check)CHANGELOG.md: drop the empty## Unreleasedheading; this PR's entry sits directly under## 0.0.10-beta.10 — 2026-05-09CLAUDE.md: update the Changelog section to describe the new no-Unreleasedflowpackage.jsonremain reserved forluv-cut-*PRs by the existingblock-version-bumpspolicyTest plan
bun run test:run— 1573/1573 unit tests pass (3 assertions in__tests__/lib/opencode-projects.test.tsupdated to pin the encoded form-repo/-other)bun run lint— cleanbun x tsc --noEmit— cleanbun run build— cleanrelease-prep-checkfires correctly on realgh pr createand no longer false-positives ongh pr editwith backticked phrases in the body (verified live)/projectsin the dashboard, click an OpenCode-only project — should land on/project/<encoded-cwd>(no 404) and list its OpenCode sessions🤖 Generated with Claude Code
Summary by CodeRabbit