Commit Graph

2 Commits

Author SHA1 Message Date
JackChen c3ead26677
feat: add tool output auto-truncation (#110) (#115)
* feat: add tool output auto-truncation at framework level (#110)

Prevent context blowup from large tool outputs by adding opt-in
character-based truncation (head 70% + tail 30% with marker).
Agent-level `maxToolOutputChars` and per-tool `maxOutputChars`
with per-tool taking priority. Marker overhead is budgeted so
the result never exceeds the configured limit.

* fix: truncateToolOutput may exceed maxChars when limit < marker overhead

- Fall back to hard slice when maxChars is too small to fit the marker
- Fix misplaced JSDoc for outputSchema in AgentConfig
- Tighten test assertion to verify length <= maxChars
2026-04-16 17:40:08 +08:00
JackChen a772312a68 chore: add tests, CI, contributing guide, and PR template
- 5 test files, 61 test cases covering TaskQueue, SharedMemory,
  ToolExecutor, ToolRegistry, and Semaphore
- GitHub Actions CI running lint + test on Node 18/20/22
- CONTRIBUTING.md with setup, commands, and PR workflow
- Pull request template with checklist
2026-04-02 23:43:54 +08:00