Fixes#39
- Added headers field to Model type (provider and model level)
- Model headers override provider headers when merged
- Supported in all APIs:
- Anthropic: defaultHeaders
- OpenAI (completions/responses): defaultHeaders
- Google: httpOptions.headers
- Enables bypassing Cloudflare bot detection for proxied endpoints
- Updated documentation with examples
Also fixed:
- Mistral/Chutes syntax error (iif -> if)
- process.env.ANTHROPIC_API_KEY bug (use delete instead of = undefined)
- Add --models CLI arg accepting comma-separated patterns
- Implement smart matching: prefers aliases over dated versions
- Add Ctrl+P to cycle through scoped models (or all if no scope)
- Show model scope hint at startup
- Update help text with examples
Co-authored-by: Tino Ehrich <tino.ehrich@hey.com>
Tab key was preventing file path autocomplete from working.
Changed to Ctrl+T to avoid conflict with Tab completion.
- Tab now works normally for file/path autocomplete
- Ctrl+T cycles through thinking levels
- Shows message if model doesn't support thinking
The horizontal borders around the input editor now change color based on
the current thinking level, providing immediate visual feedback:
- off: gray (default)
- minimal: dim blue
- low: blue
- medium: cyan
- high: magenta
The more thinking, the brighter/more vibrant the color.
Changes:
- Add public borderColor property to Editor component (packages/tui)
- Use borderColor instead of hardcoded chalk.gray for borders
- Add getThinkingBorderColor() helper in TuiRenderer
- Add updateEditorBorderColor() to apply color changes
- Update border color when:
- Cycling with Tab key
- Selecting via /thinking command
- Restoring session with thinking level set
- Add onTab callback to CustomEditor
- Implement cycleThinkingLevel() in TuiRenderer
- Only works when model supports reasoning
- Cycles through: off → minimal → low → medium → high → off
- Update footer to show current thinking level with '(tab to cycle)' hint
- Update header instructions to mention tab for thinking
- Show notification when thinking level changes
- Created shared wrapTextWithAnsi() function in utils.ts
- Handles word-based wrapping while preserving ANSI escape codes
- Properly tracks active ANSI codes across wrapped lines
- Supports multi-byte characters (emoji, surrogate pairs)
- Updated Markdown and Text components to use shared wrapping
- Removed duplicate wrapping logic (158 lines total)
- Convert thinking blocks with missing/empty signatures to text blocks
- Prevents 400 error: 'Invalid signature in thinking block'
- Occurs when stream is aborted mid-thinking and message is resubmitted
- Use 'charCodeAt(0) >= 32' instead of open 'else' in handleInput()
- Use same filter in handlePaste() for consistency
- Prevents control characters while allowing all unicode
- More explicit and safer than accepting everything
- Add ~/.pi/agent/models.json config for custom providers (Ollama, vLLM, etc.)
- Support all 4 API types (openai-completions, openai-responses, anthropic-messages, google-generative-ai)
- Live reload models.json on /model selector open
- Smart model defaults per provider (claude-sonnet-4-5, gpt-5.1-codex, etc.)
- Graceful session fallback when saved model missing or no API key
- Validation errors show precise file/field info in CLI and TUI
- Agent knows its own README.md path for self-documentation
- Added gpt-5.1-codex (400k context, 128k output, reasoning)
Fixes#21
- Model selector now only shows models with configured API keys
- Added yellow hint in model selector UI explaining the filtering
- Updated README.md to document the filtering behavior in both API Keys and /model sections
- Bumped version to 0.7.11