Skip to content

t1015: Fix agent name collisions in OpenCode plugin#1311

Merged
marcusquinn merged 2 commits intomainfrom
feature/t1015
Feb 13, 2026
Merged

t1015: Fix agent name collisions in OpenCode plugin#1311
marcusquinn merged 2 commits intomainfrom
feature/t1015

Conversation

@alex-solovyev
Copy link
Collaborator

@alex-solovyev alex-solovyev commented Feb 12, 2026

Fix agent name collisions in OpenCode plugin by using relative paths instead of basename.

Problem: 204 agents were silently lost because loadAgentDefinitions() uses basename(file, ".md") as the agent name. Files like tools/git/github-cli.md and services/git/github-cli.md both register as github-cli, with the second one being dropped.

Solution:

  • Changed loadAgentsRecursive() to use full relative path without .md extension as agent name
  • Example: tools/git/github-cli.mdtools/git/github-cli (not github-cli)
  • Added scripts/ (65 md files) and templates/ (8 md files) to scanned subdirs list

Testing: Will verify all agents load without collisions after this change.

Summary by CodeRabbit

  • Chores
    • Extended agent plugin loading system to include scripts and templates directories alongside existing plugins
    • Improved agent naming convention by using relative path identifiers instead of filenames
    • Enhanced data flow for loaded subagents with consistent path representation to prevent naming collisions between similarly named files

@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

The agent plugin loader (index.mjs) was updated to include two new subdirectories (scripts and templates) in recursive scanning. Agent naming was changed from file basename to relative path without .md extension to reduce collisions, and relPath now consistently uses the same path format.

Changes

Cohort / File(s) Summary
Agent Plugin Loader
.agents/plugins/opencode-aidevops/index.mjs
Extended recursive directory scanning to include scripts/ and templates/ subdirectories. Refactored per-file agent naming from basename (with .md) to relative path without extension (e.g., tools/git/github-cli.mdtools/git/github-cli). Updated relPath data structure to consistently store paths without .md extension, reducing naming collisions among similarly named files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

Possibly related PRs

Poem

🔧 Scripts and templates now align,
✨ Relative paths shine divine,
No more collisions in the way,
Agent names clear—zero debt today!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Failed to fetch base branch: From https://github.com/marcusquinn/aidevops
! [rejected] main -> main (non-fast-forward)
+ 6cddee5...1161e94 main -> origin/main (forced update)
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the specific issue being fixed (agent name collisions) and the affected component (OpenCode plugin), accurately reflecting the main purpose of this changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t1015

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 0 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Thu Feb 12 22:15:58 UTC 2026: Code review monitoring started
Thu Feb 12 22:15:58 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 0

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 0
  • VULNERABILITIES: 0

Generated on: Thu Feb 12 22:16:01 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@alex-solovyev alex-solovyev marked this pull request as ready for review February 12, 2026 22:16
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.agents/plugins/opencode-aidevops/index.mjs:
- Around line 384-393: AGENT_MCP_TOOLS keys are simple basenames but agents are
registered with path-based names (agentName / relPath), so applyAgentMcpTools()
skips all subagents; to fix, normalize the lookup in applyAgentMcpTools(): when
iterating AGENT_MCP_TOOLS or when checking config.agent, extract the basename
(e.g., use path.basename or strip directories from the stored agentName) before
matching, or alternatively rebuild AGENT_MCP_TOOLS keys to use the same
path-based names produced where agents are pushed (see agents.push { name:
agentName } and the agentName creation), ensuring the lookup against
config.agent[agentName] succeeds and per-agent MCP tool permissions are applied.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 0 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Thu Feb 12 22:21:07 UTC 2026: Code review monitoring started
Thu Feb 12 22:21:08 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 0

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 0
  • VULNERABILITIES: 0

Generated on: Thu Feb 12 22:21:10 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

- Changed loadAgentsRecursive() to use full relative path without .md extension
- Example: tools/git/github-cli.md → tools/git/github-cli (not github-cli)
- Added scripts/ and templates/ to scanned subdirs list
- Prevents 204 agents from being silently dropped due to name collisions
…anner (t1015)

- Added scripts/ (65 md files) and templates/ (8 md files) to scanned subdirs
- Enhanced comment explaining relative path usage prevents name collisions
- Ensures all agent markdown files are discovered and registered
@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 0 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 13 00:25:15 UTC 2026: Code review monitoring started
Fri Feb 13 00:25:15 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 0

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 0
  • VULNERABILITIES: 0

Generated on: Fri Feb 13 00:25:18 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit f77230c into main Feb 13, 2026
10 of 11 checks passed
@marcusquinn marcusquinn deleted the feature/t1015 branch February 13, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments