Skip to content

fix(frontend): stop the playbook editor flagging per-repo git tools as unknown - #90

Merged
sourcehawk merged 2 commits into
mainfrom
fix/playbook-editor-resolves-repo-alias-tools
Sep 2, 2026
Merged

fix(frontend): stop the playbook editor flagging per-repo git tools as unknown#90
sourcehawk merged 2 commits into
mainfrom
fix/playbook-editor-resolves-repo-alias-tools

Conversation

@sourcehawk

Copy link
Copy Markdown
Owner

Description

Every git call in a real playbook showed the "unknown" badge in the editor's suggested-call picker, the dropdown could not offer those tools, and their input hints never appeared. The catalog lists each git tool once under the logical server triagent-git, but every linked repo runs its own server named triagent-git-<alias>, and that aliased form is what suggested_calls carry, so the picker's exact match never hit. This PR expands the catalog inside the editor with one copy of each git tool per linked repo, fed by the existing repos endpoint. A call against a repo that isn't linked in this launcher still reads as unknown, which is the honest answer, and the badge's tooltip now says so.

Changes

  • The playbook editor's tool picker resolves triagent-git-<alias>/<tool> for every linked repo and lists those tools in its dropdown.
  • The logical triagent-git entries stay in the catalog so system playbooks written against the template form still resolve.

Testing

expandRepoAliases has unit tests for the per-alias expansion, alias dedupe, and the no-repos passthrough. Full frontend vitest (244 tests) and npm run typecheck pass. The MCP catalog page is untouched: it reads the same endpoint but groups by logical server on purpose, so the expansion lives in the editor only.

🤖 Generated with Claude Code

…ll picker

The tool catalog lists each git tool once under the logical server "triagent-git", but every linked repo runs its own server named triagent-git-<alias>, and that aliased form is what a playbook's suggested_calls carry. The picker matched server/name exactly against the logical catalog, so every git call in a real playbook showed the "unknown" badge, the dropdown could not offer the aliased tools, and the input hints never appeared for them.

Expand the catalog in the editor with one copy of each git tool per linked repo alias, fed by the existing /api/repos endpoint. The logical entry stays so system playbooks written against the template form still resolve.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 2, 2026 12:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The fix is localized, covered by unit tests, and the remaining feedback is a minor optimization rather than a correctness issue.

Pull request overview

Updates the playbook editor’s tool catalog handling so per-repo git MCP aliases (triagent-git-<alias>) resolve as known tools in the suggested-call picker, fixing “unknown” badges and restoring dropdown/input-hint behavior while keeping the logical triagent-git entries intact for template/system playbooks.

Changes:

  • Expand the logical triagent-git tool catalog into per-linked-repo alias entries inside the playbook editor.
  • Add unit tests covering alias expansion, alias dedupe, and no-repos passthrough.
  • Clarify the “unknown tool” tooltip to include the “repo isn’t linked” case.
File summaries
File Description
frontend/lib/mcps.ts Adds expandRepoAliases to expand logical git tools into per-repo alias tool entries for the editor.
frontend/lib/mcps.test.ts Adds focused unit tests validating alias expansion and deduping behavior.
frontend/components/playbooks/ToolPicker.tsx Updates the unknown-tool tooltip to reflect unlinked-repo scenarios.
frontend/components/playbooks/PlaybookEditor.tsx Fetches linked repos and passes an expanded catalog to the node editor tool picker.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread frontend/lib/mcps.ts Outdated
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 2, 2026 12:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is localized to the editor catalog resolution, includes targeted unit tests, and preserves existing logical triagent-git behavior while fixing per-repo tool matching.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@sourcehawk
sourcehawk merged commit 8c17549 into main Sep 2, 2026
6 checks passed
@sourcehawk
sourcehawk deleted the fix/playbook-editor-resolves-repo-alias-tools branch September 2, 2026 12:36
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