Skip to content

[feat] Add the cross-agent tools for the builder agent - #7409

Open
mmabrouk wants to merge 6 commits into
feat/agent-save-checksfrom
feat/cross-agent-config-editing
Open

mmabrouk wants to merge 6 commits into
feat/agent-save-checksfrom
feat/cross-agent-config-editing

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

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:

Tool Model-facing inputs What it does
list_agents cursor, limit, include_archived Lists the agents the person can see in the project, each with name, id, slug, and a url to its page when Agenta can build one
read_agent_config agent (slug or id), path, max_bytes Reads another agent's latest saved configuration
create_agent name, description, visibility, operations Creates an agent from the "New agent" template, with optional changes in the same call
edit_agent_config agent, base_revision_id, operations Saves a change to another agent's latest configuration as a new version, without deploying it

Rights come from the run's credential, so the tools act as the person who started the run:

  • The project comes from the credential, never from an argument.
  • list_agents, read_agent_config and edit_agent_config see the project's shared agents and the person's own private agents. A private agent of another person answers agent_not_found, the same answer as a missing agent.
  • The write tools need EDIT_WORKFLOWS in the project (checked before the call). edit_agent_config also asks the access service for the person's EDIT_WORKFLOWS decision on the target agent. When it is refused, nothing is saved and the tool answers access_denied.
  • create_agent makes the person the owner of the new agent, in the same transaction as the create. visibility is private (the default: only the person sees it) or project. 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:

v1  Created by agent "Ops manager" <agent id>, session <session id>; set agents_md
v2  edited agents_md (1 edit) (by agent "Ops manager" <agent id>, session <session id>)

create_agent is idempotent per person, session and arguments (visibility included), 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 answers create_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_agent now 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

  • The four tools are not in the playground build kit (DEFAULT_BUILD_KIT_OPS), not in the default agenta_tools entry of new agents, and not in the AGENTA_TOOLS list that any agent can turn on. The builder agent will hold them as platform tool entries with their own approval settings.
  • No instruction text tells an agent to ask whether to change itself or create a separate agent. The placeholder instructions, the commit_revision and create_agent descriptions, and the build-an-agent skill are back to their release text.
  • create_agent no longer returns a subagent_operation or tells the caller to add the new agent to its own tools. That flow only served an agent that builds itself.
  • The build kit change that dropped a switched-off kit tool from the saved agenta_tools map is gone. It existed for these four tools, and the build kit keeps its current behavior.
  • The old 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

  • API unit: test_agent_config_handlers.py covers 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.
  • API acceptance: acceptance/sharing/test_agent_tools_ownership.py calls create_agent with 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.py runs list, read, create and edit end to end.
  • SDK unit: test_other_agent_ops.py covers the op definitions, including visibility and the absence of the self-repurposing text.
  • Web unit: describeAgentChanges.test.ts covers the approval cards.

How to review

  1. sdks/python/agenta/sdk/agents/platform/op_catalog.py: the four op definitions (_OTHER_AGENT_OPS).
  2. api/oss/src/core/tools/platform_handlers.py: _resolve_other_agent, _may_edit_agent, then the four handlers and their registrations.
  3. api/oss/src/core/workflows/service.py: SimpleWorkflowsService.create_agent and the read-scope check in create_idempotent.
  4. api/oss/src/apis/fastapi/tools/router.py: the read scope and workspace passed to the handlers.
  5. web/packages/agenta-chat/src/model/approvalDescribers/describeAgentChanges.ts and the chat registry rows.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

📘 Docs preview

Status ✅ Ready
Preview https://pr-7409-agenta-docs-preview.mahmoud-637.workers.dev/docs/
Inspect Actions run
Commit 1e3729bdc25829f3b0843853c8d4e9781bd8654b

This comment updates in place on every push.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 1

  • release/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Summary

Summary by CodeRabbit

  • New Features
    • Agents can now list other agents in a project, view their saved configurations, create agents from a default setup, and edit configurations. Visibility and access permissions are respected.
    • Chat previews and activity summaries now describe agent creation and configuration edits, including the target agent and planned changes.
  • Improvements
    • Configuration guidance now gives clearer next steps for missing values, incompatible edits, and validation errors.
    • Session links now include the associated agent when available.
  • Bug Fixes
    • Changes to another agent’s revision now invalidate project caches.

This change adds tools to list, read, create, and edit agents. It adds workflow and API support for agent visibility, revision updates, and creation retries. The SDK exposes the tools, and the chat interface adds descriptions for their calls.

Changes: Cross-agent agent management

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
Loading

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: Passed 4

