Skip to content

fix(opencode): show skill names instead of array indices in error message#15505

Closed
rndmcnlly wants to merge 1 commit intoanomalyco:devfrom
rndmcnlly:fix/skill-error-message-object-keys
Closed

fix(opencode): show skill names instead of array indices in error message#15505
rndmcnlly wants to merge 1 commit intoanomalyco:devfrom
rndmcnlly:fix/skill-error-message-object-keys

Conversation

@rndmcnlly
Copy link

Summary

  • Skill.all() returns an array, so Object.keys() on it produces numeric indices ("0, 1, 2, ...") instead of skill names. Replaced with .map((s) => s.name).
  • Added a test that verifies the error message contains actual skill names.

Fixes #7080

Verification

  • Existing skill tests pass (bun test test/tool/skill.test.ts test/skill/skill.test.ts — 14 tests, 0 failures)
  • New test creates a skill, attempts to load a nonexistent skill, and asserts the error message contains the real skill name rather than array indices

…sage

Skill.all() returns an array, so Object.keys() produced numeric
indices ("0, 1, 2, ...") instead of skill names. Use .map() to
extract names.

Fixes anomalyco#7080
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 1, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 1, 2026
@github-actions github-actions bot closed this Mar 1, 2026
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.

Skill tool returns [object Promise] instead of skill list

1 participant