Commit Graph
1628 Commits
Author SHA1 Message Date
Mario Zechner 62f1c815de 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)
2025-12-07 01:11:31 +01:00
Mario Zechner ceb79820fe Add tool output truncation with line/byte limits
- Add truncate.ts utility with truncateHead/truncateTail functions
- Both respect 2000 line and 30KB limits (whichever hits first)
- read: head truncation, returns truncation info in details
- bash: tail truncation, writes full output to temp file if large
- grep: head truncation + 100 match limit
- find: head truncation + 1000 result limit
- ls: head truncation + 500 entry limit
- tool-execution.ts displays truncation notices in warning color
- All tools return clean output + structured truncation in details
2025-12-07 00:03:16 +01:00
Mario Zechner 159a6e7df6 Release v0.13.1 2025-12-06 23:12:36 +01:00
Mario Zechner 97ca6ccf65 Add [Unreleased] section to CHANGELOG 2025-12-06 22:49:45 +01:00
Mario Zechner 30cc0005e9 Release v0.13.0 2025-12-06 22:48:39 +01:00
Mario Zechner 92c654a872 Add totalTokens field to Usage type
- Added totalTokens field to Usage interface in pi-ai
- Anthropic: computed as input + output + cacheRead + cacheWrite
- OpenAI/Google: uses native total_tokens/totalTokenCount
- Fixed openai-completions to compute totalTokens when reasoning tokens present
- Updated calculateContextTokens() to use totalTokens field
- Added comprehensive test covering 13 providers

fixes #130
2025-12-06 22:46:02 +01:00
badlogic 6c1b4ceac2 Fix Windows binary detection for Bun compiled executables
- Updated isBunBinary detection to check for %7EBUN (URL-encoded ~BUN)
- Simplified build:binary script to remove Unix-specific shell syntax
- Binary now correctly locates supporting files next to executable on Windows
2025-12-06 22:42:47 +01:00
Mario Zechner ba06412933 Release v0.12.15 2025-12-06 21:29:03 +01:00
Mario Zechner 4c95e53dc2 Fix editor crash with wide characters (emojis, CJK)
Editor text wrapping now uses grapheme-aware width calculation instead
of string length. Fixes crash when pasting text containing emojis like
✅ or CJK characters that are 2 terminal columns wide.
2025-12-06 21:24:26 +01:00
Mario Zechner 0c4d9bc2fd Add context overflow detection utilities
Extract overflow detection logic into reusable utilities:
- isContextOverflowError() to detect overflow from error messages
- isContextOverflowFromUsage() to detect overflow from token usage
- Patterns for Anthropic, OpenAI, Google, xAI, Groq, OpenRouter, llama.cpp, LM Studio

Fixes #129
2025-12-06 21:24:15 +01:00
Mario Zechner 80a2667606 docs: add under-compaction analysis
Documents context window overflow scenarios, how OpenCode and Codex
handle them, and what fixes are needed.