Check name Status Explanation
Title check Passed 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, s…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed 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 edi…
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.

Share

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤖 The AI agent says: Notes on the hunks that are easy to misread. Each one explains why the code looks the way it does.

Comment thread api/oss/src/core/workflows/service.py Resolved
Comment thread api/oss/src/core/workflows/build_kit.py Resolved
Comment thread api/oss/src/core/workflows/service.py Resolved
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Website preview

Preview URL: https://pr-7409-agenta-website-preview.mahmoud-637.workers.dev

Built from ebde63c2213e858de6e7181898fc004fd4b7a74b. This comment updates in place on every push.

@mmabrouk

mmabrouk commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

🤖 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.

  1. Capability toggles. The build kit and the Agenta tools section both show "List agents" and "Agent config". Each has per-tool rows: List agents, Read another agent's setup, Create an agent, Save changes to another agent.
  2. Off removes the tools. With "Agent config" off in the build kit, the agent's own tool list holds list_agents but not read_agent_config, create_agent or edit_agent_config. The captured run request confirms it. The saved revision did not change.
  3. Create. In the playground, the manager agent "Ops manager" created "Invoice helper" with invoice instructions in one create_agent call.
  4. Edit. It then added a line to Invoice helper's instructions with edit_agent_config.
  5. History. Invoice helper's version history shows:
    • v1 Created by agent "Ops manager" <id>, session <id>; set agents_md
    • v2 edited agents_md (1 edit) (by agent "Ops manager" <id>, session <id>), with the instruction diff.

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 agenta_tools selector key and the runtime check on agent commits. Both also affect commit_revision. Please also confirm that you accept the four spec deviations listed in the description.

@coderabbitai review

