feat(chats): paired cursorAgentStart / cursorAgentList Cursor Cloud tools#1075
Open
feat(chats): paired cursorAgentStart / cursorAgentList Cursor Cloud tools#1075
Conversation
…/runs Adds a new owner-gated server-side tool exposed via Cursor SDK's Agent.list and Agent.listRuns so users can ask which agents are done, running, or errored, and follow up on background work spawned by cursorRyOsRepoAgent. Wires: - Schema + executor in api/chat/tools/cursor-agents-list.ts (owner gate, status filter, agent web URL, run.result preview) - Tool registration alongside cursorRyOsRepoAgent in api/_utils/ryo-conversation.ts (web + telegram channels) - Telegram status text + chat client recovery list + UI invocation message (call/result lines + i18n) - Bun test covering schema, owner gate, listAgents filter, and listRuns result-preview mapping Co-authored-by: Ryo Lu <me@ryo.lu>
|
The preview deployment for ryos-dev is ready. 🟢 Open Preview | Open Build Logs | Open Application Logs Last updated at: 2026-04-29 23:26:40 CET |
…orAgentList
Tool name unification + tightened descriptions so the model has a clear
mental model of when to use each:
- cursorRyOsRepoAgent -> cursorAgentStart (verb-first, scoped to start)
- cursorAgentsList -> cursorAgentList (consistent singular casing)
Both descriptions now explicitly cross-reference each other ('use
cursorAgentList to inspect agents started by cursorAgentStart'), and the
system prompt addon describes them as a paired set under one section.
Renames span:
- api/chat/tools/cursor-{repo-agent,agents-list}.ts -> cursor-agent-{start,list}.ts
- All exported symbols (CURSOR_AGENT_OWNER, cursorAgentStartSchema,
executeCursorAgentStart, CursorAgentTelegramNotify, etc.)
- Telegram webhook field cursorRepoAgentNotifyTelegram -> cursorAgentNotifyTelegram
- ryo-conversation.ts addon copy
- ToolInvocationMessage call/result branches
- telegram-status.ts switch
- useAiChat server-side recovery list + onToolCall switch
- i18n keys apps.chats.toolCalls.cursorAgentStart.* / cursorAgentList.*
- Renderer component CursorRepoAgentChatCard -> CursorAgentRunCard
- Renamed bun tests
Co-authored-by: Ryo Lu <me@ryo.lu>
…ConversationModelInput
Adds end-to-end regression coverage so the gate at the wiring layer (one
level above the per-executor owner check) cannot silently regress:
- registers cursorAgent{Start,List} for username='ryo' (chat + telegram)
- never registers them for non-owner usernames (incl. anonymous)
- never registers them when CURSOR_API_KEY is absent, even for owner
- system-prompt addon ('## CURSOR CLOUD AGENTS') only appears for owner
Pairs with the existing per-executor owner gate in
executeCursorAgentStart / executeCursorAgentList and the request-level
ownership check in api/ai/cursor-run-status.ts.
Co-authored-by: Ryo Lu <me@ryo.lu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a read-only Cursor Cloud inspection tool, and reshapes the existing one so the two read like a paired set.
cursorAgentStart— kicks off a new Cursor Cloud coding-agent run againstryokun6/ryos(renamed from the oldcursorRyOsRepoAgent).cursorAgentList— lists Cursor Cloud agents and their runs on the workspace, including status, PR/branch info, and a result preview.Together the model can answer "start a refactor for X", "which Cursor agents are still running?", "what did the run we kicked off finish with?" through one consistent tool family.
Naming
The original
cursorRyOsRepoAgenthad three problems: verb-less, awkwardly cased, and pinned the name to the repo. The new pair is verb-first and parallel:cursorRyOsRepoAgentcursorAgentStartcursorAgentsListcursorAgentListBoth descriptions cross-reference each other and the system-prompt addon now describes them under one "## CURSOR CLOUD AGENTS" section.
How
cursorAgentList(api/chat/tools/cursor-agent-list.ts)listAgents(default) andlistRuns(requiresagentId).statusfilter (any|running|finished|error|cancelled),limit(1-50),includeArchived,prUrl,cursorfor pagination.Agent.list({ runtime: "cloud", apiKey })/Agent.listRuns(agentId, { runtime: "cloud", apiKey }), maps responses to compact summaries, derives a Cursor.com web URL for each agent (bc-…ids →cursor.com/agents?id=…), and truncatesrun.resultpreviews to 280 chars.CURSOR_AGENT_OWNER(shared withcursorAgentStart).Renames in this PR (so the codebase reads consistently end-to-end):
api/chat/tools/cursor-{repo-agent,agents-list}.ts→cursor-agent-{start,list}.tsCURSOR_REPO_AGENT_OWNER→CURSOR_AGENT_OWNER,CURSOR_RYOS_REPO_AGENT_DESCRIPTION→CURSOR_AGENT_START_DESCRIPTION,cursorRyOsRepoAgentSchema→cursorAgentStartSchema,executeCursorRyOsRepoAgent→executeCursorAgentStart,CursorRepoAgentTelegramNotify→CursorAgentTelegramNotify, etc.cursorRepoAgentNotifyTelegram→cursorAgentNotifyTelegram.CursorRepoAgentChatCard→CursorAgentRunCard.apps.chats.toolCalls.cursorRyOsRepoAgent.*→cursorAgentStart.*(en); newcursorAgentList.*keys for the listing tool.ToolInvocationMessage,telegram-status.ts,useAiChatserver-side recovery list +onToolCallswitch all updated to the new names.DEFAULT_RYOS_GITHUB_REPO_URLandformatCursorRunCompletionTelegramMessagekeep their names — they really are about the ryOS repo / telegram run-completion, not the tool.Tests
tests/test-cursor-agent-list-tool.test.tsmocks@cursor/sdkand covers schema validation, owner gate,listAgentsfilter + URL derivation + pagination, andlistRunsresult-preview mapping.tests/test-cursor-agent-start-tool.test.ts(renamed from the old name) keeps the owner gate +formatCursorRunCompletionTelegramMessagecoverage and now imports the renamed symbols.Verification on this branch:
bun run build→ built without errors.bun test tests/test-cursor-agent-list-tool.test.ts tests/test-cursor-agent-start-tool.test.ts→ all 12 tests pass.bun run test:unit→ 130 tests pass (no regressions).bun run lint→ 7 pre-existing warnings only (unrelated).Notes
CURSOR_AGENT_OWNER) and the presence ofCURSOR_API_KEY. No new env vars or migrations.statusfilter oncursorAgentListis applied client-side (the Cursor REST API doesn't expose status filtering yet); the description tells the model to bumplimitwhen filtering.limitis 10; max is 50 per page. Pagination vianextCursor.