fix(cli): a link to a nested agent lands on the wrong file in Kilo and OpenCode builds

Open Beginner friendly
#1,163 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli, testing

Research direction

Start with the agent link resolvers in cli/src/contexts/tools/domain/profiles/kilo/build.ts and cli/src/contexts/tools/domain/profiles/opencode/build.ts, then compare their path handling with the generic flat strategy's flatAgentPath. Add a failing test for a nested agent on each tool, then update the resolvers to match the flat path rule. Done when both tests confirm links point to the flattened agent files.

Written by the indexing model from the issue text.

Description

Description

In Kilo and OpenCode builds, a link from one agent's text to an agent nested under agents/<folder>/ resolves to a path that keeps the folder, while the agent file itself is written flattened. The link lands on a file that does not exist.

Affected file(s)

cli/src/contexts/tools/domain/profiles/kilo/build.ts, cli/src/contexts/tools/domain/profiles/opencode/build.ts (their own agent link resolvers)

Expected behaviour

A link to a nested agent resolves to the file the build writes, through the same rule as the generic flat strategy's flatAgentPath.

Observed behaviour

The generic flat strategy was aligned in #1158 (agent writer, command naming an agent, markdown link). The Kilo and OpenCode agent transforms still resolve links through their own resolvers, which do not drop the folder.

AI tool

Other: Kilo, OpenCode.

OS

macOS, Linux, Windows.

Additional context

No shipped plugin nests agents today, so no user is affected yet. The fix is a test with a nested agent on each of the two tools, red first.

Dominant language
TypeScript
Stars
481
Forks
45
Avg merge
23h 18m
Merged PRs (30d)
106

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ai-driven-dev/framework

All issues in ai-driven-dev/framework

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.