Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3c75482
perf(copilot): reduce tool schema token cost by 34%
majdyz Mar 13, 2026
67a121b
fix(copilot): restore functional schema constraints and critical beha…
majdyz Mar 13, 2026
32f1e51
fix(copilot): address PR review — restore default values, strengthen …
majdyz Mar 13, 2026
9cc93d8
Merge remote-tracking branch 'origin/dev' into feat/copilot-token-opt…
majdyz Mar 13, 2026
a6ecfe6
fix(copilot): address remaining PR review comments
majdyz Mar 13, 2026
777b71d
fix(copilot): remove measure_copilot_tokens.py script from PR
majdyz Mar 13, 2026
1256e8a
fix(copilot): fix indentation of persistent workspace sub-items in pr…
majdyz Mar 13, 2026
f710bde
Merge remote-tracking branch 'origin/dev' into feat/copilot-token-opt…
majdyz Mar 14, 2026
05182b8
Merge remote-tracking branch 'origin/dev' into feat/copilot-token-opt…
majdyz Mar 14, 2026
84c58b6
fix: restore critical cross-tool references in trimmed tool descriptions
majdyz Mar 14, 2026
f89a8e5
fix(copilot): improve tool schema descriptions for clarity and comple…
majdyz Mar 14, 2026
e542880
fix: clarify list_workspace_files description re cross-session persis…
majdyz Mar 14, 2026
1db18f2
fix(backend/copilot): add tool schema regression test
majdyz Mar 14, 2026
f0c3eb8
fix(copilot): address reviewer should-fix items for tool schemas
majdyz Mar 15, 2026
3bc8db4
fix(copilot): address autogpt-reviewer should-fix items from PR #1239…
majdyz Mar 15, 2026
64790e7
fix(copilot): include all run_time values in agent_output schema desc…
majdyz Mar 15, 2026
0faee66
fix(copilot): address review comments — should-fix + nice-to-have items
majdyz Mar 15, 2026
da2d341
Merge remote-tracking branch 'origin/dev' into feat/copilot-token-opt…
majdyz Mar 16, 2026
91017eb
fix(copilot): address quality nits — consistent slug format, shorter …
majdyz Mar 17, 2026
b80f252
Merge remote-tracking branch 'origin/dev' into feat/copilot-token-opt…
majdyz Mar 17, 2026
624645b
Merge remote-tracking branch 'origin/dev' into feat/copilot-token-opt…
majdyz Mar 17, 2026
963bee3
merge(dev): resolve conflict in prompting.py — take dev version with …
majdyz Mar 19, 2026
872ad8d
fix(copilot): remove accidentally tracked .application.logs, restore …
majdyz Mar 19, 2026
a0fc4a7
fix(copilot): clarify filesystem section — scope SDK tools vs workspa…
majdyz Mar 19, 2026
73e25d9
fix(copilot): restore trigger condition in continue_run_block descrip…
majdyz Mar 19, 2026
bd557aa
fix(copilot): complete run_time values, restore mcp_guide trigger hin…
majdyz Mar 19, 2026
e043132
fix(copilot): add minimum/maximum JSON schema constraints to wait_for…
majdyz Mar 19, 2026
faba2da
fix(copilot): restore schedule_name trigger mode hint in run_agent
majdyz Mar 19, 2026
eba41d8
fix(copilot): restore browser_act target parameter required-actions a…
majdyz Mar 19, 2026
a88cf78
fix(copilot): restore add_understanding purpose sentence for proactiv…
majdyz Mar 19, 2026
691b388
test(copilot): add browser_act action enum regression test
majdyz Mar 19, 2026
7650f2f
fix(copilot): restore critical LLM behavioral guidance trimmed too ag…
majdyz Mar 23, 2026
9252eea
fix(copilot): address review comments on token test and .gitignore
majdyz Mar 23, 2026
c493b36
Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into fe…
majdyz Mar 23, 2026
3d6df6a
perf(copilot): cache Config().max_file_size_mb as module-level constant
majdyz Mar 23, 2026
6c15e6c
fix(copilot): address autogpt-pr-reviewer feedback
majdyz Mar 23, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,4 @@ CLAUDE.local.md
.next
# Implementation plans (generated by AI agents)
plans/
.application.logs
Comment thread
majdyz marked this conversation as resolved.
Outdated
69 changes: 18 additions & 51 deletions autogpt_platform/backend/backend/copilot/prompting.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,18 @@
# Shared technical notes that apply to both SDK and baseline modes
_SHARED_TOOL_NOTES = f"""\

### Sharing files with the user
After saving a file to the persistent workspace with `write_workspace_file`,
share it with the user by embedding the `download_url` from the response in
your message as a Markdown link or image:

- **Any file** — shows as a clickable download link:
`[report.csv](workspace://file_id#text/csv)`
- **Image** — renders inline in chat:
`![chart](workspace://file_id#image/png)`
- **Video** — renders inline in chat with player controls:
`![recording](workspace://file_id#video/mp4)`

The `download_url` field in the `write_workspace_file` response is already
in the correct format — paste it directly after the `(` in the Markdown.

### Passing file content to tools — @@agptfile: references
Instead of copying large file contents into a tool argument, pass a file
reference and the platform will load the content for you.

Syntax: `@@agptfile:<uri>[<start>-<end>]`

- `<uri>` **must** start with `workspace://` or `/` (absolute path):
- `workspace://<file_id>` — workspace file by ID
- `workspace:///<path>` — workspace file by virtual path
- `/absolute/local/path` — ephemeral or sdk_cwd file
- E2B sandbox absolute path (e.g. `/home/user/script.py`)
- `[<start>-<end>]` is an optional 1-indexed inclusive line range.
- URIs that do not start with `workspace://` or `/` are **not** expanded.
### Sharing files
After `write_workspace_file`, embed the `download_url` in Markdown:
- File: `[report.csv](workspace://file_id#text/csv)`
- Image: `![chart](workspace://file_id#image/png)`
- Video: `![recording](workspace://file_id#video/mp4)`

### File references — @@agptfile:
Pass large file content to tools by reference: `@@agptfile:<uri>[<start>-<end>]`
Comment thread
majdyz marked this conversation as resolved.
Comment thread
majdyz marked this conversation as resolved.
- `workspace://<file_id>` or `workspace:///<path>` — workspace files
- `/absolute/path` — local/sandbox files
- `[start-end]` — optional 1-indexed line range
- Multiple refs per argument supported. Only `workspace://` and absolute paths are expanded.

Examples:
```
Expand All @@ -50,21 +34,9 @@
@@agptfile:/home/user/script.py
```

You can embed a reference inside any string argument, or use it as the entire
value. Multiple references in one argument are all expanded.
**Structured data**: When the entire argument is a single file reference, the platform auto-parses by extension/MIME. Supported: JSON, JSONL, CSV, TSV, YAML, TOML, Parquet, Excel (.xlsx only; legacy `.xls` is NOT supported). Unrecognised formats return plain string.

**Structured data**: When the **entire** argument value is a single file
reference (no surrounding text), the platform automatically parses the file
content based on its extension or MIME type. Supported formats: JSON, JSONL,
CSV, TSV, YAML, TOML, Parquet, and Excel (.xlsx — first sheet only).
For example, pass `@@agptfile:workspace://<id>` where the file is a `.csv` and
the rows will be parsed into `list[list[str]]` automatically. If the format is
unrecognised or parsing fails, the content is returned as a plain string.
Legacy `.xls` files are **not** supported — only the modern `.xlsx` format.

**Type coercion**: The platform also coerces expanded values to match the
block's expected input types. For example, if a block expects `list[list[str]]`
and the expanded value is a JSON string, it will be parsed into the correct type.
**Type coercion**: The platform auto-coerces expanded string values to match block input types (e.g. JSON string → `list[list[str]]`).

### Media file inputs (format: "file")
Some block inputs accept media files — their schema shows `"format": "file"`.
Expand Down Expand Up @@ -166,17 +138,12 @@ def _build_storage_supplement(

## Tool notes

### Shell commands
- The SDK built-in Bash tool is NOT available. Use the `bash_exec` MCP tool
for shell commands — it runs {sandbox_type}.

### Working directory
- Your working directory is: `{working_dir}`
- All SDK file tools AND `bash_exec` operate on the same filesystem
- Use relative paths or absolute paths under `{working_dir}` for all file operations
### Shell & filesystem
Comment thread
majdyz marked this conversation as resolved.
- The SDK built-in Bash tool is NOT available. Use `bash_exec` for shell commands ({sandbox_type}). Working dir: `{working_dir}`
- SDK file tools (Read/Write/Edit/Glob/Grep) and `bash_exec` share one filesystem — use relative or absolute paths under this dir.
- `read_workspace_file`/`write_workspace_file` operate on **persistent cloud workspace storage** (separate from the working dir).

Comment thread
coderabbitai[bot] marked this conversation as resolved.
### Two storage systems — CRITICAL to understand

1. **{storage_system_1_name}** (`{working_dir}`):
{characteristics}
{persistence}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ def name(self) -> str:

@property
def description(self) -> str:
return """Capture and store information about the user's business context,
workflows, pain points, and automation goals. Call this tool whenever the user
shares information about their business. Each call incrementally adds to the
existing understanding - you don't need to provide all fields at once.