coderabbitai[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Railway Preview Environment

Item Value
Status stopped
Commit ebde63c2213e858de6e7181898fc004fd4b7a74b
Manual expiry (UTC) Not granted
CI deadline (UTC) Not granted
Workflow https://github.com/Agenta-AI/agenta/actions/runs/44151403988

Dependent tests finished. Post /preview for manual review. Environment absence verified; retained storage requires separate provider accounting.

Post /preview as a new comment to request a one-hour preview. Repeating it while active does not extend the hour.
Preview data is disposable. Expiry is enforced by the next successful cleanup sweep, not an exact timer.
Environment deletion stops its compute. Provider-retained storage and permanent services may still be billed.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 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:

  • In the playground (/m), add a skill with a name and a description but no body to an agent, then save. Pass: the save is refused and the message names parameters.agent.skills[0].body.
  • Commit the same config with POST /workflows/revisions/commit (or the SDK). Pass: 422 with code: invalid_agent_configuration and details.issues.
  • Ask an agent to edit another agent with edit_agent_config and leave out a skill body. Pass: the tool result carries the same invalid_agent_configuration envelope, and the agent corrects the field and retries.
  • Use a stored agent that already has a skill with no body (seed it with a direct database write or an older build). Rename it, and change only its instructions. Pass: both are refused with 422 and the name does not change. Add the body in the same save. Pass: the save succeeds.
  • Regression: save an agent whose skills are @ag.embed references, load an agent template, and save an agent that runs today without changes. Pass: all succeed, and the saved agents still run.

@mmabrouk
mmabrouk changed the base branch from release/v0.122.3 to release/v0.122.5 October 11, 2026 17:30
@mmabrouk
mmabrouk force-pushed the feat/cross-agent-config-editing branch from 9c596d5 to 7297203 Compare October 11, 2026 17:36
coderabbitai[bot]

This comment was marked as resolved.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: Changes since the first review round. The description is updated to match.

  1. No separate toggle box. The four tools are now ordinary rows in the Read-only and Write lists of both the build kit and the Agenta tools section, with the same Allow / Ask / Deactivate choice as every other tool. The agentCapabilities.tsx component and its test are deleted. The spec, docs and handoff text say the same.
  2. Conversation behavior. A fresh agent that hears "I want an agent that ..." sets itself up. A configured agent asks first whether to change itself or create a separate agent. Answers name agents by name and link them as [name](url) to the agent's page in the app. After create_agent, the agent offers a first message, and only after a yes it adds the new agent as its subagent and calls it.
  3. Rebased onto release/v0.122.5, and the base of this PR is now release/v0.122.5. The one conflict was the "link to this chat" builder. The release's /m link shape is kept, built with the shared URL checks.
  4. [fix] Refuse an agent config the runtime cannot run, on every save #7411 is replayed on top. It was merged into the old branch head. Its two commits now sit on the rebased branch, and the @file refusal wording moved into the SDK's shared entry errors, so every write path names that case.

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 commit_revision.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

coderabbitai[bot]

This comment was marked as resolved.

@mmabrouk
mmabrouk changed the base branch from release/v0.122.5 to release/v0.122.7 October 15, 2026 13:10
@mmabrouk
mmabrouk force-pushed the feat/cross-agent-config-editing branch from 7297203 to 073acb0 Compare October 15, 2026 17:58
@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says: Rebased onto release/v0.122.8 (head 073acb0). Two conflicts, both in code next to this PR: service.py (the release added _effective_port next to the agent-config check; both kept) and agent_templates/exceptions.py (the release's new unavailable_next_step parameter kept, plus this PR's 422 for an agent the template cannot run). After the rebase: API 7980, SDK 3541, services 225 unit tests pass; web packages entities 2448, entity-ui 1229, chat 1337, playground 282 pass with clean types.

mmabrouk pushed a commit that referenced this pull request Nov 10, 2026
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.
@mmabrouk
mmabrouk force-pushed the feat/cross-agent-config-editing branch from 073acb0 to 19b4050 Compare November 10, 2026 13:35
@mmabrouk
mmabrouk changed the base branch from release/v0.122.8 to release/v0.128.12 November 10, 2026 13:35
coderabbitai[bot]

This comment was marked as resolved.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head 0d53275 (base 0d95bff), 2 full rounds and 1 delta round on the last fix commit.

Lens Final rating
Simplify Low
Slop Low

Round 1 rated simplify Medium and slop Low. Round 2 and the delta round rated both Low.

Fixed:

  • The private-agent check for read_agent_config and edit_agent_config moved from the router into _resolve_other_agent. A hidden agent now gets the same agent_not_found answer, with the reference the model sent, as an agent that does not exist. Before, it got a random id.
  • The attribution step no longer blocks a hidden caller. It leaves the caller's name out of the commit message instead, so a private agent on its owner's channel can still edit other agents.
  • list_agents and read and edit now pick the same head. Archived variants and archived revisions are left out in all three.
  • The maxLength: 120 limit is back on rename_session and rename_agent.
  • A comment that described its own history now states only the rule.
  • The subagent input schema now comes from the "New agent" template. Before, it was a hand copy.
  • The acceptance test creates its caller agent through the normal create API.

Left on purpose:

  • The runtime-parse check on every agent write (from [fix] Refuse an agent config the runtime cannot run, on every save #7411) stays in this PR. It fixes an HTTP 500 on every run of an agent saved with a broken skill. Such an agent already fails every run, so refusing a rename until the agent is fixed is acceptable.
  • The skill keeps its JSON example of the subagent operation, because the small-model benchmark tuned that text.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head 0d53275 (base 0d95bff), 3 rounds.

Lens Final rating
Correctness Low
Security Low

Round 1 rated correctness Medium and security Medium. Round 2 rated correctness Low and security Medium. Round 3 rated both Low.

Fixed:

  • create_agent saves the new agent's owner in the same transaction as the agent. Before, an interrupted create and its retry could leave an agent with no owner.
  • A retried create_agent checks whether the agent it finds is visible to the caller. If the agent became private since then, the retry writes nothing and answers agent_not_found, with no name or description.
  • Read and edit no longer refuse an active agent whose oldest variant is archived.
  • The attribution step no longer reads the name of a caller agent that is hidden from the caller. A forged caller_agent_id in a direct /tools/call request can no longer show a private agent's name.
  • Read and edit check private-agent visibility with the same read scope that list_agents uses.

Left on purpose:

  • The API does not check that caller_agent_id and caller_session_id match the run. The run envelope carries no agent id or session id, so the API has nothing to check them against. A member with tool and edit permissions can still put a false agent id in the commit message of a direct API call. design.md D8 tracks this item.
  • The self check runs before the visibility check. A direct call that sends the same id as caller_agent_id and agent gets agent_is_self, which confirms that the id is a workflow in the project. The caller must already know the id, and the answer shows no name or other data.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head 0d53275 (base 0d95bff), 2 full rounds and 1 delta round on the last fix commit.

Lens Final rating
Naming Low

Round 1 rated naming Medium. Round 2 and the delta round rated it Low.

Fixed:

  • wrote_revision is renamed to wrote_other_agent_revision, and the false "committed_revision implies it" sentence is gone.
  • The refusal codes now use one form: agent_not_found, agent_is_static, agent_is_self, agent_is_archived, workflow_is_not_agent.
  • list_agents answers cursor, the same as the channel list tools. Before, it answered next_cursor.
  • _AGENT_DIRECTORY_OPS is renamed to _OTHER_AGENT_OPS, because it holds all four tools.
  • The commit error a person sees is now plain text ("This agent's setup is not valid, so it cannot run."). The field paths stay in details.issues and in the logs, and the model still gets them.

Left on purpose:

  • edit_agent_config keeps its name and is not renamed to commit_agent_revision. The small-model benchmark tuned the tool names, and models read "edit" better. design.md D6 records this reason.
  • workspace_id and needs_workspace stay. The base code already uses workspace_id for this value in the auth middleware and in the /m/w/<id> session link.
  • final_validation_failed and invalid_agent_configuration stay separate. They come from two different checks: the saved shape and the runtime parse.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Status for the review conductor (2026-11-10)

The PR was on release/v0.122.8, which shipped a long time ago. It is now rebased onto release/v0.128.12, and the PR base is changed to match. The head is 0d53275.

How the rebase was done:

  • The 34 commits are squashed into one commit, 19b4050, because a commit-by-commit rebase hit the same conflicts again and again.
  • Five files had conflicts. Every conflict keeps the changes from both sides.
  • The release added private agents and agent owners, and the PR's tools did not know about them. The rebase adapted the tools. list_agents passes the caller's read scope, read and edit check private-agent visibility, and create_agent gives the new agent the run's owner.

Two fix commits follow the squashed commit. They answer the review loop: 775d19b for round 1 and 0d53275 for round 2. The three review-loop records above list each fix. All five lenses are now Low: correctness, security, slop, simplify and naming.

Checks on 0d53275:

  • API unit tests: 10363 passed and 0 failed, run locally. 145 tests were skipped because they need Postgres.
  • SDK unit tests: 3915 passed and 1 failed, in CI and locally. The failing test is test_wire_contract.py::test_request_to_wire_gateway_connection_matches_golden. It also fails on release/v0.128.12 itself, because a release commit changed platform_instructions.py and did not update the golden JSON. The PR changes neither file.
  • Web unit tests and tsc passed for the four touched packages after the rebase. The two fix commits change no web code. The web jobs in CI were still running when this comment was posted.

Not done yet:

  • Nobody has run the acceptance test acceptance/tools/test_agent_config_tools.py against a live stack since the rebase.
  • Nobody has done live QA since the rebase. The "What to QA" list in the PR body still applies. Also check the new private-agent cases. A hidden agent must answer "not found", and a private agent on its owner's channel must still be able to edit another agent.
  • CodeRabbit has not reviewed the new head. Its check is skipped, so it needs an @coderabbitai review request.
  • Nobody has approved the PR.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

@mmabrouk I’ll request a full review of the change, including the two fix commits.

The reported post-rebase live acceptance, runtime-validation, and private-agent QA remain unverified.

Action performed

Full review finished.

coderabbitai[bot]

This comment was marked as resolved.

Agenta Product Agent added 2 commits November 17, 2026 19:17
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.
@mmabrouk
mmabrouk force-pushed the feat/cross-agent-config-editing branch from 0d53275 to 1e3729b Compare November 17, 2026 18:19
@mmabrouk mmabrouk changed the title [feat] Let an agent list, read, create and edit other agents [feat] Add the cross-agent tools for the builder agent Nov 17, 2026
@mmabrouk
mmabrouk changed the base branch from release/v0.128.12 to feat/agent-save-checks November 17, 2026 18:19
@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

devin-ai-integration[bot]

This comment was marked as resolved.

Agenta Product Agent added 2 commits November 17, 2026 19:28
…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.
@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head 890793f01b3f907afc5731c2e1d7c4facddb0519 (base cd5a3e269063bdccd4f2577bf5fdddefaca38c31), 3 rounds.

Lens Final rating
Simplify Low
Slop Low

Fixed: create_agent runs the embed checks before its first write, so a refused embed leaves no partial agent; the retry key carries the person; a replay of a hidden or archived agent answers create_conflict instead of reusing agent_not_found; the answer reports the stored visibility, also on a replay after the owner changed it; the idempotency namespace no longer reads like agenta_tools; a test no longer saves edit_agent_config in an agenta_tools map.
Left on purpose: workspace_id keeps its name, because the web link and current_session_response already use it for this value. Deferred as small follow-ups: move the read-config response DTOs out of the API layer (the import is older than this PR), merge needs_workspace with needs_agent_read_scope, drop include_archived from list_agents, rename wrote_other_agent_revision, and register template_instructions in WarningCode.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head 890793f01b3f907afc5731c2e1d7c4facddb0519 (base cd5a3e269063bdccd4f2577bf5fdddefaca38c31), 3 rounds.

Lens Final rating
Correctness Low
Security Low

Fixed: create_agent runs the embed checks before its first write, so a refused embed leaves no partial agent; the retry key carries the person; a replay of a hidden or archived agent answers create_conflict instead of reusing agent_not_found; the answer reports the stored visibility, also on a replay after the owner changed it; the idempotency namespace no longer reads like agenta_tools; a test no longer saves edit_agent_config in an agenta_tools map.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head 890793f01b3f907afc5731c2e1d7c4facddb0519 (base cd5a3e269063bdccd4f2577bf5fdddefaca38c31), 2 rounds.

Lens Final rating
Naming Low

Fixed: create_conflict for a create replay; session_id instead of idempotency_scope; the namespace other_agent_tools.create_agent.
Left on purpose: workspace_id keeps its name, because the web link and current_session_response already use it for this value. Deferred as small follow-ups: move the read-config response DTOs out of the API layer (the import is older than this PR), merge needs_workspace with needs_agent_read_scope, drop include_archived from list_agents, rename wrote_other_agent_revision, and register template_instructions in WarningCode.

…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.
@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

coderabbitai[bot]

This comment was marked as resolved.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head 50a92bcaaf1c65feb98f898d67547825cdc8e087 (delta from 890793f01b), 1 round.

Lens Final rating
Correctness Low
Security Low

Fixed: read_agent_config makes the VIEW_WORKFLOWS decision on the target agent; create_agent returns a CreatedAgent DTO; a name with leading underscores no longer makes a reserved __ag__ slug.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@mmabrouk have exceeded the limit for the number of chat messages per hour. Please wait 29 minutes and 58 seconds before sending another message.

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@mmabrouk have exceeded the limit for the number of chat messages per hour. Please wait 29 minutes and 49 seconds before sending another message.

- 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.
@mmabrouk

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Rate Limit Exceeded

@mmabrouk have exceeded the limit for the number of chat messages per hour. Please wait 22 minutes and 21 seconds before sending another message.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Review loop result for head ebde63c2213e858de6e7181898fc004fd4b7a74b (delta from 50a92bcaaf), 1 round.

Lens Final rating
Correctness Low
Security Low

Fixed: the template-instructions warning stays when an ancestor merge does not carry the instructions; read_agent_config refuses a malformed path or max_bytes as invalid_arguments; the acceptance list test reads every page.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Ship record for head ebde63c221. Tier: Program (one PR of the builder agent).

Gate Result Head Link
Spec Approved by Mahmoud on 2026-11-17 n/a openspec/changes/builder-agent/ on the base branch (#8341)
Design simplify review Not run in this PR; the spec was approved as written n/a n/a
Slop and simplicity loop Low 890793f #7409 (comment)
Naming loop Low 890793f #7409 (comment)
Correctness and security loop Low, plus two delta rounds Low ebde63c #7409 (comment)
Tests Passed in CI: API, SDK, services, runner unit and integration, runner acceptance, web unit; locally: API, SDK and services unit suites ebde63c https://github.com/Agenta-AI/agenta/pull/7409/checks
Live QA Not run: no live stack for this PR n/a n/a
Screenshots Not added: the only visible change is the sentence of the create_agent approval card, which only the builder agent (a later PR) can show n/a n/a
CodeRabbit No open threads. CodeRabbit reviewed 1e3729bdc2; its later review requests hit its hourly limit 1e3729b #7409
CI Required checks green, web tests not awaited. No Railway preview runs for this base branch, so the API acceptance tests did not run in CI ebde63c https://github.com/Agenta-AI/agenta/pull/7409/checks
Docs in sync The old docs section is removed; the builder agent's docs come with its PR ebde63c docs/docs/concepts/01-agents.mdx

Commits after the slop and naming records: 50a92bcaaf (read decision on the target agent, CreatedAgent DTO, reserved slug prefix) and ebde63c221 (CodeRabbit fixes). Both went through a correctness and security delta round.

Deploy steps: none.
Not covered: the new acceptance test acceptance/sharing/test_agent_tools_ownership.py and acceptance/tools/test_agent_config_tools.py need a running stack and did not run. Live QA did not run. Not release-ready on its own: it ships together with the builder agent's other PRs.

@mmabrouk

Copy link
Copy Markdown
Member Author

🤖 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 AGENTA_TOOLS. edit_agent_config and read_agent_config decide on the target agent through the access service, and create_agent takes visibility (default private) with the person as owner. The base is now #8341. Not release-ready on its own.

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant