gsxdsm
07c8c95b10
FN-8614: cap agent tool output
Bound every engine-injected tool result to preserve agent context capacity.
- Add shared 16,000-character total text budgets with deterministic truncation markers and validated overrides.
- Apply outermost output clamps to Pi and non-Pi plugin tool paths, with semantic caps for high-volume reads.
- Cover budget behavior and document the operator-facing configuration contract.
Files changed:
.changeset/fn-8614-tool-output-budget.md | 7 ++
docs/agents.md | 8 ++
.../core/src/__tests__/tool-output-budget.test.ts | 58 +++++++++++++
packages/core/src/index.gate.ts | 7 ++
packages/core/src/index.ts | 7 ++
packages/core/src/tool-output-budget.ts | 97 ++++++++++++++++++++++
.../src/__tests__/agent-artifact-tools.test.ts | 10 +++
.../src/__tests__/agent-document-tools.test.ts | 10 +++
.../__tests__/agent-task-logs-read-tools.test.ts | 8 ++
.../__tests__/tool-output-budget-wrapper.test.ts | 67 +++++++++++++++
packages/engine/src/agent-session-helpers.ts | 7 +-
packages/engine/src/agent-tools.ts | 43 ++++++++--
packages/engine/src/pi.ts | 54 +++++++++++-
13 files changed, 374 insertions(+), 9 deletions(-)
Fusion-Task-Id: FN-8614
Fusion-Task-Lineage: b6a76ccd-d7b4-4b43-af7e-cfd16ffb7fc8
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-26 14:42:06 -07:00
..
2026-07-26 14:42:06 -07:00
2026-05-23 02:29:38 -07:00
2026-07-14 22:16:16 -07:00
2026-07-15 13:34:30 -07:00
2026-07-13 19:07:58 -07:00
2026-05-20 15:54:44 -07:00
2026-05-29 20:05:14 -07:00
2026-07-26 10:15:18 -07:00
2026-06-29 04:12:13 -07:00
2026-05-21 12:04:58 -07:00
2026-05-19 17:19:02 -07:00
2026-07-24 22:32:49 -07:00
2026-07-20 10:13:57 -07:00
2026-07-26 13:15:36 -07:00
2026-07-06 19:03:07 -07:00
2026-06-13 04:54:59 -07:00
2026-06-04 22:53:02 -07:00
2026-07-20 16:08:00 -07:00
2026-07-26 09:26:13 -07:00
2026-07-22 13:36:23 -07:00
2026-07-12 10:04:29 -07:00
2026-07-16 00:01:17 -07:00
2026-07-21 23:09:30 -07:00
2026-07-26 08:20:37 -07:00
2026-07-10 07:46:52 -07:00
2026-07-22 13:43:55 -07:00
2026-05-13 23:41:35 -07:00
2026-07-24 22:32:49 -07:00
2026-07-15 11:13:56 -07:00
2026-07-26 10:15:18 -07:00
2026-07-26 14:42:06 -07:00
2026-07-26 14:42:06 -07:00
2026-06-30 12:56:03 -07:00
2026-07-03 22:04:45 -07:00
2026-07-16 17:05:29 -07:00
2026-07-24 22:38:15 -07:00
2026-06-21 16:23:42 -07:00
2026-06-07 20:43:44 -07:00
2026-07-19 12:08:10 -07:00
2026-05-21 12:49:50 -07:00
2026-07-14 22:16:16 -07:00
2026-06-22 03:04:21 -07:00
2026-05-20 08:23:40 -07:00
2026-05-23 00:03:12 -07:00
2026-07-16 13:48:00 -07:00
2026-06-15 12:34:44 -07:00
2026-06-26 16:14:44 -07:00
2026-06-15 02:30:41 -07:00
2026-06-04 16:16:50 -07:00
2026-07-26 09:26:13 -07:00
2026-07-26 08:20:37 -07:00
2026-07-21 17:14:30 -07:00
2026-06-01 08:23:02 -07:00
2026-07-14 22:16:16 -07:00
2026-07-22 08:53:31 -07:00
2026-07-21 17:08:44 -07:00
2026-05-19 22:50:39 -07:00
2026-05-14 19:26:58 -07:00
2026-05-13 12:30:45 -07:00
2026-07-13 19:07:58 -07:00
2026-07-14 22:16:16 -07:00
2026-06-26 00:57:32 -07:00
2026-07-26 12:29:54 -07:00
2026-07-13 19:07:58 -07:00
2026-07-15 12:54:16 -07:00
2026-07-22 13:36:23 -07:00
2026-07-26 12:01:19 -07:00
2026-05-29 07:11:00 -07:00
2026-07-14 17:02:47 -07:00
2026-06-25 08:35:44 -07:00
2026-07-13 19:07:58 -07:00
2026-05-14 04:32:42 -07:00
2026-05-14 04:32:43 -07:00
2026-07-26 08:20:37 -07:00
2026-07-18 01:23:31 -07:00
2026-05-16 17:31:09 -07:00
2026-07-24 23:57:49 -07:00
2026-07-02 13:07:16 -07:00
2026-07-23 10:31:22 -07:00
2026-07-23 10:31:22 -07:00
2026-06-26 11:56:12 -07:00
2026-07-22 15:25:20 -07:00
2026-07-14 08:18:52 -07:00
2026-07-26 09:50:43 -07:00
2026-06-26 00:57:32 -07:00
2026-07-15 22:43:24 -07:00
2026-07-02 11:38:32 -07:00
2026-07-15 10:06:32 -07:00
2026-06-22 19:48:50 -07:00
2026-07-21 17:08:17 -07:00
2026-06-25 20:12:20 -07:00
2026-07-23 15:55:03 -07:00
2026-05-13 20:20:26 -07:00
2026-05-28 15:04:41 -07:00
2026-07-16 15:42:22 -07:00
2026-05-26 21:57:31 -07:00
2026-07-26 10:15:18 -07:00
2026-07-18 14:42:59 -07:00
2026-07-16 00:01:17 -07:00
2026-07-15 14:44:35 -07:00
2026-07-19 16:00:28 -07:00
2026-07-15 14:44:35 -07:00
2026-07-13 19:07:58 -07:00
2026-05-23 09:59:50 -07:00
2026-05-12 09:06:54 -07:00
2026-07-16 00:01:17 -07:00
2026-07-11 22:16:48 -07:00
2026-05-21 16:30:31 -07:00
2026-05-12 17:04:33 -07:00
2026-07-26 10:15:18 -07:00
2026-07-26 10:15:18 -07:00
2026-07-14 22:13:30 -07:00
2026-07-23 15:25:09 -07:00
2026-07-23 16:12:44 -07:00
2026-07-19 22:43:13 -07:00
2026-07-19 22:43:13 -07:00
2026-06-13 16:16:52 -07:00
2026-06-19 23:50:37 +00:00
2026-07-21 17:14:30 -07:00
2026-05-07 23:21:05 -07:00
2026-05-10 19:13:05 -07:00
2026-05-16 17:31:09 -07:00
2026-07-26 10:15:18 -07:00
2026-07-14 20:27:35 -07:00
2026-07-14 20:27:35 -07:00
2026-07-14 20:27:35 -07:00
2026-07-09 19:58:06 -07:00
2026-07-16 21:42:44 -07:00
2026-07-14 20:27:35 -07:00
2026-07-14 20:27:35 -07:00
2026-07-26 08:26:20 -07:00
2026-07-22 13:36:23 -07:00
2026-07-26 14:42:06 -07:00
2026-07-25 20:46:07 -07:00
2026-07-26 00:46:07 -07:00
2026-07-04 21:28:16 -07:00
2026-07-26 02:28:04 -07:00
2026-07-21 23:32:18 -07:00
2026-06-04 12:44:43 -07:00
2026-07-26 12:01:19 -07:00
2026-06-04 07:34:02 -07:00
2026-06-07 21:19:10 -07:00
2026-07-14 12:41:10 -07:00
2026-05-19 19:28:05 -07:00
2026-07-17 17:28:09 -07:00
2026-07-13 19:07:58 -07:00
2026-07-16 21:07:06 -07:00
2026-07-13 19:07:58 -07:00
2026-07-23 21:43:58 -07:00
2026-07-19 16:52:02 -07:00
2026-07-21 23:32:18 -07:00
2026-07-13 19:07:58 -07:00
2026-07-19 16:52:02 -07:00
2026-06-11 21:00:23 -07:00
2026-07-22 14:42:04 -07:00
2026-07-21 17:14:30 -07:00
2026-07-26 12:01:19 -07:00
2026-07-21 17:08:44 -07:00
2026-07-21 17:08:44 -07:00
2026-07-26 10:53:04 -07:00
2026-07-24 23:57:49 -07:00
2026-07-21 17:06:26 -07:00
2026-07-13 19:07:58 -07:00
2026-07-13 19:07:58 -07:00
2026-07-10 22:25:21 -07:00
2026-07-15 20:53:05 -07:00
2026-07-21 17:08:44 -07:00
2026-07-01 16:38:27 -07:00
2026-07-22 08:53:31 -07:00
2026-05-17 02:08:01 -07:00
2026-05-21 00:17:33 -07:00
2026-07-16 16:34:09 -07:00
2026-07-26 08:26:20 -07:00
2026-07-26 09:26:13 -07:00
2026-07-26 09:50:43 -07:00
2026-07-15 19:43:08 -07:00
2026-07-26 10:15:18 -07:00
2026-07-26 02:04:40 -07:00
2026-05-19 14:22:11 -07:00
2026-07-16 00:01:17 -07:00
2026-07-16 00:01:17 -07:00
2026-07-16 15:42:22 -07:00
2026-07-16 15:42:22 -07:00
2026-07-26 13:16:13 -07:00
2026-07-26 08:20:37 -07:00
2026-07-19 15:38:31 -07:00
2026-07-26 09:50:43 -07:00
2026-05-23 14:26:57 -07:00
2026-05-30 21:53:00 -07:00
2026-05-14 05:55:16 -07:00
2026-06-04 14:01:55 -07:00
2026-07-26 10:15:18 -07:00
2026-07-25 23:44:56 -07:00
2026-05-31 23:24:53 -07:00
2026-07-26 09:50:43 -07:00
2026-06-23 10:30:50 -07:00
2026-05-12 17:24:44 -07:00
2026-07-05 11:31:48 -07:00
2026-07-16 01:52:10 -07:00
2026-05-28 21:23:48 -07:00
2026-07-14 08:17:36 -07:00
2026-07-25 14:59:53 -07:00
2026-07-25 14:59:53 -07:00
2026-07-15 20:14:25 -07:00
2026-05-18 00:53:23 -07:00
2026-07-26 13:15:36 -07:00
2026-07-17 17:28:36 -07:00
2026-07-23 17:27:59 -07:00
2026-07-15 08:44:11 -07:00
2026-05-19 19:28:05 -07:00
2026-07-26 09:50:43 -07:00
2026-05-08 18:59:08 -07:00
2026-07-26 02:04:40 -07:00
2026-06-29 10:32:51 -07:00
2026-07-01 00:51:01 -07:00
2026-06-04 07:34:02 -07:00
2026-07-26 12:24:29 -07:00
2026-07-26 10:15:18 -07:00
2026-06-25 22:33:08 -07:00
2026-07-26 12:29:54 -07:00
2026-06-11 08:43:27 -07:00
2026-07-15 15:34:43 -07:00
2026-07-22 15:07:59 -07:00
2026-07-01 00:51:01 -07:00
2026-07-01 00:51:01 -07:00
2026-07-01 00:51:01 -07:00
2026-07-01 00:51:01 -07:00
2026-06-30 00:09:36 -07:00
2026-07-21 17:06:26 -07:00
2026-07-19 22:07:55 -07:00
2026-07-19 22:07:55 -07:00
2026-07-07 10:25:11 -07:00
2026-06-21 23:02:46 -07:00
2026-07-19 17:05:05 -07:00
2026-07-16 13:48:00 -07:00
2026-06-25 08:34:44 -07:00
2026-07-14 22:16:16 -07:00
2026-05-18 01:50:22 -07:00
2026-07-26 12:01:19 -07:00
2026-06-04 13:04:15 -07:00
2026-06-12 12:49:34 -07:00
2026-07-19 23:47:53 -07:00
2026-07-26 10:15:18 -07:00
2026-05-18 11:01:32 -07:00
2026-05-23 15:13:17 -07:00
2026-05-16 20:54:33 -07:00
2026-05-18 15:51:01 -07:00
2026-05-15 22:18:09 -07:00
2026-07-13 19:07:58 -07:00