mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-22 01:02:16 +00:00
Implement tool result truncation with actionable notices (#134)
- read: actionable notices with offset for continuation - First line > 30KB: return empty + bash command suggestion - Hit limit: '[Showing lines X-Y of Z. Use offset=N to continue]' - bash: tail truncation with temp file - Notice includes line range + temp file path - Edge case: last line > 30KB shows partial - grep: pre-truncate match lines to 500 chars - '[... truncated]' suffix on long lines - Notice for match limit and line truncation - find/ls: result/entry limit notices - '[N results limit reached. Use limit=M for more]' - All notices now in text content (LLM sees them) - TUI simplified (notices render as part of output) - Never return partial lines (except bash edge case)
This commit is contained in:
parent
de77cd1419
commit
b813a8b92b
9 changed files with 465 additions and 164 deletions
|
|
@ -118,7 +118,8 @@ describe("Context overflow error handling", () => {
|
|||
|
||||
describe.skipIf(!process.env.OPENAI_API_KEY)("OpenAI Completions", () => {
|
||||
it("gpt-4o-mini - should detect overflow via isContextOverflow", async () => {
|
||||
const model = getModel("openai", "gpt-4o-mini");
|
||||
const model = { ...getModel("openai", "gpt-4o-mini") };
|
||||
model.api = "openai-completions" as any;
|
||||
const result = await testContextOverflow(model, process.env.OPENAI_API_KEY!);
|
||||
logResult(result);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue