Tinker
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Resources
Agent logs
Agent memories
Agent sessions
Agent terminal logs
Agents
Comments
Epics
Projects
Proposals
Tickets
Avo user
Home
Epics
Refactor get_terminal_logs MCP: line-based limiting with TerminalLogCleaner
Edit
Refactor get_terminal_logs MCP: line-based limiting with TerminalLogCleaner
Cancel
Save
Title
*
Project
*
Choose an option
alpha
tinker
Create new project
Description
## Problem The current `get_terminal_logs` MCP implementation returns logs in chunks (~500 lines each) with `limit` controlling number of chunks. This is awkward for callers who want a specific number of lines. ## Requirements 1. **Use TerminalLogCleaner**: Apply the existing `TerminalLogCleaner` class to filter/clean log output before returning 2. **Line-based limit**: Change `limit` parameter to mean "number of lines" instead of "number of chunks" - Current: `limit=1` returns 1 chunk (~500 lines) - New: `limit=100` returns 100 lines 3. **Smart chunk consumption**: When a chunk doesn't contain enough lines to satisfy `limit`, automatically fetch the next chunk - Must respect `session_id` / `all_sessions` parameters - Continue fetching chunks until `limit` lines are reached or no more logs exist 4. **Joined output**: Return a single string of joined lines, not an array of chunks ## Example Behavior ``` limit=100, chunk_size=500 → Chunk 1 has 500 lines → Take first 100 lines → Return: 100-line string (not the full chunk) limit=1000, chunk_size=500 → Chunk 1: 500 lines → Chunk 2: 500 lines → Take all 1000 lines → Return: 1000-line joined string ``` ## Notes - `TerminalLogCleaner` already exists in the codebase - reference it for the filtering logic - Pagination via `offset` should still work (offset in lines, not chunks) - `order=desc` (tail) behavior should remain: get chunks in reverse order, then join
Avo
· © 2026 AvoHQ ·
v3.27.0
Close modal
Are you sure?
Yes, I'm sure
No, cancel