Use this to build a comprehensive profile that helps recommend better agents
and automations for the user's specific needs."""
return (
Comment thread
majdyz marked this conversation as resolved.
"Store user's business context, workflows, pain points, and automation goals. "
"Call whenever the user shares business info. Each call incrementally merges "
"with existing data — provide only the fields you have. "
"Builds a profile that helps recommend better agents for the user's needs."
)

@property
def parameters(self) -> dict[str, Any]:
Expand Down
64 changes: 22 additions & 42 deletions autogpt_platform/backend/backend/copilot/tools/agent_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,18 +410,11 @@ def name(self) -> str:
@property
def description(self) -> str:
return (
"Navigate to a URL using a real browser. Returns an accessibility "
"tree snapshot listing the page's interactive elements with @ref IDs "
"(e.g. @e3) that can be used with browser_act. "
"Session persists — cookies and login state carry over between calls. "
"Use this (with browser_act) for multi-step interaction: login flows, "
"form filling, button clicks, or anything requiring page interaction. "
"For plain static pages, prefer web_fetch — no browser overhead. "
"For authenticated pages: navigate to the login page first, use browser_act "
"to fill credentials and submit, then navigate to the target page. "
"Note: for slow SPAs, the returned snapshot may reflect a partially-loaded "
"state. If elements seem missing, use browser_act with action='wait' and a "
"CSS selector or millisecond delay, then take a browser_screenshot to verify."
"Navigate to a URL in a real browser. Returns accessibility tree with @ref IDs "
"for browser_act. Session persists (cookies/auth carry over). "
"For static pages, prefer web_fetch. "
"For SPAs, elements may load late — use browser_act with wait + browser_screenshot to verify. "
"For auth: navigate to login, fill creds with browser_act, then navigate to target."
)

@property
Expand All @@ -431,13 +424,13 @@ def parameters(self) -> dict[str, Any]:
"properties": {
"url": {
"type": "string",
"description": "The HTTP/HTTPS URL to navigate to.",
"description": "HTTP/HTTPS URL to navigate to.",
},
"wait_for": {
"type": "string",
"enum": ["networkidle", "load", "domcontentloaded"],
"default": "networkidle",
"description": "When to consider navigation complete. Use 'networkidle' for SPAs (default).",
"description": "Navigation completion strategy (default: networkidle).",
Comment thread
majdyz marked this conversation as resolved.
},
},
"required": ["url"],
Expand Down Expand Up @@ -556,14 +549,12 @@ def name(self) -> str:
@property
def description(self) -> str:
return (
"Interact with the current browser page. Use @ref IDs from the "
"snapshot (e.g. '@e3') to target elements. Returns an updated snapshot. "
"Supported actions: click, dblclick, fill, type, scroll, hover, press, "
"Interact with the current browser page using @ref IDs from the snapshot. "
Comment thread
majdyz marked this conversation as resolved.
"Actions: click, dblclick, fill, type, scroll, hover, press, "
"check, uncheck, select, wait, back, forward, reload. "
"fill clears the field before typing; type appends without clearing. "
"wait accepts a CSS selector (waits for element) or milliseconds string (e.g. '1000'). "
"Example login flow: fill @e1 with email → fill @e2 with password → "
"click @e3 (submit) → browser_navigate to the target page."
"fill clears field first; type appends. "
"wait accepts CSS selector or milliseconds (e.g. '1000'). "
"Returns updated snapshot."
)

@property
Expand All @@ -589,30 +580,21 @@ def parameters(self) -> dict[str, Any]:
"forward",
"reload",
],
"description": "The action to perform.",
"description": "Action to perform.",
},
"target": {
"type": "string",
"description": (
"Element to target. Use @ref from snapshot (e.g. '@e3'), "
"a CSS selector, or a text description. "
"Required for: click, dblclick, fill, type, hover, check, uncheck, select. "
"For wait: a CSS selector to wait for, or milliseconds as a string (e.g. '1000')."
),
"description": "@ref ID (e.g. '@e3'), CSS selector, or text. Required for: click, dblclick, fill, type, hover, check, uncheck, select. For wait: CSS selector or milliseconds string (e.g. '1000').",
},
"value": {
"type": "string",
"description": (
"For fill/type: the text to enter. "
"For press: key name (e.g. 'Enter', 'Tab', 'Control+a'). "
"For select: the option value to select."
),
"description": "Text for fill/type, key for press (e.g. 'Enter'), option for select.",
},
"direction": {
"type": "string",
"enum": ["up", "down", "left", "right"],
"default": "down",
"description": "For scroll: direction to scroll.",
"description": "Scroll direction (default: down).",
},
},
"required": ["action"],
Expand Down Expand Up @@ -759,12 +741,10 @@ def name(self) -> str:
@property
def description(self) -> str:
return (
"Take a screenshot of the current browser page and save it to the workspace. "
"IMPORTANT: After calling this tool, immediately call read_workspace_file "
"with the returned file_id to display the image inline to the user — "
"the screenshot is not visible until you do this. "
"With annotate=true (default), @ref labels are overlaid on interactive "
"elements, making it easy to see which @ref ID maps to which element on screen."
"Screenshot the current browser page and save to workspace. "
"annotate=true overlays @ref labels on elements. "
Comment thread
majdyz marked this conversation as resolved.
"IMPORTANT: After calling, you MUST immediately call read_workspace_file with the "
"returned file_id to display the image inline."
)

@property
Expand All @@ -775,12 +755,12 @@ def parameters(self) -> dict[str, Any]:
"annotate": {
"type": "boolean",
"default": True,
"description": "Overlay @ref labels on interactive elements (default: true).",
"description": "Overlay @ref labels (default: true).",
},
"filename": {
"type": "string",
"default": "screenshot.png",
"description": "Filename to save in the workspace.",
"description": "Workspace filename (default: screenshot.png).",
},
},
}
Expand Down
41 changes: 14 additions & 27 deletions autogpt_platform/backend/backend/copilot/tools/agent_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,12 @@ def name(self) -> str:

