Commit Graph

1017 Commits

Author SHA1 Message Date
Mario Zechner 0384923bea Add configurable OAuth storage backend and respect --models in model selector
- Add setOAuthStorage() and resetOAuthStorage() to pi-ai for custom storage backends
- Configure coding-agent to use its own configurable OAuth path via getOAuthPath()
- Model selector (/model command) now only shows models from --models scope when set
- Rewrite OAuth documentation in pi-ai README with examples

Fixes #255
2025-12-20 22:00:53 +01:00
Mario Zechner 3116da0e59 docs(coding-agent): add changelog entry for interruptible tool execution 2025-12-20 21:37:06 +01:00
Peter Steinberger 1d592f4e82 docs(ai): add queued steering changelog 2025-12-20 21:34:53 +01:00
Peter Steinberger 362b50a151 feat(ai): interrupt tool batch on queued messages 2025-12-20 21:34:53 +01:00
Mario Zechner c9031636a1 Add OAuth providers to test suite and improve test coverage
Tests updated:
- abort.test.ts: Add Google Gemini CLI, add retries
- agent.test.ts: Add OAuth providers (Anthropic, GitHub Copilot, Gemini CLI, Antigravity), add retries, remove timeouts
- context-overflow.test.ts: Handle Cerebras 429 status code
- image-tool-result.test.ts: Add OAuth providers
- overflow.ts: Detect 429 as overflow for Cerebras

Removed obsolete debug/one-off tests:
- copilot-initiator.test.ts
- gemini-3-flash-tool-calling.test.ts
- google-thought-signature.test.ts
- mistral-debug.test.ts
- mistral-empty-assistant.test.ts
- mistral-sdk.test.ts
2025-12-20 21:34:19 +01:00
Mario Zechner 20f7cf0d6a Fix orphaned tool calls by inserting synthetic empty results
When a user interrupts a tool call flow (sends a message without providing
tool results), APIs like OpenAI Responses and Anthropic fail because:
- OpenAI requires tool outputs for function calls
- OpenAI requires reasoning items to have their following items
- Anthropic requires non-empty content for error tool results

Instead of filtering out orphaned tool calls (which breaks thinking signatures),
we now insert synthetic empty tool results with isError: true and content
'No result provided'. This preserves the conversation structure and satisfies
all API requirements.
2025-12-20 21:34:19 +01:00
Mario Zechner 36fc333639 Broader testing, more providers. 2025-12-20 21:34:19 +01:00
Mario Zechner 95dc04d6cb Fix token counts in google-gemini-cli.ts for anthropic models. 2025-12-20 21:34:18 +01:00
Mario Zechner b2be48bab3 Add out.jsonl to gitignore 2025-12-20 21:34:18 +01:00
Mario Zechner 0fe6361528 Add Google Gemini CLI and Antigravity OAuth providers
- Add google-gemini-cli provider: free Gemini 2.0/2.5 via Cloud Code Assist
- Add google-antigravity provider: free Gemini 3, Claude, GPT-OSS via sandbox
- Move OAuth infrastructure from coding-agent to ai package
- Fix thinking signature handling for cross-model handoff
- Fix OpenAI message ID length limit (max 64 chars)
- Add GitHub Copilot overflow pattern detection
- Add OAuth provider tests for context overflow and streaming
2025-12-20 21:34:18 +01:00
Mario Zechner 84f9356f0e Fix coloring in footer when context usage is colored 2025-12-20 21:34:18 +01:00
Mario Zechner daf11b77fc Merge pull request #261 from nicobailon/fix/mom-inline-image-attachments
fix: send Slack image attachments inline to LLM
2025-12-20 21:14:05 +01:00
Nico Bailon 1a7e5057cb fix: send Slack image attachments inline to LLM 2025-12-20 11:13:43 -08:00
Mario Zechner 7f027c68bc Merge pull request #260 from nicobailon/fix/gemini-thought-signatures
Reviewed: correctly captures and echoes back reasoning_details for Gemini 2.5+/3.x tool calls via OpenRouter
2025-12-20 17:48:12 +01:00
Nico Bailon c9c1b02fb5 fix: preserve Gemini thought signatures for tool calls 2025-12-20 07:12:37 -08:00
Mario Zechner 7d36aa9240 fix(coding-agent): fix Google Cloud project discovery
Use correct API response format (cloudaicompanionProject) and proper
onboarding flow with tierId and metadata. Add retry logic for project
provisioning which may take time.
2025-12-20 10:29:09 +01:00
Mario Zechner 1ad2ed6f6d feat(coding-agent): add Google Cloud Code Assist OAuth flow
- Add OAuth handler with PKCE flow and local callback server
- Automatic project discovery via loadCodeAssist/onboardUser endpoints
- Store credentials with projectId for API calls
- Encode token+projectId as JSON for provider to decode
- Register as 'google-cloud-code-assist' OAuth provider
2025-12-20 10:27:07 +01:00
Mario Zechner 944df61b30 feat(ai): add Google Cloud Code Assist provider
- Add new API type 'google-cloud-code-assist' for Gemini CLI / Antigravity auth
- Extract shared Google utilities to google-shared.ts
- Implement streaming provider for Cloud Code Assist endpoint
- Add 7 models: gemini-3-pro-high/low, gemini-3-flash, claude-sonnet/opus, gpt-oss

Models use OAuth authentication and have sh cost (uses Google account quota).
OAuth flow will be implemented in coding-agent in a follow-up.
2025-12-20 10:20:30 +01:00
Mario Zechner 31a97e371c docs: add changelog entry for Anthropic SDK retries 2025-12-20 09:57:03 +01:00
Mario Zechner 8310c22434 fix(ai): re-enable SDK retries for Anthropic provider
The SDK default of 2 retries handles transient HTTP failures quickly,
while coding-agent retries handle persistent errors with user feedback.
2025-12-20 09:56:11 +01:00
Mario Zechner 74c6f5ef0b fix(coding-agent): add connection error to retryable errors
Fixes #252
2025-12-20 09:55:03 +01:00
Mario Zechner 0531ecdd1a docs: add changelog entries for #251 and #253 2025-12-20 09:52:57 +01:00
Mario Zechner 7d40509555 fix(coding-agent): clamp thinking level to model capabilities
- setThinkingLevel() now clamps xhigh to high when model doesn't support it
- Model changes automatically re-clamp the current thinking level
- Fixed /model command to use session.setModel() instead of agent.setModel()
- Footer and editor border color update after model/thinking changes

Closes #253
2025-12-20 09:52:57 +01:00
Mario Zechner a78d0993cf Merge pull request #251 from shellfyred/fix/gemini-baseurl-double-path
fix(ai): prevent double API version path in Google provider URL
2025-12-20 09:35:34 +01:00
Mario Zechner 120cd8e3e7 Release v0.24.5 2025-12-19 22:09:35 +01:00
Mario Zechner 5f96a4eea4 fix(tui): fix input buffering in iTerm2 causing delayed keypresses
The cell size query response parser was incorrectly holding back Kitty
keyboard protocol sequences, thinking they might be incomplete cell size
responses. This caused Ctrl+C/Ctrl+D to require multiple presses in iTerm2.

Fixed by only waiting for more data if the buffer doesn't end with a
terminal escape sequence terminator character.
2025-12-19 22:08:36 +01:00
Mario Zechner bc9c6375d7 Release v0.24.4 2025-12-19 21:54:36 +01:00
Mario Zechner 5dbfe90028 fix(coding-agent): use key helpers for arrow keys and Enter
Fixed arrow key and Enter detection in selector components to work
with Kitty protocol when Caps Lock or Num Lock is enabled.

Updated: oauth-selector, user-message-selector, hook-selector,
hook-input, model-selector, session-selector
2025-12-19 21:53:04 +01:00
Mario Zechner 0f14045ce5 Fix outdated editor tests for grapheme-aware cursor movement 2025-12-19 21:41:28 +01:00
Cyril c52096d869 fix(ai): prevent double API version path in Google provider URL 2025-12-19 20:41:07 +00:00
Mario Zechner 301281f601 Release v0.24.3 2025-12-19 21:36:16 +01:00
Mario Zechner 8849bfbcd7 Fix footer overflow on narrow terminals, add /arminsayshi easter egg 2025-12-19 21:35:09 +01:00
Mario Zechner 9b6a79fd8a Release v0.24.2 2025-12-19 21:12:53 +01:00
Mario Zechner 66ca4ae291 fix(tui): use isBackspace and isEnter helpers in Editor
Fixes Backspace and Enter not working with Caps Lock enabled.
The Kitty protocol sends lock key bits in modifiers which broke
the raw byte detection.
2025-12-19 21:08:24 +01:00
Mario Zechner 59a14dc8b5 fix(tui): add isHome, isEnd, isDelete helpers for Kitty protocol
Extended the Kitty protocol parser to handle functional keys with
~ terminator (Delete, Insert, PageUp, PageDown) and Home/End keys.
Updated editor.ts and input.ts to use the new helpers.
2025-12-19 21:00:20 +01:00
Mario Zechner e50b3caf00 fix(tui): use isEnter and isBackspace helpers in Input component
Fixes Kitty protocol handling for Enter and Backspace in the Input
component, matching the Editor component fix.
2025-12-19 20:57:03 +01:00
Mario Zechner cd5ffcfac9 Add [Unreleased] section to changelog 2025-12-19 20:52:44 +01:00
Mario Zechner 783e39fd65 Release v0.24.1 2025-12-19 20:51:44 +01:00
Mario Zechner 51a1c0e60c Export OAuth and model config functions for AgentSession scripts
Exports getAvailableModels, getApiKeyForModel, findModel, login, logout,
and getOAuthProviders from @mariozechner/pi-coding-agent so scripts using
AgentSession directly can reuse OAuth token storage and model resolution.

