Skip to content
Merged
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
2619591
fix(backend/copilot): skip AI blocks without model property in fix_ai…
goodluck1103 Apr 6, 2026
5bb919e
feat(copilot): add task decomposition for agent building
goodluck1103 Apr 8, 2026
f330699
fix(copilot): improve decompose_goal UX — pin box post-stream, suppre…
goodluck1103 Apr 8, 2026
703d343
chore(frontend): update openapi.json snapshot
goodluck1103 Apr 8, 2026
629fb4d
fix(copilot): allow sub-instructions companion text and restore strea…
goodluck1103 Apr 9, 2026
aca81f3
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
goodluck1103 Apr 9, 2026
5fa3311
feat(copilot): add auto-approve timer with editable steps to decompos…
goodluck1103 Apr 9, 2026
b9d47a8
fix(copilot): auto-size editable step textareas on initial render and…
goodluck1103 Apr 9, 2026
5e9cee5
fix(copilot): address PR review comments on decompose_goal tool
goodluck1103 Apr 9, 2026
9004a3a
fix(copilot): guard auto-approve against race condition when isLastMe…
goodluck1103 Apr 9, 2026
70689ce
fix(frontend/copilot): guard isPending flag on error and filter empty…
goodluck1103 Apr 9, 2026
31ce418
fix(backend/copilot): resolve merge conflict with dev branch in model…
goodluck1103 Apr 9, 2026
02b972c
fix(backend/copilot): regenerate openapi.json with TaskDecompositionR…
goodluck1103 Apr 9, 2026
8d5e8a9
fix(backend/copilot): add decompose_goal to ToolName Literal in permi…
goodluck1103 Apr 9, 2026
94f065a
fix(frontend/copilot): remove setInitialPrompt conflict and reset edi…
goodluck1103 Apr 9, 2026
fb86fcb
feat(copilot): add server-side auto-approve fallback for decompose_goal
goodluck1103 Apr 10, 2026
f7601d0
fix(copilot): resume decompose_goal countdown from server timestamp
goodluck1103 Apr 10, 2026
f467ead
fix(copilot): disable decompose_goal Approve/Modify while message is …
goodluck1103 Apr 10, 2026
ed98980
fix(copilot): index-based predicate so manual approve cancels server …
goodluck1103 Apr 10, 2026
fdfd53b
fix(copilot): don't auto-approve decomposition on mount when deadline…
goodluck1103 Apr 10, 2026
2760cb0
Merge remote-tracking branch 'origin/dev' into feat/task-decompositio…
goodluck1103 Apr 10, 2026
98470c2
chore(backend): black-format platform_cost_test.py
goodluck1103 Apr 10, 2026
ca7dc22
chore(frontend): regenerate openapi.json with TaskDecompositionRespon…
goodluck1103 Apr 10, 2026
8f5b9fa
fix(copilot): align server auto-approve timer with client at 60s
goodluck1103 Apr 13, 2026
7b60e45
feat(copilot): cancel server auto-approve when user clicks Modify + u…
goodluck1103 Apr 14, 2026
b2dab8a
fix(copilot): use Redis flag for cross-process auto-approve cancellation
goodluck1103 Apr 14, 2026
5f19f6c
fix(copilot): remove client-side auto-approve to prevent duplicate me…
goodluck1103 Apr 14, 2026
0840b56
fix(copilot): clear stale Redis cancel flag when scheduling new auto-…
goodluck1103 Apr 14, 2026
d892b66
fix(copilot): fall back to default approval when all step description…
goodluck1103 Apr 14, 2026
6d1cd41
fix(copilot): restore client auto-approve with 5s server grace to fix…
goodluck1103 Apr 14, 2026
aa5b84e
style(copilot): reformat auto-approve constants
goodluck1103 Apr 14, 2026
020d094
fix(copilot): prevent duplicate auto-approve via DB-backed predicate …
goodluck1103 Apr 15, 2026
8d102d6
refactor(copilot): remove max 8 steps limit from decompose_goal
goodluck1103 Apr 15, 2026
b0c46ff
Merge remote-tracking branch 'origin/dev' into feat/task-decompositio…
goodluck1103 Apr 15, 2026
bee1c9a
fix(copilot): resolve merge conflict with dev + improve frontend test…
goodluck1103 Apr 15, 2026
ffdafcc
fix(frontend): remove unused DecomposeGoalOutput type import
goodluck1103 Apr 15, 2026
35bca7c
fix(copilot): fix task callback race + skip redundant DB existence check
goodluck1103 Apr 15, 2026
225bdfb
test(frontend): add integration tests for DecomposeGoal, StepItem, an…
Copilot Apr 15, 2026
62d4748
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 15, 2026
420251c
fix(copilot): clean up stream registry on enqueue failure in auto-app…
goodluck1103 Apr 15, 2026
19cd77f
Merge branch 'feat/task-decomposition-copilot' of https://github.com/…
goodluck1103 Apr 15, 2026
c01c47d
Merge branch 'dev' into feat/task-decomposition-copilot
ntindle Apr 15, 2026
559438f
fix(frontend): run pnpm format on DecomposeGoal test files
Copilot Apr 15, 2026
e4a3c4f
style(copilot): reformat test files
goodluck1103 Apr 15, 2026
e376db6
Merge branch 'feat/task-decomposition-copilot' of https://github.com/…
goodluck1103 Apr 15, 2026
480ec70
fix(frontend): remove unused RenderSegment type import
goodluck1103 Apr 15, 2026
88b39e4
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 16, 2026
dece04e
Merge remote-tracking branch 'origin/dev' into feat/task-decompositio…
goodluck1103 Apr 16, 2026
db36a76
Merge branch 'feat/task-decomposition-copilot' of https://github.com/…
goodluck1103 Apr 16, 2026
8299948
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 17, 2026
5542f78
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 17, 2026
4d5969d
refactor(copilot): simplify cancel-auto-approve route, derive countdo…
majdyz Apr 17, 2026
a31297c
fix(frontend): avoid eager decrement on legacy decompose_goal sessions
majdyz Apr 17, 2026
5b29ff5
fix(backend): invalidate cache on failed write in append_message_if
majdyz Apr 17, 2026
982808c
fix(backend): skip append_message_if when session lock not acquired
majdyz Apr 17, 2026
162c3f0
fix(copilot): enforce decompose_goal approval gate at code level
majdyz Apr 17, 2026
d0cb1e9
fix(copilot): require fresh decompose_goal+approval per build request
majdyz Apr 17, 2026
792c788
Merge branch 'dev' into feat/task-decomposition-copilot
majdyz Apr 17, 2026
731748d
Merge remote-tracking branch 'origin/dev' into feat/task-decompositio…
goodluck1103 Apr 20, 2026
2b24ef5
fix(copilot): resolve merge conflict with dev + fix test failures
goodluck1103 Apr 20, 2026
3523170
Merge remote-tracking branch 'origin/dev' into feat/task-decompositio…
goodluck1103 Apr 21, 2026
1ec30ab
refactor(copilot): use run_copilot_turn_via_queue for auto-approve
goodluck1103 Apr 21, 2026
40d56ed
fix(copilot): skip server auto-approve when turn is already in flight
goodluck1103 Apr 21, 2026
51c16c6
fix(copilot): any user response after decompose_goal unblocks build gate
goodluck1103 Apr 21, 2026
00c992a
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 21, 2026
089fc06
Merge remote-tracking branch 'origin/dev' into feat/task-decompositio…
goodluck1103 Apr 22, 2026
16a51e5
Merge branch 'feat/task-decomposition-copilot' of https://github.com/…
goodluck1103 Apr 22, 2026
f8df0fa
Merge remote-tracking branch 'origin/dev' into feat/task-decompositio…
goodluck1103 Apr 22, 2026
4fff564
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 22, 2026
95362f7
fix(copilot): timer only ticks after turn fully finishes
goodluck1103 Apr 22, 2026
26caa86
Merge branch 'feat/task-decomposition-copilot' of https://github.com/…
goodluck1103 Apr 22, 2026
263a414
Merge remote-tracking branch 'origin/dev' into feat/task-decompositio…
goodluck1103 Apr 23, 2026
b9849ce
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 24, 2026
1549972
fix(copilot): stronger prompt to end turn after decompose_goal
goodluck1103 Apr 24, 2026
eedb64a
Merge branch 'feat/task-decomposition-copilot' of https://github.com/…
goodluck1103 Apr 24, 2026
b1eee6e
fix(copilot): suppress duplicate text when calling decompose_goal
goodluck1103 Apr 24, 2026
8023b66
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 24, 2026
dbab590
refactor(copilot): make decompose_goal a visibility-only tool
goodluck1103 Apr 29, 2026
b373e37
test(copilot): use complete fixtures for splitReasoningAndResponse tests
goodluck1103 Apr 29, 2026
3b7cbe7
test(copilot): add diagnostic logging to helpers.test.ts
goodluck1103 Apr 29, 2026
234f05f
test(copilot): deeper diagnostic — compare findLastIndex vs manual loop
goodluck1103 Apr 29, 2026
6221761
debug(copilot): instrument splitReasoningAndResponse internals
goodluck1103 Apr 29, 2026
59d74fb
fix(copilot): make splitReasoningAndResponse robust to bundler optimi…
goodluck1103 Apr 29, 2026
db20387
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
goodluck1103 Apr 29, 2026
b42d087
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 30, 2026
24d20a1
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 Apr 30, 2026
b48030d
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
goodluck1103 Apr 30, 2026
40f1bfc
Merge branch 'dev' of https://github.com/Significant-Gravitas/AutoGPT…
goodluck1103 May 1, 2026
3b0f62d
Merge remote-tracking branch 'origin/feat/task-decomposition-copilot'…
goodluck1103 May 1, 2026
3d3c891
Resolve merge conflicts with dev
goodluck1103 May 25, 2026
af04b1d
Merge branch 'dev' into feat/task-decomposition-copilot
goodluck1103 May 25, 2026
1c75319
Resolve merge conflicts with dev
goodluck1103 May 25, 2026
b69530d
fix(frontend/copilot): align isErrorOutput with parseOutput for messa…
goodluck1103 May 25, 2026
1a9bbcf
feat(copilot): make decompose_goal step descriptions plain-English
goodluck1103 May 26, 2026
7d31292
fix(copilot): tighten decompose_goal descriptions to fit schema char …
goodluck1103 May 26, 2026
2d567b2
Resolve merge conflicts with dev
goodluck1103 May 27, 2026
d63a2e6
feat(backend/copilot): gate decompose_goal on library-similarity check
goodluck1103 May 28, 2026
a0dbaaa
Merge remote-tracking branch 'origin/dev' into feat/decompose-goal-af…
goodluck1103 May 28, 2026
f69ed3b
refactor(copilot): drop programmatic decompose_goal library-check gate
goodluck1103 May 29, 2026
35e4d1f
docs(backend/copilot): trim agent generation guide for dropped librar…
goodluck1103 May 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,121 +5,74 @@ generate the agent JSON yourself using block schemas, then validate and save.

### Clarifying — Before or During Building

Use `ask_question` whenever the user's intent is ambiguous — whether
that's before starting or midway through the workflow. Common moments:

- **Before building**: output format, delivery channel, data source, or
trigger is unspecified.
- **During block discovery**: multiple blocks could fit and the user
should choose.
- **During JSON generation**: a wiring decision depends on user
preference.

Steps:
1. Call `find_block` (or another discovery tool) to learn what the
platform actually supports for the ambiguous dimension.
2. Call `ask_question` with a concrete question listing the discovered
options (e.g. "The platform supports Gmail, Slack, and Google Docs —
which should the agent use for delivery?").
3. **Wait for the user's answer** before continuing.

**Skip this** when the goal already specifies all dimensions (e.g.
"scrape prices from Amazon and email me daily").

### Before Building: Show the Plan

Start agent generation by calling `decompose_goal` once to display your
build plan to the user as a step-by-step UI card.

1. Analyze the user's request and break it into plain-English steps
describing **what the agent will do for the user**, not which blocks
you will add or how they connect. For a YouTube summarizer that
might be: "Accept a YouTube URL from the user", "Fetch the video's
transcript", "Generate a timestamped summary", "Return the summary
to the user".
2. Call `decompose_goal` with those steps. Do not write any text before
or after the tool call — the platform renders the plan UI card
automatically, so any extra text duplicates the display.
3. Continue immediately with the workflow below in the same turn. The
plan card is informational only — there is no approval step, no
countdown, and no need to wait for the user.

The `description` is user-facing and must read as plain English to a
non-technical user. The platform records the block name and action on
the same step via the separate `block_name` and `action` fields — those
fields carry the technical detail. Do not put block class names
("AgentInputBlock", "AgentOutputBlock", "TranscribeYoutubeVideoBlock"),
internal types, or wiring verbs ("wire", "connect", "link") inside
`description`.

For simple goals (1-2 blocks), keep steps brief (2-3 steps).
For complex goals, use as many steps as needed.
Use `ask_question` whenever the user's intent is ambiguous — before
starting or mid-workflow. Typical gaps: output format, delivery channel,
data source, trigger, or a choice between candidate blocks.

Discover the platform's real options first (e.g. `find_block`), then
call `ask_question` listing those options ("The platform supports
Gmail, Slack, and Google Docs — which for delivery?") and **wait for
the answer**.

**Skip** when the goal already specifies every dimension (e.g. "scrape
prices from Amazon and email me daily").

### Workflow for Creating/Editing Agents

1. **If creating a new agent from a user goal (REQUIRED before `create_agent`)**:
First call
`find_library_agent(for_creation=true, goal_summary="<one-sentence summary of what the user wants>")`
to check whether the user already has a functionally similar agent. The
tool runs a hybrid semantic + lexical similarity search over the user's
library and returns either:
- `AgentsFoundResponse` with candidates whose descriptions are prefixed
with `[N% match]`. **Surface these to the user**, preserving the match
prefix, and ask whether they want to reuse one before you build a new
agent. If they pick an existing agent, run it with `run_agent` —
**do not** call `create_agent`.
- `NoResultsResponse` — no functionally similar agent exists, so you may
proceed with `create_agent`.

`create_agent` enforces this check as a hard gate (`require_library_check`)
and will refuse otherwise. If the user has been shown matches and
explicitly tells you to build a new one anyway, retry `create_agent`
with `library_check_ack=true` to bypass the gate for that call.
**Never set `library_check_ack=true` proactively** — only after the
user has seen the matches and chosen to build new.

Builder-bound sessions (when the user is already editing a specific
agent in the Builder) bypass this gate automatically — no
pre-flight call is needed there.

2. **If editing**: First narrow to the specific agent by UUID, then fetch its
1. **Library check (REQUIRED before `create_agent`)**: Call
`find_library_agent(for_creation=true, goal_summary="<one-sentence summary>")`
to look for a functionally similar agent the user already owns. If
matches are returned, surface them to the user with the `[N% match]`
prefix preserved and ask before building new; if they pick one, run
it with `run_agent`. If the user has seen matches and explicitly
tells you to build anyway, retry `create_agent` with
`library_check_ack=true` — **never set this proactively**. Builder-
bound sessions bypass this gate automatically.

2. **Show the plan**: Once step 1 is past, call `decompose_goal` with
plain-English steps that describe **what the agent does for the
user**, not blocks or wiring — e.g. for a YouTube summarizer:
"Accept a YouTube URL", "Fetch the transcript", "Generate a
timestamped summary", "Return the summary". The platform renders
the card; don't write text around the call and don't wait —
continue building in the same turn. Keep `description` plain
English; put block class names and wiring verbs in the separate
`block_name` and `action` fields.
3. **If editing**: First narrow to the specific agent by UUID, then fetch its
graph: `find_library_agent(query="<agent_id>", include_graph=true)`. This
returns the full graph structure (nodes + links). **Never edit blindly** —
always inspect the current graph first so you know exactly what to change.
Avoid using `include_graph=true` with broad keyword searches, as fetching
multiple graphs at once is expensive and consumes LLM context budget.
3. **Discover blocks**: Call `find_block(query, include_schemas=true, for_agent_generation=true)` to
4. **Discover blocks**: Call `find_block(query, include_schemas=true, for_agent_generation=true)` to
search for relevant blocks. This returns block IDs, names, descriptions,
and full input/output schemas. The `for_agent_generation=true` flag is
required to surface graph-only blocks such as AgentInputBlock,
AgentDropdownInputBlock, AgentOutputBlock, OrchestratorBlock,
and WebhookBlock and MCPToolBlock. (When running MCP tools interactively
in CoPilot outside agent generation, use `run_mcp_tool` instead.)
4. **Find library agents for sub-agent composition**: Call `find_library_agent`
5. **Find library agents for sub-agent composition**: Call `find_library_agent`
(default mode, no `for_creation` flag) to discover reusable agents that
can be composed as sub-agents via `AgentExecutorBlock`. This is distinct
from the create-time similarity check in step 1 — here you're looking
for building blocks, not asking "does the user already have this?".
5. **Generate/modify JSON**: Build or modify the agent JSON using block schemas:
- Use block IDs from step 3 as `block_id` in nodes
6. **Generate/modify JSON**: Build or modify the agent JSON using block schemas:
- Use block IDs from step 4 as `block_id` in nodes
- Wire outputs to inputs using links
- Set design-time config in `input_default`
- Use `AgentInputBlock` for values the user provides at runtime
- When editing, apply targeted changes and preserve unchanged parts
6. **Write to workspace**: Save the JSON to a workspace file so the user
7. **Write to workspace**: Save the JSON to a workspace file so the user
can review it: `write_workspace_file(filename="agent.json", content=...)`
7. **Validate**: Call `validate_agent_graph` with the agent JSON to check
8. **Validate**: Call `validate_agent_graph` with the agent JSON to check
for errors
8. **Fix if needed**: Call `fix_agent_graph` to auto-fix common issues,
9. **Fix if needed**: Call `fix_agent_graph` to auto-fix common issues,
or fix manually based on the error descriptions. Iterate until valid.
9. **Save**: Call `create_agent` (new) or `edit_agent` (existing) with
the final `agent_json`. For `create_agent`, the library similarity gate
from step 1 must have been satisfied (either matches were shown to the
user, or pass `library_check_ack=true` after explicit user confirmation).
10. **Dry-run**: ALWAYS call `run_agent` with `dry_run=True` and
10. **Save**: Call `create_agent` (new) or `edit_agent` (existing) with
the final `agent_json`.
11. **Dry-run**: ALWAYS call `run_agent` with `dry_run=True` and
`wait_for_result=120` to verify the agent works end-to-end.
11. **Inspect & fix**: Check the dry-run output for errors. If issues are
12. **Inspect & fix**: Check the dry-run output for errors. If issues are
found, call `edit_agent` to fix and dry-run again. Repeat until the
simulation passes or the problems are clearly unfixable.
See "REQUIRED: Dry-Run Verification Loop" section below for details.
Expand Down
Loading