Related to #128
2025-12-06 14:53:05 +01:00
Peter SteinbergerandGitHub 4d3dfe62ae docs: fix mini-lit links (#123) 2025-12-06 09:56:31 +01:00
Mario Zechner df717c75dc Fix wrap-ansi test to use node:test instead of vitest 2025-12-06 00:48:46 +01:00
Mario Zechner e20b345051 Release v0.12.14 2025-12-06 00:46:57 +01:00
Mario Zechner 0125ab997f Release v0.12.13 2025-12-05 23:38:32 +01:00
Mario Zechner 83f1bea0d2 Add changelog entry for parallel version check 2025-12-05 23:36:30 +01:00
Mario Zechner b31077f252 Run version check in parallel with TUI startup
Instead of blocking startup for up to 1 second waiting for the version check,
run it in the background and insert the notification into chat when it completes.
2025-12-05 23:36:06 +01:00
Mario Zechner 01f06b2b22 Add [Unreleased] section 2025-12-05 23:01:46 +01:00
Mario Zechner 5fb8563279 Release v0.12.12 2025-12-05 23:00:45 +01:00
Mario Zechner b10fa86ff9 Merge branch 'feat/resume-slash-command' 2025-12-05 22:54:03 +01:00
Mario Zechner 3be445de80 feat(coding-agent): add /resume command to switch sessions mid-conversation
- Opens interactive session selector
- Properly aborts in-flight agent turns before switching
- Restores model and thinking level from resumed session
- Clears UI state (queued messages, pending tools, etc.)

closes #117
2025-12-05 22:53:51 +01:00
Mario Zechner a6867016df Merge feat/scroll-previous-prompts with history load on resume 2025-12-05 22:02:16 +01:00
Mario Zechner 13e3f8d935 feat(tui): add prompt history navigation with Up/Down arrows
- Browse previously submitted prompts using Up/Down arrow keys
- History is session-scoped and stores up to 100 entries
- Load history from session on continue/resume
- Includes 15 tests for history navigation

fixes #121
2025-12-05 22:00:23 +01:00
Mario Zechner 33217d4d7c fix: escape codes not properly wrapped during line wrapping
- ANSI codes now attach to next visible content, not trailing whitespace
- Rewrote AnsiCodeTracker to track individual attributes
- Line-end resets only turn off underline, preserving background colors
- Added vitest config to exclude node:test files

fixes #109
2025-12-05 21:49:44 +01:00
Markus YlisiurunenandGitHub 3ca9d6f70a Implement fuzzy search for model/session selector and improve Input multi-key sequence handling (#122)
* implement fuzzy search and filtering for tui selectors

* update changelog and readme

* add correct pr to changelog
2025-12-05 20:33:04 +01:00
Nico Bailon b9525642cf feat(tui): add prompt history navigation with Up/Down arrows
Browse previously submitted prompts using Up/Down arrow keys, similar to
shell history and Claude Code's prompt history feature.

- Up arrow when editor is empty: browse to older prompts
- Down arrow when browsing: return to newer prompts or clear editor
- Cursor movement within multi-line history entries supported
- History is session-scoped, stores up to 100 entries
- Consecutive duplicates are not added to history

Includes 15 new tests for history navigation behavior.
2025-12-05 07:57:42 -08:00
Mario Zechner fb52ec81e3 docs: add changelog entry for footer display changes 2025-12-05 12:22:30 +01:00
Mario Zechner 73baa40d9c fix: make footer token counts more compact
- Use M suffix for millions (e.g., 10.2M instead of 10184k)
- Change '% of' to '%/' for context display
2025-12-05 12:21:44 +01:00
Mario Zechner d9f1698b6d Add [Unreleased] section 2025-12-05 12:20:35 +01:00
Mario Zechner 05f885ce83 Release v0.12.11 2025-12-05 12:19:37 +01:00
Mario Zechner 39b434c801 fix: footer overflow crash on narrow terminals
Footer stats line now truncates gracefully when terminal width is too
narrow to fit all stats, instead of overflowing and crashing the TUI.
2025-12-05 12:17:56 +01:00
Mario Zechner bf2c8aae44 fix: strip remaining escape sequences from bash output
stripAnsi misses some escape sequences like standalone ESC \ (String
Terminator) which caused rendering issues when displaying captured TUI
output. Now also removes any remaining ESC+char sequences and control
characters after stripAnsi processing.
2025-12-05 12:13:33 +01:00
Mario Zechner 4e1bcd616d fix: TUI crash with Unicode characters in branch selector
- Use truncateToWidth instead of substring in user-message-selector.ts
- Fix truncateToWidth to use Intl.Segmenter for proper grapheme handling
- Add tests for Unicode truncation behavior
2025-12-05 11:59:39 +01:00
Hew Li Yang 92ac94b4c0 wip: changelog 2025-12-05 18:56:44 +08:00
Hew Li Yang 787706a487 wip: add /resume slash command 2025-12-05 18:49:24 +08:00
Mario Zechner 4146c4d684 Document authHeader option in README 2025-12-05 11:32:59 +01:00
Mario Zechner 155360a191 Add authHeader option and fix print mode error handling
- Add 'authHeader' boolean option to models.json provider config
  When true, adds 'Authorization: Bearer <apiKey>' to model headers
  Useful for providers requiring explicit auth headers (fixes #81)

- Fix print mode (-p) silently failing on errors
  Now outputs error message to stderr and exits with code 1
  when assistant message has stopReason of error/aborted
2025-12-05 11:31:14 +01:00
Mario Zechner 6de565595a Improve compaction UI styling
- Simplified collapsed state: warning-colored text instead of styled banner
- Shows token count inline: 'Earlier messages compacted from X tokens'
- Removed redundant success message after compaction
- Cleaner vertical spacing using paddingY instead of explicit Spacers

Fixes #108
2025-12-05 11:05:04 +01:00
Mario Zechner 4e229ab4fe Merge hide-thinking branch (PR #113) 2025-12-05 10:48:53 +01:00
Mario Zechner 4473d5aca3 Fix spacer after hidden thinking block, add contributor link to CHANGELOG 2025-12-05 10:48:28 +01:00
Mario Zechner 28bd7ee905 Add contributor link to CHANGELOG entry 2025-12-05 10:37:14 +01:00
Markus Ylisiurunen 11bda7ffd9 add ctrl+t shortcut to toggle llm thinking block visibility 2025-12-05 09:48:35 +02:00
Markus Ylisiurunen 9e60b41077 allow toggling visibility of the assistant's thinking block 2025-12-05 09:43:09 +02:00
Markus Ylisiurunen 80c3913ccf document the new --append-system-prompt flag 2025-12-05 09:30:05 +02:00
Markus Ylisiurunen 9d7d7b6a25 support appending content to the system prompt via cli argument 2025-12-05 09:25:10 +02:00
Mario Zechner 0fc0ddd462 fix(mom): clarify attach tool only works with /workspace/ files 2025-12-05 02:38:11 +01:00
Markus YlisiurunenandGitHub 2583d8701c improve readability of context usage display calculation (#111) 2025-12-05 01:38:31 +01:00
Mario Zechner 091a783434 fix(mom): handle Slack msg_too_long errors gracefully
- Add try/catch to all Slack API calls in promise chain
- Truncate main channel messages at 35K with elaboration note
- Truncate thread messages at 20K
- Prevents process crash on long messages
2025-12-04 23:39:17 +01:00
Mario Zechner 1d11267401 Release v0.12.10 2025-12-04 20:51:57 +01:00
Markus Ylisiurunen 64240d9a46 reduce child process stdout and stderr buffer limits in tui renderer 2025-12-04 20:29:29 +02:00