Move the /allow-everything endpoint from the shared permission routes
into packages/opencode/src/kilocode/permission/routes.ts to reduce diff
with upstream and ease future merges.
The kilocode_change annotation CI check (introduced in #8531) only
recognized // style comments. TSX files require {/* */} syntax inside
JSX templates, causing false failures for any PR adding Kilo-specific
JSX in packages/opencode/ — specifically reported in #6966.
Covers:
- MARKER_PREFIX regex matching both // and {/* */} styles
- Updated all 5 regex locations (whole-file, block-start/end, inline, self-exclusion)
- JSX/TSX examples in error output and AGENTS.md
- Test suite in packages/script/tests/ (98 tests across 6 describe blocks)
Test results: 98 pass, 0 fail, 107 expect() calls
The annotation check script only recognized // style comments but TSX
files require {/* */} syntax inside JSX templates. This caused false
failures for PRs adding JSX-annotated markers in packages/opencode/.
When a worktree was deleted, its sessions had worktreeId set to null but
were never removed from agent-manager.json. These orphaned sessions were
invisible in the UI and could never be reassigned, causing the file to
grow unboundedly (170+ entries with only 8 active worktrees).
- removeWorktree() now deletes sessions from state instead of nullifying
- load() skips orphaned sessions during deserialization (one-time cleanup)
- validate() also prunes orphaned sessions for completeness
The CI base SHA differs from local main, causing additional lines
in formatSessionJSON to be flagged. Wrapping the entire function
in a block annotation covers all possible diff boundaries.
Add kilocode_change markers to all Kilo-specific changes in shared
opencode files to pass the check-opencode-annotations CI check.
Also bring in the workflow and script from main.
Instead of path.basename(session.directory) which shows the working
directory name (e.g. 'opencode' for sessions in packages/opencode/),
resolve the actual worktree root by matching against WorktreeFamily.list()
directories. This shows the correct worktree folder name (e.g. 'kilocode',
'cross-session-conflict') matching git worktree list output.
Show all worktree sessions by default with directory basename labels.
ctrl+a toggles to current worktree only. Uses experimental endpoint
exclusively — no shared OpenCode code changes.
Adds a copy icon button in the Calculated Permissions header that copies
the agent name and full permission ruleset as formatted JSON to the
clipboard, making it easy to share in issues or discussions.
Address review feedback from #8582:
- Key prCache by branch name instead of worktreeId so a branch switch
in the same worktree naturally cache-misses instead of returning the
previous branch's PR for up to the full TTL.
- Drop PR_LOOKUP_TTL from 60s to 10s to match the polling behavior of
comparable tools — since only the active worktree polls, this adds
at most 1 extra lookup per cycle.