fix: discover agents across all accessible drives, not just the default#65
Conversation
Shift+Tab agent cycling only showed AI_CHAT pages from PAGESPACE_DRIVE because discovery walked a single drive. listAgentsAllDrives lists every drive the token can access (default drive's agents first), skips drives whose page tree fails to load, and disambiguates duplicate display names with a short page-id suffix since pi model ids are the display names. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR refactors agent discovery from a single-drive lookup to a multi-drive scan. Pure helpers collect ChangesMulti-drive agent discovery refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 343d10c1b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return agents.map((a) => | ||
| (counts.get(a.name) ?? 0) > 1 ? { ...a, name: `${a.name} (${a.id.slice(0, 8)})` } : a, | ||
| ); |
There was a problem hiding this comment.
Ensure generated agent names are globally unique
When an existing agent is already titled like a generated name (for example, Curator (abcdefgh) alongside two agents named Curator), or two duplicate-name agents share the same eight-character ID prefix, this produces duplicate pi model IDs. Selecting the later model then still routes through config.models.find(...) to the first matching entry, so requests can be sent to the wrong PageSpace agent; generate suffixes while checking the complete resulting name set rather than only counting the original titles.
Useful? React with 👍 / 👎.
Problem
Shift+Tab agent cycling only showed agents from the
PAGESPACE_DRIVEdrive (pagespace-cli) — the 8 AIDD agents in theaidd-skillsdrive never appeared, because auto-discovery walked a single drive's page tree.Fix
listAgentsByDriveSlug→listAgentsAllDrives(preferredSlug?): lists every drive the token can access, walks each page tree in parallel, and returns all AI_CHAT pages with the default drive's agents first.collectAgentPages,orderDrivesPreferredFirst,dedupeAgentNames) extracted and unit-tested.Verification
npm run checkgreen (typecheck · lint · unit tests, incl. newtest/unit/agents.test.ts).🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests