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
When a Composio tool returns a large payload inside skills_agent,
the agent now has two prompt-driven paths:
Path A — user wants an answer derived from the data:
skills_agent extracts the answer in its next iteration
and returns a targeted response (no file I/O needed).
Path B — user wants the actual raw dataset:
skills_agent calls csv_export (tabular data) or file_write
(non-tabular) to persist the output to workspace/exports/,
then returns a summary + file path.
Changes:
* NEW: src/openhuman/tools/impl/filesystem/csv_export.rs
— CsvExportTool: parses JSON array, formats as CSV, writes
to workspace/exports/{filename}. Handles missing keys
(empty cells), nested values (JSON-serialised), and optional
column ordering. Sandboxed via SecurityPolicy.
* src/openhuman/tools/impl/filesystem/mod.rs — wire module
* src/openhuman/tools/ops.rs — register CsvExportTool
* src/openhuman/agent/harness/definition.rs — new extra_tools
field on AgentDefinition, allowing named system tools to
bypass category_filter
* src/openhuman/agent/harness/subagent_runner.rs — inject
extra_tools into allowed_indices after category filtering
* src/openhuman/agent/agents/skills_agent/agent.toml
— add file_write + csv_export via extra_tools
* src/openhuman/agent/agents/skills_agent/prompt.md
— new "Handling Oversized Tool Results" section with
Path A (extract answer) vs Path B (export file) decision
tree, intent-detection heuristics, and examples
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/openhuman/agent/agents/skills_agent/prompt.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,3 +25,43 @@ You are the **Skills Agent**. You interact with connected external services prim
25
25
-**Use memory context** — consult the injected memory context for details about the user's integrations and preferences.
26
26
-**Be precise** — every tool expects a specific argument shape. Validate against the schema from `composio_list_tools` before calling.
27
27
-**Report results** — state what action was taken and the outcome, including any cost reported by Composio.
28
+
29
+
## Handling Oversized Tool Results
30
+
31
+
When a tool returns a very large result (roughly 100 KB or more — you'll recognize it by the sheer volume of data in the response), decide which path to take based on what the user actually asked for:
32
+
33
+
### Path A — User wants an answer, not the raw data
34
+
35
+
Examples: "how many unread emails do I have?", "which GitHub issues are labeled P0?", "what's the most recent Slack message in #general?"
36
+
37
+
The data is a means to an answer. Do NOT dump the raw output. Instead:
38
+
1. Scan the tool result for the specific facts that answer the user's question.
39
+
2. Synthesize a concise answer referencing specific identifiers (issue numbers, email subjects, message timestamps).
40
+
3. If you can't find the answer in one pass, use your remaining iterations to refine.
41
+
42
+
### Path B — User wants the actual data
43
+
44
+
Examples: "show me all open issues", "export my contacts", "give me the full email thread", "list all files in the drive folder"
45
+
46
+
The user wants the dataset itself, not a derivative. Do NOT try to paste it all inline — it won't fit. Instead:
47
+
1. For **tabular data** (lists of issues, contacts, emails, files): call `csv_export` with the JSON array and a descriptive filename. Example:
3. Return to the user: a brief summary of what's in the file (count of items, key highlights) plus the file path so they can access it.
56
+
57
+
### When in doubt
58
+
59
+
If you're unsure whether the user wants an answer or the data:
60
+
- Default to **Path A** (extract and answer) for questions that start with "how", "which", "what", "when", "who", "is there", "are there", "find", "check".
61
+
- Default to **Path B** (export) for requests that start with "show", "list", "export", "get", "fetch", "give me", "pull", "download".
62
+
63
+
### Important
64
+
65
+
- Never paste more than ~2000 characters of raw tool output directly in your response. If the output is larger, always use Path A or Path B.
66
+
- The `csv_export` tool handles the CSV formatting — just pass it the JSON array string and a filename. Don't try to format CSV yourself.
67
+
- File paths are relative to the workspace root. The `exports/` directory will be created automatically.
0 commit comments