Normalize whitespace in grid get_process_output to save tokens
Grid snapshots pad every row to the full terminal width and leave the bottom of the screen blank, so MCP grid reads carried a lot of dead whitespace. Add normalizeGridText (CRLF/lone-CR to LF, right-trim each line, collapse blank runs to a single blank, drop leading/trailing blanks) and apply it to the grid branch of GetProcessOutput only. Stream output, raw output, and WaitForPattern matching are untouched. Resolves the terminal-read newline/token-waste TODO item.
This commit is contained in:
1
TODO.md
1
TODO.md
@@ -1,4 +1,3 @@
|
||||
- [ ] We should deduplicate /r/n newlines or /n newlines to save tokens on mcp responses for terminal reads.
|
||||
- [ ] Codex idle detection seems to trigger too soon, see below [CODEX IDLE]
|
||||
- [ ] Issue with mcp timing out [MCP TIMEOUT]
|
||||
- [ ] When opening a codex sub agent, the message gets input to the field, but the message is never submitted.
|
||||
|
||||
Reference in New Issue
Block a user