You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feat] Add the builder agent to the static workflow catalog - #8345
A person who builds agents on Agenta needs one agent that builds and changes the other agents of a project. Today the build kit lets an agent change only itself. The builder agent spec (openspec/changes/builder-agent/) makes the builder a platform agent: one static catalog entry that every project has and nobody can change from inside a project. The four cross-agent tools from #7409 give it its abilities.
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.
Changes
A new static catalog entry, __ag__builder (name "Builder", version v1, not embeddable), defined in api/oss/src/core/workflows/builder_agent.py. It is a full agent configuration:
Tools, with approval defaults.create_agent and edit_agent_config ask the person first. list_agents and read_agent_config run without asking. It also gets read-only tools a builder needs to answer questions about the project: list_connections, discover_tools, list_schedules, list_subscriptions and list_deliveries, plus get_current_session and rename_session. They are platform entries with a permission each, because an agenta_tools entry cannot hold list_connections or discover_tools.
Learning drive.drives: [{"slug": "__ag__builder__learning"}] and home_drive: null, per the drive contract. The drive itself is created on first use by the learning drive PR. There is no home drive, because a home drive runs its setup script at session start and every member can write this drive.
Instructions. Ported from the proof of concept without keys, hosts, names or scripts. They tell the builder to ask whether a new agent is only for the person (visibility: private) or for the team (visibility: project), unless the request makes it clear.
Two skills, inline.manage-project-agents maps each job to a tool, gives the steps to create and change an agent, and bundles the agent config field reference from the SDK (AGENT_CONFIG_FIELDS_REFERENCE, the field chapter of the build-an-agent reference). builder-learning says what it saves in drives/__ag__builder__learning/, in which files (conventions.md, corrections.md, agents.md, README.md), and when.
Model and runtime. The llm, harness, runner and sandbox come from the "New agent" template at resolve time, so the builder runs where a person's own new agent would on the deployment.
Abilities of the proof of concept with no tool yet are left out, and the skill tells the builder to say so: running another agent, reading its runs and traces, schedules for another agent, archiving an agent, the documentation search, and recording failures in a test set.
Static revisions carry their generic ids. The catalog built static revisions with model_copy, which skips the alias sync, so artifact_id, artifact_slug and variant_id stayed empty. A run that named the builder by slug then had no artifact id in its references, and create_agent and edit_agent_config refused because caller_agent_id was missing. The catalog now sets them for every static revision.
Attribution names the builder. The builder has no row, so a write by it was attributed by id only. _attribution now reads a static caller's name from the catalog: by agent "Builder" <id>, session <id>. When the builder names itself, the read and edit tools refuse with agent_is_static.
Private content stays out of the shared drive. The learning skill saves only general lessons the person agreed to share, and no content from private agents or private conversations.
Tests / notes
New api/oss/tests/pytest/unit/workflows/test_builder_agent.py: the entry resolves by slug and by each id, in two projects, with no database read; the SDK tool resolver gives a run all four agent tools with their approvals under every agent-wide mode; a run by slug carries the builder's artifact id; a write is attributed to "Builder"; the builder cannot read or edit itself; the approval defaults hold under every agent-wide mode; exactly one drive and a null home_drive; the runtime parser (AgentTemplate.from_params) accepts it; the text has no URL, host, IP, key pattern or script path.
The drives and home_drive keys are not known to the parser on this base. The parser ignores them, so the entry loads and parses.
The full API unit suite passes. Built on [feat] Add the cross-agent tools for the builder agent #7409 in its final trimmed form, which keeps the four agent tools for the builder only and adds visibility to create_agent. The builder holds them as platform entries.
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.
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
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
Added a built-in Builder agent for managing project agents and shared project learning, with configured tools and skills.
Added guidance for agent configuration fields to support agent management.
The Builder agent is available in the static agent catalog.
The pull request adds a Builder agent definition with tool permissions, instructions, and two skills. It configures the agent from the default new-agent template, registers it as a static workflow, and adds unit tests for its configuration and lookup.
Defines the Builder’s permissions, instructions, management and learning skills, and configuration-field reference. Tests check the permissions, instructions, skills, learning-drive setup, and serialized content.
Build and register the static revision api/oss/src/core/workflows/builder_agent.py, api/oss/src/core/workflows/static_catalog.py, api/oss/tests/pytest/unit/workflows/test_builder_agent.py
Builds the Builder parameters from the default new-agent template and registers the revision as a non-embeddable static agent at version v1. Tests check its identifiers and resolution without database reads.
Agenta-AI/agenta#5041: Defines the per-tool permission model used by the Builder’s tool configuration.
Agenta-AI/agenta#7409: Adds agent tools that the Builder exposes, including agent listing, configuration reading, creation, and editing.
Merge Risk: Low · previous review d67cf
This PR adds a Builder agent to the static catalog. Its shared learning skill depends on a project drive that the runtime does not yet mount. Until the follow-up work lands, the Builder's per-project learning will not persist between conversations. The author states the PR is meant to ship together with the builder UI and its first behavior, so merge it as part of that sequence.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: a builder agent entry added to the static workflow catalog. It matches the raw summary, which says static_catalog.py registers the builder agent as a non-embeddable st…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description is related to the changeset. It explains that the PR adds the static __ag__builder catalog entry in builder_agent.py, lists its tools, learning drive, instructions, and skills, and…
Full details: Title check
Explanation
The title names the main change: a builder agent entry added to the static workflow catalog. It matches the raw summary, which says static_catalog.py registers the builder agent as a non-embeddable static workflow, and the objectives, which describe a static __ag__builder entry.
Full details: Description check
Explanation
The description is related to the changeset. It explains that the PR adds the static __ag__builder catalog entry in builder_agent.py, lists its tools, learning drive, instructions, and skills, and describes the static revision and attribution fixes and the tests. It also states the PR is not release-ready on its own. The description is specific and on-topic.
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.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 0 remain after this review.
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.
Review loop result for head cbaee717024bfd193b3e9a65afeb672c58012380 (base 0d532754b4a99ec6c0b572689040a06381abc7d5), 2 rounds.
Lens
Final rating
Slop
Low
Simplify
Low
Fixed: the builder's skill repeated the tool descriptions and two rules of the instructions, so it now maps each job to a tool and bundles the SDK field reference. A test that could not fail was removed. The bundled field reference speaks to an agent that changes itself, so the builder's copy now has a short preface that says whom "you" means. Left on purpose: the tests that resolve the entry by slug and id and scan its text for hosts and keys stay, because the task asks for tests of this entry. The round 2 delta (a preface and a test line) was not reviewed again.
Review loop result for head cbaee717024bfd193b3e9a65afeb672c58012380 (base 0d532754b4a99ec6c0b572689040a06381abc7d5), 2 rounds.
Lens
Final rating
Correctness
Medium
Security
Low
Left on purpose: the builder's instructions tell it to send visibility to create_agent, and the tool on this base does not take that field yet, so a create call that follows the instructions is refused. The trimmed version of #7409 adds the field (spec task 2.6), and this PR rebases onto it. The Medium rating stays until that rebase.
Review loop result for head cbaee717024bfd193b3e9a65afeb672c58012380 (base 0d532754b4a99ec6c0b572689040a06381abc7d5), 2 rounds.
Lens
Final rating
Naming
Low
Fixed: the skill build-agents was renamed manage-project-agents, so the model does not confuse it with build-an-agent, which changes the agent itself. Left on purpose: the learning drive shows under the agent name "Builder", as the drive contract says.
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.
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.
Review loop result for head 3db337b89f5d9a61fe5d0a4f0d7d8a08c3d2f796 (base 890793f01b3f907afc5731c2e1d7c4facddb0519, the trimmed #7409), 3 rounds.
Lens
Final rating
Correctness
Low
Security
Low
Fixed: the earlier Medium finding is closed. The rebased base adds visibility to create_agent, so the builder's instruction to send it now matches the tool. The base also removes the four agent tools from the build kit and from agenta_tools, and the builder still gets them because it lists them as platform entries.
Review loop result for head 3db337b89f5d9a61fe5d0a4f0d7d8a08c3d2f796 (base 890793f01b3f907afc5731c2e1d7c4facddb0519), carried over.
Lens
Final rating
Slop
Low
Simplify
Low
Left on purpose: no new review. The rebase onto the trimmed #7409 kept this PR's diff the same (same git patch-id as head cbaee71702), so the result recorded for that head still holds.
Review loop result for head 3db337b89f5d9a61fe5d0a4f0d7d8a08c3d2f796 (base 890793f01b3f907afc5731c2e1d7c4facddb0519), carried over.
Lens
Final rating
Naming
Low
Left on purpose: no new review. The rebase onto the trimmed #7409 kept this PR's diff the same (same git patch-id as head cbaee71702), so the result recorded for that head still holds.
The platform now serves one builder agent, `__ag__builder`, in every
project. It lists, reads, creates and edits the project's agents with the
rights of the person who chats with it. Create and edit ask the person
first; the reads run without asking. It lists one shared learning drive,
`__ag__builder__learning`, and no home drive. Two skills come with it:
how to build and change agents with its tools, and what it saves in the
learning drive and when.
Entire-Checkpoint: 01M7N9GTW70EXMCWYC23NCPF80
…ference
The builder's agent skill repeated the tool descriptions and the rules of
its instructions. It now maps each job to a tool and bundles the agent
config field reference from the SDK. The skill is renamed
manage-project-agents, so it is not confused with build-an-agent.
Entire-Checkpoint: 01M7NCDARQ59159B5YBG19V69H
The shared field reference is written for an agent that changes itself.
A short preface in the builder's copy says that "you" there means the
agent the builder creates or changes.
Entire-Checkpoint: 01M7NCHNPNGS7JH83C69FK8RYZ
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.
…private content out of its drive
A static revision left the generic artifact and variant ids empty, so a
run that named the builder by slug carried no artifact id, and
create_agent and edit_agent_config refused for a missing caller. The
catalog now stamps them. A write by the builder names it "Builder" in
the target's history, from the catalog, since it has no row.
The learning skill saves only general lessons the person agreed to
share, and no content from private agents or private conversations.
Review loop result for head 701d8189cdddc25ecb992e5401b367fcd2d4069e (base ebde63c2213e858de6e7181898fc004fd4b7a74b, the final #7409). Delta review of the last commit, after 3 earlier rounds.
Lens
Final rating
Correctness
Low
Security
Low
Fixed: static revisions now carry artifact_id, artifact_slug and variant_id, so a run that names the builder by slug binds caller_agent_id and the create and edit tools do not refuse it. A write by the builder is attributed to "Builder" from the catalog. The learning skill saves only general lessons the person agreed to share.
Review loop result for head 701d8189cdddc25ecb992e5401b367fcd2d4069e (base ebde63c2213e858de6e7181898fc004fd4b7a74b). Delta review of the last commit, after 2 earlier rounds.
Lens
Final rating
Slop
Low
Simplify
Low
Left on purpose: the simplify lens did not run on the delta. The delta is one stamp of three fields in the catalog, one early return in _attribution, skill text and tests.
Deploy steps: none.
Not covered: tests / wait-for-readiness is red because Playwright does not support Chromium on the ubuntu 26.04 runner; it is also red on #7409. Entire Gates is an external check and is red here; it has not finished on #7409. A live run of the builder agent end to end waits for the web entry point and the learning drive PR.
🤖 The AI agent says: This PR is ready for a code review. It adds the builder agent as the static catalog entry __ag__builder, with its tools, approvals, learning drive, instructions and two skills. It also fixes static revisions so a run that names the builder by slug carries its artifact id, which the create and edit tools need. Please check the instructions and the two skill texts in api/oss/src/core/workflows/builder_agent.py, because the model reads them as written.
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
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.
Context
A person who builds agents on Agenta needs one agent that builds and changes the other agents of a project. Today the build kit lets an agent change only itself. The builder agent spec (
openspec/changes/builder-agent/) makes the builder a platform agent: one static catalog entry that every project has and nobody can change from inside a project. The four cross-agent tools from #7409 give it its abilities.Changes
A new static catalog entry,
__ag__builder(name "Builder", versionv1, not embeddable), defined inapi/oss/src/core/workflows/builder_agent.py. It is a full agent configuration:create_agentandedit_agent_configask the person first.list_agentsandread_agent_configrun without asking. It also gets read-only tools a builder needs to answer questions about the project:list_connections,discover_tools,list_schedules,list_subscriptionsandlist_deliveries, plusget_current_sessionandrename_session. They areplatformentries with apermissioneach, because anagenta_toolsentry cannot holdlist_connectionsordiscover_tools.drives: [{"slug": "__ag__builder__learning"}]andhome_drive: null, per the drive contract. The drive itself is created on first use by the learning drive PR. There is no home drive, because a home drive runs its setup script at session start and every member can write this drive.visibility: private) or for the team (visibility: project), unless the request makes it clear.manage-project-agentsmaps each job to a tool, gives the steps to create and change an agent, and bundles the agent config field reference from the SDK (AGENT_CONFIG_FIELDS_REFERENCE, the field chapter of thebuild-an-agentreference).builder-learningsays what it saves indrives/__ag__builder__learning/, in which files (conventions.md,corrections.md,agents.md,README.md), and when.llm,harness,runnerandsandboxcome from the "New agent" template at resolve time, so the builder runs where a person's own new agent would on the deployment.Abilities of the proof of concept with no tool yet are left out, and the skill tells the builder to say so: running another agent, reading its runs and traces, schedules for another agent, archiving an agent, the documentation search, and recording failures in a test set.
model_copy, which skips the alias sync, soartifact_id,artifact_slugandvariant_idstayed empty. A run that named the builder by slug then had no artifact id in its references, andcreate_agentandedit_agent_configrefused becausecaller_agent_idwas missing. The catalog now sets them for every static revision._attributionnow reads a static caller's name from the catalog:by agent "Builder" <id>, session <id>. When the builder names itself, the read and edit tools refuse withagent_is_static.Tests / notes
api/oss/tests/pytest/unit/workflows/test_builder_agent.py: the entry resolves by slug and by each id, in two projects, with no database read; the SDK tool resolver gives a run all four agent tools with their approvals under every agent-wide mode; a run by slug carries the builder's artifact id; a write is attributed to "Builder"; the builder cannot read or edit itself; the approval defaults hold under every agent-wide mode; exactly one drive and a nullhome_drive; the runtime parser (AgentTemplate.from_params) accepts it; the text has no URL, host, IP, key pattern or script path.drivesandhome_drivekeys are not known to the parser on this base. The parser ignores them, so the entry loads and parses.visibilitytocreate_agent. The builder holds them asplatformentries.