Skip to content

feat(amp): Add user plugins - #56

Merged
yeskunall merged 4 commits into
mainfrom
feat-amp-plugins-3bcb70c5420149ce
Dec 3, 2026
Merged

yeskunall merged 4 commits into
mainfrom
feat-amp-plugins-3bcb70c5420149ce

Conversation

@yeskunall

Copy link
Copy Markdown
Owner

These four Amp plugins had only been living in the personal plugins repository, so a fresh machine had no record of them in the dotfiles repository. Adding them here keeps the setup versioned with the rest of the configuration.

Each plugin is a single TypeScript file under .config/amp/plugins/. The btw plugin registers a command that asks a side question in a separate thread without interrupting the current one, running on deepseek/deepseek-v4.1-flash at high effort. The other three register the finder, librarian, and oracle tools, which each delegate a turn to a child thread running a search, research, or review prompt. Those three share one pattern: create the child thread, append the task, and wait for the response rather than calling agent.run, because agent.run fails when a plugin agent's thread invokes the tool.

To verify, load the directory as project plugins and list them:

mkdir -p /tmp/plugins-check/.amp/plugins
cp .config/amp/plugins/*.ts /tmp/plugins-check/.amp/plugins/
cd /tmp/plugins-check && amp plugins list

The output should report the finder, librarian, and oracle tools and the btw: Ask command, each active.

Making the plugins available to running sessions is a separate step: they take effect after they are published to the personal plugins repository, since Amp loads personal plugins from the pushed commit.

@coderabbitai

This comment was marked as off-topic.

@yeskunall yeskunall changed the title feat(amp): add btw, finder, librarian, and oracle plugins feat(amp): Add user plugins Dec 3, 2026

@pullfrog pullfrog Bot 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.

ℹ️ No blocking issues — three non-blocking findings below.

Approach: sound — the three official Finder/Librarian/Oracle plugins are vendored with only model/effort changes, and btw adds a small side-thread command on the same plugin API; all four typecheck and load against the current CLI.

Reviewed changes — reviewed the full 684-line diff for the four new Amp plugins under .config/amp/plugins/:

  • btw command — registers btw.ask, prompts for a question, creates a child thread on deepseek/deepseek-v4.1-flash at high effort, waits up to two minutes, then offers to open the thread URL.
  • finder tool — read-only shell_command subagent on zhipuai/glm-5.3-flash at low effort; returns file links and line ranges.
  • librarian tool — clones repositories into /tmp/amp-librarian/ and researches them on deepseek/deepseek-v4.1-flash-1017 at high effort.
  • oracle tool — read-only review/advice subagent on deepseek/deepseek-v4-pro-0813 at high effort; can delegate to finder and librarian.

Non-blocking

  • btw side thread inherits the full tool set. The agent is created with only model and reasoningEffort, so tools defaults to 'all' and a "quick side question" can edit files in the workspace; consider restricting it to read-only tools (or tools: { include: [] }) if the command is meant to answer only. btw.ts#L20
  • A timed-out subagent thread keeps running. waitForResponse rejects when timeoutMs elapses but does not cancel the child thread, and these threads are created without show: true, so a finder/librarian/oracle timeout leaves an invisible thread consuming tokens; cancel it in a catch before rethrowing. The same pattern is at librarian.ts#L157 and oracle.ts#L191. finder.ts#L112
  • The librarian's clone reuse check races. The prompt tells the agent to clone into /tmp/amp-librarian/<owner>__<repo> and reuse it when test -d "$dir/.git" succeeds; two librarian calls for the same repo can both pass that check and race on git clone. Clone into a unique temp directory (or retry against the existing clone) to make parallel calls safe. librarian.ts#L15-L17

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash-1017 | 𝕏

@pullfrog pullfrog Bot 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.

ℹ️ No blocking issues — the timeout cleanup is sound; one non-blocking note on btw below.

Reviewed changes — reviewed the delta since the prior pullfrog review (fe2c0d4), which adds cancellation to every timed-out child thread:

  • Timed-out subagent threads are cancelled. runSubagent in finder, librarian, and oracle now awaits thread.cancel() before rethrowing, so a hidden child thread no longer keeps running after waitForResponse times out.
  • btw cancels its side thread on timeout. The command stops the child thread before showing the failure, which introduces the tradeoff noted below.

Non-blocking

  • btw discards the late answer when its wait times out. The new btw.cancel() stops the side thread, but the dialog still offers "Open BTW Thread", which now opens a cancelled thread that will never finish; either leave btw's visible thread running (the dialog already lets the user retrieve it) or skip the open prompt when the thread was cancelled. btw.ts#L52

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash-1017 | 𝕏

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes — reviewed the delta since the prior pullfrog review (fe2c0d4):

  • btw now reports a stopped side thread instead of offering a dead one. On a waitForResponse timeout or error, the command cancels the side thread, notifies the failure message, and returns before the "Open BTW Thread" confirm, so the dialog no longer points at a thread that can never finish.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 | 𝕏

@yeskunall
yeskunall merged commit bcacd27 into main Dec 3, 2026
8 checks passed
@yeskunall
yeskunall deleted the feat-amp-plugins-3bcb70c5420149ce branch December 3, 2026 05:04
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.

1 participant