@property
def description(self) -> str:
return """Retrieve execution outputs from agents in the user's library.

Identify the agent using one of:
- agent_name: Fuzzy search in user's library
- library_agent_id: Exact library agent ID
- store_slug: Marketplace format 'username/agent-name'

Select which run to retrieve using:
- execution_id: Specific execution ID
- run_time: 'latest' (default), 'yesterday', 'last week', or ISO date 'YYYY-MM-DD'

Wait for completion (optional):
- wait_if_running: Max seconds to wait if execution is still running (0-300).
If the execution is running/queued, waits up to this many seconds for completion.
Returns current status on timeout. If already finished, returns immediately.
"""
return (
"Retrieve execution outputs from a library agent. "
"Identify by agent_name, library_agent_id, or store_slug. "
"Filter by execution_id or run_time. "
"Optionally wait for running executions."
)

@property
def parameters(self) -> dict[str, Any]:
Expand All @@ -132,32 +122,29 @@ def parameters(self) -> dict[str, Any]:
"properties": {
"agent_name": {
"type": "string",
"description": "Agent name to search for in user's library (fuzzy match)",
"description": "Agent name (fuzzy match).",
},
"library_agent_id": {
"type": "string",
"description": "Exact library agent ID",
"description": "Library agent ID.",
},
"store_slug": {
"type": "string",
"description": "Marketplace identifier: 'username/agent-slug'",
"description": "Marketplace 'username/agent-name'.",
},
"execution_id": {
"type": "string",
"description": "Specific execution ID to retrieve",
"description": "Specific execution ID.",
},
"run_time": {
"type": "string",
"description": (
"Time filter: 'latest', 'yesterday', 'last week', or 'YYYY-MM-DD'"
),
"description": "Time filter: 'latest', 'today', 'yesterday', 'last week', 'last 7 days', 'last month', 'last 30 days', 'YYYY-MM-DD', or ISO datetime.",
},
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"wait_if_running": {
Comment thread
majdyz marked this conversation as resolved.
"type": "integer",
"description": (
"Max seconds to wait if execution is still running (0-300). "
"If running, waits for completion. Returns current state on timeout."
),
"description": "Max seconds to wait if still running (0-300). Returns current state on timeout.",
"minimum": 0,
"maximum": 300,
Comment thread
majdyz marked this conversation as resolved.
},
},
"required": [],
Expand Down
18 changes: 5 additions & 13 deletions autogpt_platform/backend/backend/copilot/tools/bash_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,9 @@ def name(self) -> str:
@property
def description(self) -> str:
return (
"Execute a Bash command or script. "
"Full Bash scripting is supported (loops, conditionals, pipes, "
"functions, etc.). "
"The working directory is shared with the SDK Read/Write/Edit/Glob/Grep "
"tools — files created by either are immediately visible to both. "
"Execution is killed after the timeout (default 30s, max 120s). "
"Returns stdout and stderr. "
"Useful for file manipulation, data processing, running scripts, "
"and installing packages."
"Execute a Bash command or script. Shares filesystem with SDK file tools. "
"Useful for scripts, data processing, and package installation. "
"Killed after timeout (default 30s, max 120s)."
)

@property
Expand All @@ -60,13 +54,11 @@ def parameters(self) -> dict[str, Any]:
"properties": {
"command": {
"type": "string",
"description": "Bash command or script to execute.",
"description": "Bash command or script.",
},
"timeout": {
"type": "integer",
"description": (
"Max execution time in seconds (default 30, max 120)."
),
"description": "Max seconds (default 30, max 120).",
"default": 30,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ def name(self) -> str:

@property
def description(self) -> str:
Comment thread
majdyz marked this conversation as resolved.
return (
"Continue executing a block after human review approval. "
"Use this after a run_block call returned review_required. "
"Pass the review_id from the review_required response. "
"The block will execute with the original pre-approved input data."
)
return "Resume block execution after a run_block call returned review_required. Pass the review_id."

@property
def parameters(self) -> dict[str, Any]:
Expand All @@ -44,10 +39,7 @@ def parameters(self) -> dict[str, Any]:
"properties": {
"review_id": {
"type": "string",
"description": (
"The review_id from a previous review_required response. "
"This resumes execution with the pre-approved input data."
),
"description": "review_id from the review_required response.",
},
},
"required": ["review_id"],
Expand Down
Loading
Loading