Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/clips/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Use local docs only (no web research): `pnpm action docs-search --query "<topic>

## Application state

- `navigation` tracks library, shared-with-me, recording, share, meeting, dictation, settings, and transcript context. A recording includes focused `panel` and requested `atMs`; `navigate` opens that viewer context.
- `navigation` tracks library, shared, recording (`panel`, `atMs`), share, meeting, dictation, settings, and `?q=` search. Use `navigate` (`view: "library"`, `search`) for find/filter asks.
- `selection` holds selected recording ids in selection mode. `recording-setup.import` holds the Loom-import UI state, never the pasted URL. `record-intent` is a UI-consumed capture request and is then cleared.

## Key actions
Expand Down
27 changes: 27 additions & 0 deletions templates/clips/server/plugins/agent-chat.instructions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const agentChatSource = readFileSync(
new URL("./agent-chat.ts", import.meta.url),
"utf8",
);
const agentsGuideSource = readFileSync(
new URL("../../AGENTS.md", import.meta.url),
"utf8",
);

describe("Clips transcript agent guidance", () => {
it("continues bounded transcripts through every returned offset", () => {
Expand All @@ -15,3 +19,26 @@ describe("Clips transcript agent guidance", () => {
expect(agentChatSource).toContain("interpret the chunks together");
});
});

describe("Clips library search navigation guidance", () => {
it("steers find and filter requests to navigate with view=library and search", () => {
expect(agentChatSource).toContain("<clips-library-search>");
expect(agentChatSource).toContain('view="library" and search=');
expect(agentChatSource).toContain(
"even if matching recordings already appear",
);
expect(agentChatSource).toContain(
'do not jump straight into a single recording player (view="recording")',
);
});

it("advertises filtered library search paths in MCP instructions", () => {
expect(agentChatSource).toContain("open_app");
expect(agentChatSource).toContain("/library?q=");
});

it("documents library search navigation in AGENTS.md", () => {
expect(agentsGuideSource).toContain('view: "library"');
expect(agentsGuideSource).toContain("?q=");
});
});
9 changes: 8 additions & 1 deletion templates/clips/server/plugins/agent-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ export default createAgentChatPlugin({
prepareRequest: async ({ references }) => {
await validateRecordingReferences(references);
},
mcp: { appApprovalPage: true },
mcp: {
appApprovalPage: true,
instructions:
"Use open_app to show Clips views (including /library?q=<query> for filtered Library search results), or ask_app to search, filter, and work with recordings.",
},
actions: loadActionsFromStaticRegistry(actionsRegistry),
initialToolNames: INITIAL_TOOL_NAMES,
durableBackgroundRuns: true,
Expand All @@ -41,6 +45,9 @@ The transcript in view-screen and get-recording-player-data is bounded when call
<clips-agent-routing>
For summaries, action-item lists, follow-up lists, and todo lists based on the recording in view, use Clips' recording/transcript actions and answer directly in this chat. Do not call Plan or another app for a generic written list. Only delegate to Plan when the user explicitly asks for a visual or structured Agent-Native Plan, a Plan artifact, or the Plans app.
</clips-agent-routing>
<clips-library-search>
When the user asks to find, search, or filter clips or recordings by keyword or topic, filter the active list view on screen by calling navigate with view="library" and search="<query>" (or view="space" with spaceId and search inside a space), even if matching recordings already appear in current-screen. Do not only list matches in chat while leaving the Library unfiltered, and do not jump straight into a single recording player (view="recording") unless the user asks to open, play, or inspect a specific clip or its transcript/comments.

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.

🟡 Filtered navigation relies on the companion URL plumbing

This guidance instructs the agent to pass search to navigate and promises the list will update, but the current navigation path builder drops search when generating Library/space URLs. Until companion PR #9562 is merged with the query plumbing, this leaves the list unfiltered while the agent is told it applied the filter. Please ensure this change cannot land independently of that plumbing, or avoid promising the behavior until it is available.

Fix in Builder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged — this guidance pairs with companion PR #9562, which adds ?q= serialization in pathFromCommand and LibraryGrid ?q= filtering. Both land independently with zero file overlap; keeping the canonical navigate(view="library", search) contract in extraContext/AGENTS.md so the instructions match the navigate action schema.

</clips-library-search>
<clips-recording-discovery>
Clips public recordings are unlisted-by-link, not a searchable public catalog. Treat a recording as known only when it is owned by the current user, already appears in the current screen, or the current user has already viewed it. Do not use list-recordings or search-recordings to discover someone else's clips, recover from a failed direct lookup, answer a date/time question, or search by a title that was not supplied by the user. A question such as when this clip was created refers to the clip already in context; answer it from current-screen or get-recording-player-data. If a direct recording lookup fails, report the failure and stop instead of broadening the search. Only inspect another clip when the user provides its share URL or recording id in the request.
</clips-recording-discovery>`,
Expand Down
Loading