Repository navigation
Conversation
📘 Docs preview
This comment updates in place on every push. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 1
Please check the settings in the CodeRabbit UI or the
|
| Layer / File(s) | Summary |
|---|---|
Agent operation contracts and defaults sdks/python/agenta/sdk/agents/platform/op_catalog.py, sdks/python/agenta/sdk/agents/adapters/agenta_builtins.py, sdks/python/oss/tests/pytest/unit/agents/platform/* |
The SDK registers list, read, create, and edit operations with schemas, permissions, and caller bindings. Built-in agent instructions and tests cover the new operations. |
Agent creation and revision workflow api/oss/src/core/workflows/new_agent.py, api/oss/src/core/workflows/commit_support.py, api/oss/src/core/workflows/service.py, api/oss/src/core/workflows/types.py, api/oss/tests/pytest/unit/workflows/* |
Workflow helpers load the agent template and generate slugs and attribution. The service adds template-based, idempotent creation and shared configuration-read handling. |
Agent handlers, dispatch, and links api/oss/src/core/tools/*, api/oss/src/apis/fastapi/tools/router.py, api/oss/src/apis/fastapi/sessions/utils.py, api/oss/src/utils/web_links.py, api/oss/tests/pytest/unit/tools/*, api/oss/tests/pytest/acceptance/* |
Handlers implement listing, reading, creation, and editing with visibility and permission checks. Dispatch passes workspace and read-scope context. Agent URLs use shared URL helpers, and the router invalidates caches when another agent’s revision is written. |
Tool configuration and revision guidance api/oss/src/core/workflows/read_config.py, api/oss/src/core/workflows/change_set.py, api/oss/tests/pytest/unit/workflows/test_read_config.py, api/oss/tests/pytest/unit/workflows/test_change_set.py |
Error guidance now points to available list keys or appropriate retry actions. Whole-list replacement warnings require keyed entries, and validation messages include the issues. |
Chat descriptions and agent guidance web/packages/agenta-chat/src/model/approvalDescribers/*, web/packages/agenta-chat/src/skin/registry.ts, web/packages/agenta-chat/tests/unit/model/describeAgentChanges.test.ts |
The chat interface adds approval previews, transcript summaries, display labels, and icons for agent-management tools. |
Estimated code review effort: 4 (Complex) | ~60 minutes
Sequence Diagram(s)
sequenceDiagram
participant Agent as Calling agent
participant Catalog as op_catalog
participant Router as tools router
participant Handlers as platform_handlers
participant Workflows as SimpleWorkflowsService
Agent->>Catalog: call an agent-management tool
Catalog->>Router: provide tool reference and bound caller context
Router->>Handlers: dispatch with workspace and read scope
Handlers->>Workflows: read, create, or commit an agent revision
Workflows-->>Handlers: return workflow and revision result
Handlers-->>Router: return tool result
Router-->>Agent: return response and invalidate caches when needed
Possibly related PRs
- Agenta-AI/agenta#5041: Defines tool permission and approval behavior used by the newly registered read and write tools.
- Agenta-AI/agenta#7791: Defines private-agent visibility and ownership rules used when the new tools resolve agent targets.
- Agenta-AI/agenta#8341: Covers configuration validation on agent creation and edits, which also applies to these create and edit paths.
Merge Risk: 
Moderate · previous review 1e372
-
This change adds tools for agents to list, read, create, and edit other agents. The main paths appear sound, and archived agents are no longer returned on create retries. Some issues remain:
- The formatting check fails.
- One acceptance test can fail in busy projects.
- Malformed read arguments are not reported as clear errors.
- Earlier concerns about tool toggles, list performance, and documentation accuracy are still open.
- Live validation has not been rerun since the rebase.
Resolve or explicitly accept these items before merging.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title names the main change: four cross-agent tools (list, read, create, edit other agents) for the builder agent. The changeset adds these handlers, op definitions, and web approval describers, so the title matches the primary change. It is short, specific, and readable.
Full details: Description check
-
Explanation
The PR description is specific and closely related to the changeset. It describes the four platform tools (list_agents, read_agent_config, create_agent, edit_agent_config), their access rules, the edit path reuse, the removed build-kit behavior, and the tests added. Its level of detail is well above the lenient bar, so the check passes.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
mmabrouk
left a comment
There was a problem hiding this comment.
🤖 The AI agent says: Notes on the hunks that are easy to misread. Each one explains why the code looks the way it does.
Website previewPreview URL: https://pr-7409-agenta-website-preview.mahmoud-637.workers.dev Built from |
|
🤖 The AI agent says: Live QA on a throwaway stack running this branch. The browser extension for attaching videos was not available, so the recording (2 min 49 s) and screenshots were sent to the PR author directly. This comment walks through what they show.
The benchmark table in the description comes from the same stack: 45 trials over nine scenarios on Claude Haiku, Gemini 3.7 Flash and DeepSeek v4.1 Flash, plus build-kit runs. Its checks look at revisions and commit messages, not at model prose. What I need from you: a code review, mainly of the two engine changes, the @coderabbitai review |
|
Railway Preview Environment
Dependent tests finished. Post /preview for manual review. Environment absence verified; retained storage requires separate provider accounting. Post |
|
🤖 The AI agent says: #7411 (refuse an agent config the runtime cannot run, on every save) is merged into this branch. CI cannot prove these checks, so run them when this branch is QA'd on a live stack:
|
9c596d5 to
7297203
Compare
|
🤖 The AI agent says: Changes since the first review round. The description is updated to match.
Benchmark on the final code, 2 trials each: Gemini 3.7 Flash passes every conversation scenario. Haiku passes all but one: a configured Haiku agent still rewrites its own job instead of asking first (0/2). The follow-ups in the description list a cheap fix. The recording of the conversation flow (configured agent asks, creates, offers a first message, and the new agent answers) was sent to the PR author directly, because the browser tool for attaching video was not available. What I need from you: a code review of the final diff, and a decision on the Haiku gap: ship as is, or add one system-prompt line in the runner for agents that hold @coderabbitai review |
✅ Action performedReview finished.
|
7297203 to
073acb0
Compare
|
🤖 The AI agent says: Rebased onto |
Adds four platform tools: list_agents, read_agent_config, create_agent and edit_agent_config. They reuse the self-edit path (read_config and commit_revision, AGENT_COMMIT_SCOPE, the stale-revision check). A nameless single-instance `tools` entry is keyed by its type. Every agent revision is parsed by the runtime parser before save (invalid_agent_configuration). Build-kit Deactivate drops a tool from the run copy. The "New agent" template seeds `skills: []` and is built server-side. Squashed from the 34 commits of PR #7409 onto release/v0.128.12, and fitted to the release's agent sharing: list_agents passes the caller's agent read scope, read_agent_config and edit_agent_config answer "not found" for a private agent the caller cannot see, and create_agent gives the new agent the calling run's owner. The release's connection and embed refusals apply on every agent commit path.
073acb0 to
19b4050
Compare
|
🤖 The AI agent says: Review loop result for head
Round 1 rated simplify Medium and slop Low. Round 2 and the delta round rated both Low. Fixed:
Left on purpose:
|
|
🤖 The AI agent says: Review loop result for head
Round 1 rated correctness Medium and security Medium. Round 2 rated correctness Low and security Medium. Round 3 rated both Low. Fixed:
Left on purpose:
|
|
🤖 The AI agent says: Review loop result for head
Round 1 rated naming Medium. Round 2 and the delta round rated it Low. Fixed:
Left on purpose:
|
|
🤖 The AI agent says: Status for the review conductor (2026-11-10) The PR was on How the rebase was done:
Two fix commits follow the squashed commit. They answer the review loop: Checks on
Not done yet:
|
|
The reported post-rebase live acceptance, runtime-validation, and private-agent QA remain unverified. Action performed
|
The three commits of PR 7409 (feat, review round 1, create retry read scope) rebased onto feat/agent-save-checks as one commit. The agent-save fixes (runtime parse on every save, keyed agenta_tools entry, skills: [] seed) now live in that branch.
- Remove list_agents, read_agent_config, create_agent and edit_agent_config from the build kit, from the default agenta_tools of new agents and from AGENTA_TOOLS; the builder agent will hold them as platform entries. - Remove the instruction text that tells an agent to ask before it changes itself, and the subagent_operation flow after create_agent. - edit_agent_config asks for the person's EDIT_WORKFLOWS decision on the target agent and refuses with access_denied. - create_agent takes visibility (private or project, default private); the run's person owns the new agent. The approval card says who will see it. - A create replay never returns an archived agent; list_agents says url is optional; the acceptance session id is unique per run. - Add an acceptance test for owner and visibility of a created agent. - Remove the old cross-agent-config-editing OpenSpec change and the docs section; the builder-agent change describes these tools.
0d53275 to
1e3729b
Compare
|
@coderabbitai review |
Action performed
|
…first write Review round 1 on the cross-agent tools: the idempotency key carries the person; the embed checks run before create_idempotent writes; the service returns the visibility it applied; a replay of a hidden or archived agent answers create_conflict; the namespace no longer reads like agenta_tools; a test no longer saves edit_agent_config in an agenta_tools map.
…a replay Review round 2: a replay after the owner changed the visibility reported the visibility of the original request.
|
🤖 The AI agent says: Review loop result for head
Fixed: |
|
🤖 The AI agent says: Review loop result for head
Fixed: |
|
🤖 The AI agent says: Review loop result for head
Fixed: |
…op a reserved slug prefix Devin review: read_agent_config asks the access service for VIEW_WORKFLOWS on the target agent and answers agent_not_found when refused; create_agent returns a CreatedAgent DTO instead of a tuple; a name starting with underscores no longer makes a slug with the reserved __ag__ prefix.
|
@coderabbitai review |
|
🤖 The AI agent says: Review loop result for head
Fixed: |
Rate Limit Exceeded
|
Rate Limit Exceeded
|
- The template-instructions warning stays when a merge of parameters.agent does not carry the instructions. - read_agent_config refuses a non-list path or a non-integer max_bytes as invalid arguments instead of raising. - The acceptance list test follows the cursor. - Format the approval describer test.
|
@coderabbitai review |
Rate Limit Exceeded
|
|
🤖 The AI agent says: Review loop result for head
Fixed: the template-instructions warning stays when an ancestor merge does not carry the instructions; |
|
🤖 The AI agent says: Ship record for head
Commits after the slop and naming records: Deploy steps: none. |
|
🤖 The AI agent says: Ready for a code review of the trimmed scope. The four tools are now only for the builder agent: they left the build kit, the defaults of new agents and |
Context
The builder agent is one platform agent per project that builds and changes the other agents of the project. Each run acts as the person who chats with it. It needs tools that list, read, create and edit other agents, and each tool must check the person's rights on the agent it touches. The design is in
openspec/changes/builder-agent/(added by #8341, this PR's base).This PR adds those four tools. It started as "every agent can build other agents". That version put the tools on every new agent and in the playground build kit, and it taught each agent to ask whether to change itself or create a new agent. This PR now keeps only the tools. A later PR gives them to the builder agent.
What the tools do
Four platform tools, called through the existing
POST /tools/call:list_agentscursor,limit,include_archivedname,id,slug, and aurlto its page when Agenta can build oneread_agent_configagent(slug or id),path,max_bytescreate_agentname,description,visibility,operationsedit_agent_configagent,base_revision_id,operationsRights come from the run's credential, so the tools act as the person who started the run:
list_agents,read_agent_configandedit_agent_configsee the project's shared agents and the person's own private agents. A private agent of another person answersagent_not_found, the same answer as a missing agent.EDIT_WORKFLOWSin the project (checked before the call).edit_agent_configalso asks the access service for the person'sEDIT_WORKFLOWSdecision on the target agent. When it is refused, nothing is saved and the tool answersaccess_denied.create_agentmakes the person the owner of the new agent, in the same transaction as the create.visibilityisprivate(the default: only the person sees it) orproject. A run without a person (an API key) cannot own an agent, so its agent is project-visible, the same rule as a browser create without an owner. The answer reports the visibility the agent got.Edits reuse the self-edit path: the same ordered operations, the same
AGENT_COMMIT_SCOPE(harness, sandbox and credentials stay out of reach), the same stale-revision check, and the same derived message, plus who made the change:create_agentis idempotent per person, session and arguments (visibilityincluded), so a retry after a partial failure finishes the same agent. A retry never hands back an agent the person can no longer see, or an archived one; it answerscreate_conflict. The embed checks that every commit runs happen before the first write, so a refused embed leaves no partial agent behind.The approval card for
create_agentnow says who will see the new agent: "Only you will see it." or "Everyone in this project will see it."What this PR no longer does
DEFAULT_BUILD_KIT_OPS), not in the defaultagenta_toolsentry of new agents, and not in theAGENTA_TOOLSlist that any agent can turn on. The builder agent will hold them as platform tool entries with their own approval settings.commit_revisionandcreate_agentdescriptions, and the build-an-agent skill are back to their release text.create_agentno longer returns asubagent_operationor tells the caller to add the new agent to its own tools. That flow only served an agent that builds itself.agenta_toolsmap is gone. It existed for these four tools, and the build kit keeps its current behavior.openspec/changes/cross-agent-config-editing/folder and the docs section on agents that change other agents are removed. The builder-agent change describes these tools now, and the docs will describe the builder agent when it ships.Not release-ready on its own
Not release-ready on its own. This PR is one part of the builder agent. It becomes release-ready only together with the builder agent's UI and its first behavior, which other PRs build. Do not merge it alone.
Tests
test_agent_config_handlers.pycovers the four handlers: project scope, hidden private agents, self and archived refusals, the stale-base check, attribution, the edit decision on the target agent,visibility(default,project, refused values, part of the retry key, no owner), and the idempotent retry.acceptance/sharing/test_agent_tools_ownership.pycallscreate_agentwith a person's run credential and checks the owner and visibility of the new agent (private by default, private, project), and who can list it.acceptance/tools/test_agent_config_tools.pyruns list, read, create and edit end to end.test_other_agent_ops.pycovers the op definitions, includingvisibilityand the absence of the self-repurposing text.describeAgentChanges.test.tscovers the approval cards.How to review
sdks/python/agenta/sdk/agents/platform/op_catalog.py: the four op definitions (_OTHER_AGENT_OPS).api/oss/src/core/tools/platform_handlers.py:_resolve_other_agent,_may_edit_agent, then the four handlers and their registrations.api/oss/src/core/workflows/service.py:SimpleWorkflowsService.create_agentand the read-scope check increate_idempotent.api/oss/src/apis/fastapi/tools/router.py: the read scope and workspace passed to the handlers.web/packages/agenta-chat/src/model/approvalDescribers/describeAgentChanges.tsand the chat registry rows.