Thread

DW
Daniel Wroblewski3:40 PMOpen in Slack
Hi guys! Can we make this:
env-based? I want to be able to override this to a much larger value on my installation. Ideally configuring it per agent would be awesome, but if not - global per-instance override will be good enough. We have an agent that by default deals with large tool responses. And unforunately downloading the tool result to a file is impossible because we are running it A2A, not in a conversation. And this, from what I understand, makes it impossible to download tool result because there is no conversation id:
if (!conversationId || !toolCallId || context.suppressContentLogging) {
return null; // ← no spill, plain truncation
}```
So what would work best for us is, in order from the best option:
1. Allow A2A sessions to also download tool results to disk so it can be grepped/worked with
2. Allow customizing MAX_TOOL_RESULT_CONTEXT_BYTES per agent
3. Allow overriding MAX_TOOL_RESULT_CONTEXT_BYTES on the instance as env var
Do you think it is something that could be done? 🙏
FWiW, what we're doing is automating legal team's work for creating different kinds of contracts. Their requirements got too complex for our team to manage for them, so we tell the agent to fetch additional prompt/requirements from a google doc file that is managed by the legal team - basically doing a controlled prompt injection 😅

13 replies
A
arseny3:49 PMOpen in Slack
hey, I introduced that limitation in the first place, so let me dig in to understand your flow. large tool results are typically written into sandbox (is it enabled on your side?), so agent can still work with it fully, but can avoid oververbose output by grepping it if needed - similar to how coding agents work with large files.
I am not really following how a2a affects it, so your example process would help me a lot too.
A
arseny3:50 PMOpen in Slack
we tell the agent to fetch additional prompt/requirements from a google doc file that is managed by the legal team
so that is a skill but your legal team prefers google doc over markdown, right?
DW
Daniel Wroblewski4:02 PMOpen in Slack
@user Regarding the legal team - they just told us
So that's what we did - we hardcoded the google doc link in system prompt and told the agent - `here is the link to a google doc that contains all additional rules you need to follow, use google docs read tool to get contents - https....`
but we see it only reads 32k from those calls.

Our Archestra is *1.4.7* btw

Regarding the technical limitation of spilling the output in A2A, here is Opus' explanation (with the context of archestra github repo and our `interactions` table results for problematic A2A sessions:

> Sandbox is enabled and working — `run_command` runs fine in these sessions (`Exit code: 0`, `SKILL_SANDBOX_ROOT=/skills`), and `run_command`/`upload_file`/`download_file` are all assigned.
> The spill still never fires. `tool-result-spill.ts:71-74`:
if (!conversationId || !toolCallId || context.suppressContentLogging) return null;```
routes/a2a/v1.ts has zero occurrences of conversationId — it calls executeA2AMessage({ agentId, message, organizationId, userId, sessionId, parentDelegationChain }). And a2a-executor.ts:135-141 says so explicitly: "When absent, the execution is headless and an isolation key scopes its per-run state instead."
So inbound A2A → conversationId === undefined → return null → plain truncation, every time. We only ever see Only the beginning is shown, never the saved in the sandbox at … variant.
Confirms in the DB: 63 files exist under /home/sandbox/tool-results/, all in sandboxes with a non-null conversation_id; zero in the 47 sandboxes where it's NULL.
Not a field swap, though — chat-tool-builder.ts:1138,1249 passes conversationId: isolationKey for headless, but skill_sandboxes.conversation_id is an FK to conversations(id), headless rows have it NULL with is_default = false, and SkillSandboxModel.findOrCreateDefault({conversationId}) can't address those. Needs a scope-key resolver.
Possible second guard: we use an org token, so v1.ts:283 sets userId = "system", which then hits userHasPermission("system", …) in isSkillSandboxAvailableForAgent. Didn't isolate which guard fires first.
tool-result-spill.test.ts only ever builds a real conversationId — headless isn't covered.
Repro: agent via POST /a2a/v1 with an org token reads a 78,659-char Google Doc → 32,348 chars + "Only the beginning is shown" → needed section sits at ~60% depth, unreachable.
A
arseny4:58 PMOpen in Slack
thanks, can be a2a specific quirk - i will have a look
❤️1
A
arseny6:46 PMOpen in Slack
@user quick check before we ship the fix: which credential do you use to call /a2a/v1 — an org/team token, a personal API key, or a service account key? and could you share the user_id / service_account_id from skill_sandboxes for one of those NULL-conversation rows?
DW
Daniel Wroblewski7:45 PMOpen in Slack
@user Service account, team token.
skillsandboxes rows with NULL conversationid, from the two failed runs:
id=dd5b8203-c959-4c8e-b000-27bdfad0b4bc
userid=NULL serviceaccount_id=df5783e6-9e1d-486f-87ae-0a29c29b3725
isdefault=false defaultcwd=/home/sandbox created=2026-10-28 12:45:34
id=cbbadb9a-65e4-476f-a017-fb4e4e0bcbca
userid=NULL serviceaccount_id=df5783e6-9e1d-486f-87ae-0a29c29b3725
isdefault=false defaultcwd=/home/sandbox created=2026-10-29 08:42:46
A
arseny9:19 PMOpen in Slack
i confirm a bug in a2a path, will ship a fix. thanks for the report!
❤️1
A
arseny6:51 AMOpen in Slack
Hey @user, I got news!
We didn’t make MAX_TOOL_RESULT_CONTEXT_BYTES configurable. The real problem was that headless runs (A2A, ChatOps, schedules) never saved large results to the sandbox, so they always got cut off. That’s fixed now: #9873
The model now sees a short preview and the file path (/home/sandbox/tool-results/…). It can read the full output with run_command, the same way it already works in chat. This works with your service account key.
Your report helped me uncover few more small bugs related to A2A not supporting all the features (e.g. hooks), so I appreciate it a lot!
The fix is part of 1.5.0-rc.14
DW
Daniel Wroblewski6:57 AMOpen in Slack
@user amazing. Any chance of pushing it to 1.4 as well? We’re quite hesitant of
Going to RC again… 😅
Btw making the const configurable could STILL be valuable. It is because the number you picked is just an arbitrary number. There are no better or worse choices, all depends on the use case. This is why I believe such arbitrarily picked numbers should be configurable - the developer should just pick a sane default, but the user should be able to override it as per their use case.
But I'm fine with whatever you decide! The best news is that the problem is fixed❤️
A
arseny7:03 AMOpen in Slack
I’ll see what I can do with backporting later today!
As for the configurable - I am on a fence to be honest. You’re right it is somewhat arbitrary, but the sandbox cutoff scenario should work just fine. If it was configurable, you would override it and we’d missed the chance to fix that bug in the first place plus a few smaller one around.
DW
Daniel Wroblewski7:13 AMOpen in Slack
@user yes, the sandbox spill should work just fine but doesn't it work differently by nature? I mean when it is saved to sandbox it doesn't go into the context. The agent needs to be incentivized to read it fully and put it in the context, whereas with tool output it inherently is already fully consumed.
I still understand your hesitation, though. Env-variables overwhelm is not something that is desired neither. I'm just pointing out that the fact that sandbox spill works just fine, it doesn't mean it is exact equivalent of consuming tool output. I think the user should be able to influence how the agent consumes tool output. If large tool outputs are expected and agent expects to receive if, we should be able to make it work that way.
But I'm certainly not going to be dying on that hill 😂 Do whatever you feel is right, I'm happy either way, I'm just throwing my arguments from user perspective.
Thank you! Appreciate the hard work
A
arseny9:12 AMOpen in Slack
The agent needs to be incentivized to read it fully and put it in the context, whereas with tool output it inherently is already
I’d argue here. For old / stupid models your point is valid, for current generation - not so much. Agent’s behavior is mostly caused by how the underlying model is trained, and they’re well trained to use partial reads, greps etc, as we can see from coding agents. So my first design principle for harness is to follow how similar problems are solved with coding agents as they dominate the training process these days.
Not a thing worth an argument death, of course 😄
In the meantime, PR is backported and will appear in next release github.com/archestra-ai/archestra/pull/9910
DW
Daniel Wroblewski9:22 AMOpen in Slack
@user amazing, thank you! Have a great weekend!