Fixes #245
2025-12-19 20:43:41 +01:00
Mario Zechner fc80319a85 fix(tui): handle emoji deletion and cursor movement correctly
Backspace, Delete, and arrow keys now use Intl.Segmenter to operate
on grapheme clusters instead of individual UTF-16 code units. This
fixes deletion of emojis and other multi-codepoint characters.

fixes #240
2025-12-19 20:39:45 +01:00
Mario Zechner 390003f72d fix(tui): handle Kitty protocol lock key modifiers
Fixes keyboard input in Ghostty on Linux when Num Lock is enabled.
The Kitty protocol includes Caps Lock (64) and Num Lock (128) bits
in modifier values. Now masks out lock bits when matching shortcuts.

Added helper functions: isArrowUp/Down/Left/Right, isEnter, isTab,
isBackspace, isShiftEnter, isAltEnter, isAltLeft/Right, isCtrlLeft/Right

fixes #243
2025-12-19 20:34:20 +01:00
Mario Zechner c0f70993ee feat: add xhigh thinking level support for gpt-5.2 models
- Add supportsXhigh() function to ai package for checking xhigh support
- Clamp xhigh to high for OpenAI models that don't support it
- Update coding-agent to use centralized supportsXhigh()
- gpt-5.2, gpt-5.2-codex now show xhigh in thinking selector

Closes #236
2025-12-19 20:07:24 +01:00
theBucky 85350f5e9c feat: add xhigh thinking level support for gpt-5.2 and gpt-5.2-codex
- Add XHIGH_MODELS constant and getAvailableThinkingLevels() to AgentSession
- Update ThinkingSelectorComponent to accept availableLevels parameter
- Both shift+tab cycling and /thinking command now show xhigh for supported models
- Update types.ts documentation to list supported models
2025-12-19 19:59:13 +01:00
Mario Zechner 327258dca5 Remove logo folder - now at https://github.com/badlogic/shittycodingagent.ai/blob/main/src/logo.svg 2025-12-19 19:13:48 +01:00
Nico Bailon 6115cd5518 Wrap custom tools with hooks (#248) 2025-12-19 19:05:20 +01:00
Aliou Diallo 6ea1b852fe fix(coding-agent): properly cleanup terminal on Ctrl+C in session selector (#247) 2025-12-19 19:04:00 +01:00
Tommy Falkowski 0050280844 docs: added logo suggestion (#246)
Co-authored-by: Tommy Falkowski <tommy@byteowlz.com>
2025-12-19 19:01:58 +01:00
Aliou Diallo ac79df0423 fix(coding-agent): handle OpenRouter models with colons in IDs (#242) 2025-12-19 15:26:12 +01:00
Aliou Diallo aa1e1bbc49 fix(coding-agent): prevent global AGENTS.md from being loaded twice (#239)
When cwd is `~/.pi/agent/` or a subdirectory, the global AGENTS.md file
was included twice in the system prompt.

`loadProjectContextFiles()` loads context files in two steps:
1. Explicitly loads from `getAgentDir()` (`~/.pi/agent/`)
2. Walks from cwd up to root, collecting all AGENTS.md/CLAUDE.md files

There was no deduplication. When cwd is at or below `~/.pi/agent/`, the
ancestor walk includes that directory again.

Fix: track seen paths with a Set and skip duplicates.
2025-12-19 15:24:49 +01:00
Nico Bailon cb3e67f764 Forward onUpdate callback through hook wrapper (#238) 2025-12-19 15:23:41 +01:00