Skip to content

Commit d6af00c

Browse files
author
Your Name
committed
Convert charachters to tokens (roughly) for command pagination
1 parent f90e62d commit d6af00c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cecli/tools/command.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,9 @@ async def _execute_with_timeout(cls, coder, command_string, timeout, use_pty=Fal
245245

246246
# Format output
247247
output_content = output or ""
248-
output_limit = coder.large_file_token_threshold
248+
# Tokens are roughly 3-4 characters
249+
output_limit = coder.large_file_token_threshold * 3.5
250+
249251
if coder.context_management_enabled and len(output_content) > output_limit * 1.25:
250252
# Save full output to paginated files instead of truncating
251253
folder_path, file_list, alias_paths = (
@@ -266,8 +268,8 @@ async def _execute_with_timeout(cls, coder, command_string, timeout, use_pty=Fal
266268
f"File Aliases (for use with ContextManager):\n{alias_list_str}\n"
267269
"Use the `ContextManager` tool to view these files."
268270
"Do not use standard cli tools to view these files."
269-
"Remove them from context after taking note of the relevant information "
270-
"in the output to prevent overfilling stale context."
271+
"Remove them from context after taking notes on the relevant information "
272+
"to prevent overfilling stale context."
271273
)
272274

273275
# Remove from background tracking since it's done

0 commit comments

Comments
 (0)