Commit graph

15 commits

Author SHA1 Message Date
Mario Zechner
b813a8b92b 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
10a1e1ef90 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
Mario Zechner
233917c6d1 docs(coding-agent): add compaction to RPC protocol documentation 2025-12-04 02:51:27 +01:00
Mario Zechner
989af79752 fix: normalize OpenAI token counting, add branch source tracking
pi-ai:
- Fixed usage.input to exclude cached tokens for OpenAI providers
- Previously input included cached tokens, causing double-counting
- Now input + output + cacheRead + cacheWrite correctly gives total context

coding-agent:
- Session header now includes branchedFrom field for branched sessions
- Updated compaction.md with refined implementation plan
- Updated session.md with branchedFrom documentation
2025-12-03 17:11:22 +01:00
Mario Zechner
9d5fe1fe85 Update session docs: add type definition links, reorder sections 2025-12-03 15:44:33 +01:00
Mario Zechner
9ed1c4e7ba Clean up docs, add session format documentation 2025-12-03 15:42:56 +01:00
Mario Zechner
011e8d705a Add RPC protocol documentation with tool call correlation 2025-12-03 15:28:17 +01:00
Mario Zechner
1c18b8006f Add auto-compaction trigger flow and maxTokens calculation 2025-12-02 16:17:05 +01:00
Mario Zechner
50b334f88a Add compaction examples and /branch interaction 2025-12-02 16:09:46 +01:00
Mario Zechner
5daef11b4c Add compaction research and implementation plan 2025-12-02 16:00:52 +01:00
Mario Zechner
85adcf22bf Release v0.8.0 2025-11-21 03:12:42 +01:00
Mario Zechner
cc88095140 WIP: Add theming system with /theme command
- Consolidated theme system into single src/theme/ directory
- Created Theme class with fg(), bg(), bold(), italic(), underline()
- Added dark and light built-in themes with 36 color tokens
- Support for custom themes in ~/.pi/agent/themes/*.json
- JSON schema for theme validation
- Theme selector UI with /theme command
- Save theme preference to settings
- Uses chalk for text formatting to preserve colors

TODO:
- Replace hardcoded colors throughout TUI components
- Apply markdown theming to Markdown components
- Add theme support to all TUI elements
2025-11-20 23:16:59 +01:00
Mario Zechner
1f68d6eb40 Release v0.7.22 2025-11-19 01:50:45 +01:00
Mario Zechner
587d7c39a4 feat(coding-agent): add OAuth authentication for Claude Pro/Max
- Add /login and /logout commands for OAuth flow
- OAuth tokens stored in ~/.pi/agent/oauth.json with 0600 permissions
- Auto-refresh tokens when expired (5min buffer)
- Priority: OAuth > ANTHROPIC_OAUTH_TOKEN env > ANTHROPIC_API_KEY env
- Fix model selector async loading and re-render
- Add bracketed paste support to Input component for long codes
- Update README.md with OAuth documentation
- Add implementation docs and testing checklist
2025-11-18 17:33:33 +01:00
Mario Zechner
bc670bc63c Fix lockstep versioning and improve documentation
- Sync all packages to version 0.7.7
- Rewrite sync-versions.js to handle ALL inter-package dependencies automatically
- Fix web-ui dependency on pi-ai (was 0.6.0, now 0.7.7)
- Move agent fix changelog entry to coding-agent CHANGELOG
- Remove redundant agent CHANGELOG.md
- Improve README.md with clearer lockstep versioning docs
- Add /changelog command to display full changelog in TUI (newest last)
- Fix changelog description (not a scrollable viewer, just displays in chat)
- Update CHANGELOG for 0.7.7 release
2025-11-13 23:37:43 +01:00