Skip to content

fix(agents): send "improve instructions" to an agent that can act on it - #7028

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/super-agent-improve-prompt
Sep 7, 2026
Merged

fix(agents): send "improve instructions" to an agent that can act on it#7028
pedrofrxncx merged 1 commit into
mainfrom
fix/super-agent-improve-prompt

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #7027.

The bug

#7027 retired the Agent Manager and moved agent CRUD into Super-Agent-only built-ins (gated on isDecopilot). The agent editor's improve instructions button dropped its manager mention along with it, so the message goes to whoever the side panel chat runs as. On /$org/agents that is the agent being editeduseRouteVirtualMcpId resolves ?virtualmcpid= (layouts/thread-route.ts:139, chat-context.tsx:377) — and that agent has no agent CRUD tools. The request had nowhere to land.

Fixed by mentioning the Super Agent, so the SUBTASK runs under a decopilot id that carries the built-ins. With both callers passing a manager again, buildImprovePromptDoc's optional-manager branch is dead code — reverted it and its tests.

Catalog connect

Connecting an MCP from the catalog no longer navigates on its own. The existing success toast gains an Open connection action, keeping the same target logic: the first tool carrying a ui:// resource, else the connection's own page (tools tab), and no button when the server lists no tools. The slug for that link now comes from the created row rather than the request payload — the server owns it.

Also

isDecopilot's comment claimed Decopilot aggregates all org connections; storage/virtual.ts findById returns none. That fact is the premise the built-ins rest on.

Testing

bun run lint (0 errors), bun test on the touched files, bun run --cwd=apps/web check. Not exercised in a browser.


Summary by cubic

Fixes the agent editor's "improve instructions" button so it directs the request to the Super Agent, which owns the agent CRUD tools, instead of the agent being edited (which can't act on it). Also changes catalog MCP connection success to show an "Open connection" action on the toast instead of navigating automatically.

  • Mentions the Super Agent in the improve instructions doc so SUBTASK runs under a decopilot id.
  • Reverts the optional-manager branch in buildImprovePromptDoc since both callers now pass a manager.
  • Catalog connection toast gets a button linking to the first tool carrying a ui:// resource, else the connection's own tools tab; no button when the server lists no tools.
  • The link slug now comes from the created row rather than the request payload.
  • Corrects the isDecopilot comment about Decopilot aggregating connections.

Written for commit 2bb5f39. Summary will update on new commits.

Review in cubic

Follow-up to #7027, which retired the Agent Manager and moved agent CRUD
into Super-Agent-only built-ins (`isDecopilot`-scoped).

- The agent editor's "improve instructions" dropped its manager mention, so
  the message went to whoever the side panel runs as. On `/$org/agents` that
  is the agent being edited (`thread-route.ts` resolves `?virtualmcpid=`),
  which has no agent CRUD tools — the request had no way to land. It mentions
  the Super Agent instead, so SUBTASK runs under a decopilot id that carries
  the built-ins.
- With both callers passing a manager again, `buildImprovePromptDoc`'s
  optional-manager branch is dead; reverted it and its tests.
- Connecting an MCP from the catalog no longer navigates on its own — the
  existing success toast gains an "Open connection" action. Same target
  logic: the first `ui://` app tool, else the connection's own page, and no
  button at all when the server lists no tools.
- The slug for that link comes from the created row, not the request payload
  — the server owns it.
- `isDecopilot`'s comment claimed Decopilot aggregates all org connections;
  `storage/virtual.ts` findById returns none, which is the premise the
  built-ins rest on.
@pedrofrxncx
pedrofrxncx enabled auto-merge (squash) September 7, 2026 03:29
@pedrofrxncx
pedrofrxncx merged commit aadacdc into main Sep 7, 2026
34 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/super-agent-improve-prompt branch September 7, 2026 03:40
decocms Bot pushed a commit that referenced this pull request Sep 7, 2026
PR: #7028 fix(agents): send "improve instructions" to an agent that can act on it
Bump type: patch

- decocms (apps/api/package.json): 4.333.0 -> 4.333.1
- @decocms/native (apps/native/package.json): 4.333.0 -> 4.333.1
- @decocms/shared (packages/shared/package.json): 0.85.0 -> 0.85.1

Deploy-Scope: web
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