feat(core): recover truncated tool output via the Session scratchpad (#145)

Co-authored-by: Yaowei Zheng <hiyouga@buaa.edu.cn>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-08-03 13:17:42 +08:00
1 parent 84949882ab
commit a798bca87f
30 files changed
+1393 -47

No files matched your search

+8
View File
@@ -275,6 +275,14 @@ export interface EnvironmentServices {
export interface EnvironmentConfig {
workspaceDir: string;
toolConfig: ToolConfig;
/**
* This Session's private scratchpad directory (`scratchpad/<sessionId>`), the generic
* Session-scoped storage root for Environment by-products. Currently it backs
* truncated-tool-output recovery: output beyond an entry's `maxOutputLength` is saved under
* `<sessionScratchpadDir>/truncated-tool-output/`. Agent Sessions always pass it; standalone
* embedders without a stable Session directory omit it and keep truncation-only behavior.
*/
sessionScratchpadDir?: string;
/** Runtime services (optional); Environment forwards these to each tool factory to use as needed. */
services?: EnvironmentServices;
/**