Skip to content

fix(skill): recover malformed skill names#21295

Open
thesobercoder wants to merge 1 commit intoanomalyco:devfrom
thesobercoder:21279-skill-name-repair
Open

fix(skill): recover malformed skill names#21295
thesobercoder wants to merge 1 commit intoanomalyco:devfrom
thesobercoder:21279-skill-name-repair

Conversation

@thesobercoder
Copy link
Copy Markdown

Issue for this PR

Closes #21279

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The skill tool previously required an exact skill name match, so malformed model output like "}rpa-vision " failed even when rpa-vision existed.

This retries lookup with a trimmed and cleaned name when the exact lookup misses, then uses the resolved canonical skill name for permission checks. It keeps the change local to the skill tool and adds a regression test for the reported case.

How did you verify your code works?

  • cd packages/opencode && bun test test/tool/skill.test.ts
  • cd packages/opencode && bun typecheck
  • cd packages/opencode && bun test

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@thesobercoder
Copy link
Copy Markdown
Author

The failing unit (linux) check looks unrelated to this PR.

The only failing test is memory: abort controller leak > webfetch does not leak memory over many invocations, which is outside the skill tool area touched here.

This PR only changes:

  • packages/opencode/src/tool/skill.ts
  • packages/opencode/test/tool/skill.test.ts

I reran the memory test locally with:
cd packages/opencode && bun test test/memory/abort-leak.test.ts

It passed locally with memory growth at 2.88 MB, below the test threshold.

This looks more like a flaky Linux memory check than a regression from this change.

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.

[Bug] Incorrect skill name parsing in Kimi model: extra "}" character

1 participant