You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terminal_read pages retained scrollback by newest-relative offset and count. With backend log output running to tens of thousands of lines, a model cannot tell where the interesting lines are: it has to page backward from the newest output one page at a time, and totalLines alone does not locate a needle in the retained buffer. The tool surface has pagination but no way to find lines by content.
Proposed feature
A new model-facing terminal_search tool that searches retained scrollback by regular expression:
Returns matching lines newest first, each with a newest-relative offset that is directly usable as a terminal_read offset — the model jumps to a match's surrounding context in one follow-up call instead of blind paging.
Returns the exact matchCount, the retained totalLines, and truncated.
offset / limit page over matches (skip the newest matches, cap the returned page), mirroring terminal_read pagination.
Shares read's byte bound (maxReadBytes, cutting the oldest side so the newest matches survive) and the consumer's maxResultBytes cap.
Reference implementation
A complete, tested implementation is ready on a fork branch: ystyle/deepseek-harness:feat/terminal-search (commit 92a251077c), ready to open as a PR once the contribution channel opens.
Scope: seam types TerminalSearchRequest / TerminalSearchMatch / TerminalSearchResult plus TerminalBackendSession.search() and TerminalSessionService.search() in @deepseek-ai/dsh-terminal; the regex search over retained scrollback in @deepseek-ai/dsh-terminal-bash; the terminal_search tool and its rendering in @deepseek-ai/dsh-tool-terminal. Docs, generated catalogs, package READMEs (en/zh), and an Agent Note are updated in the same change. Validation: typecheck, lint, 146 affected unit tests (including the real-PTY suite), and all 28 doc-sync gates pass.
Happy to adapt the design or split the change per the team's preference.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
terminal_readpages retained scrollback by newest-relativeoffsetandcount. With backend log output running to tens of thousands of lines, a model cannot tell where the interesting lines are: it has to page backward from the newest output one page at a time, andtotalLinesalone does not locate a needle in the retained buffer. The tool surface has pagination but no way to find lines by content.Proposed feature
A new model-facing
terminal_searchtool that searches retained scrollback by regular expression:offsetthat is directly usable as aterminal_readoffset — the model jumps to a match's surrounding context in one follow-up call instead of blind paging.matchCount, the retainedtotalLines, andtruncated.offset/limitpage over matches (skip the newest matches, cap the returned page), mirroringterminal_readpagination.read's byte bound (maxReadBytes, cutting the oldest side so the newest matches survive) and the consumer'smaxResultBytescap.Reference implementation
A complete, tested implementation is ready on a fork branch:
ystyle/deepseek-harness:feat/terminal-search(commit92a251077c), ready to open as a PR once the contribution channel opens.Scope: seam types
TerminalSearchRequest/TerminalSearchMatch/TerminalSearchResultplusTerminalBackendSession.search()andTerminalSessionService.search()in@deepseek-ai/dsh-terminal; the regex search over retained scrollback in@deepseek-ai/dsh-terminal-bash; theterminal_searchtool and its rendering in@deepseek-ai/dsh-tool-terminal. Docs, generated catalogs, package READMEs (en/zh), and an Agent Note are updated in the same change. Validation:typecheck,lint, 146 affected unit tests (including the real-PTY suite), and all 28doc-syncgates pass.Happy to adapt the design or split the change per the team's preference.
中文摘要
terminal_read只能按 offset/count 从最新输出往回翻页;日志达到数万行时,模型无法定位目标行,只能盲目翻页。建议新增terminal_search工具:按正则表达式搜索保留的 scrollback,返回最新优先的匹配行,每行携带 newest-relative offset(可直接配合terminal_read跳转查看上下文),并返回精确匹配数与保留行数。完整实现、测试与文档已在 fork 分支ystyle/deepseek-harness:feat/terminal-search(commit92a251077c),贡献渠道开放后可随时转为 PR。All reactions