Commit graph

2452 commits

Author SHA1 Message Date
Mario Zechner
b1211261be docs(coding-agent): add changelog entry for extension shortcut fix (#947) 2026-01-25 19:21:18 +01:00
Sviatoslav Abakumov
f1b1d54955
fix(coding-agent): delegate extension shortcuts instead of copying (#947)
Extension shortcuts registered via registerShortcut() were not firing
when the extension also used setEditorComponent(). This happened because
setEditorComponent() copied onExtensionShortcut from defaultEditor at
creation time, capturing undefined if setupExtensionShortcuts() hadn't
run yet.

The fix is to delegate to defaultEditor.onExtensionShortcut at call
time.
2026-01-25 19:20:51 +01:00
Mario Zechner
62209c4a0f docs: add tmux testing instructions to AGENTS.md 2026-01-25 19:20:14 +01:00
Mario Zechner
0faba293e6 fix(coding-agent): truncate bash hint line to terminal width
Fixes TUI crash on narrow terminals (< 40 chars) when displaying
collapsed bash output with 'earlier lines' hint.

fixes #941
2026-01-25 19:19:41 +01:00
Mario Zechner
b0c050582a fix(coding-agent): update test expectations for trailing period in read tool messages 2026-01-25 19:08:52 +01:00
Mario Zechner
c94e8a122e
Merge pull request #945 from Perlence/fix/editor-multiline-insert
fix(tui): handle multiline text in insertTextAtCursor()
2026-01-25 15:55:12 +01:00
Mario Zechner
b9d8b99c76
Merge pull request #942 from haoqixu/http-proxy
feat(ai): Support HTTP proxy through environment variables
2026-01-25 15:52:14 +01:00
github-actions[bot]
abfffd83bf chore: approve contributor haoqixu 2026-01-25 14:50:59 +00:00
Sviatoslav Abakumov
beb1455cab
fix(tui): move lastAction handling out of setTextInternal()
The caller is responsible for doing that.
2026-01-25 17:50:55 +04:00
Sviatoslav Abakumov
609095b0b6
fix(tui): refactor the multi-line insertion handling 2026-01-25 17:50:50 +04:00
Sviatoslav Abakumov
7d2d170c1b
fix(tui): handle multi-line text in insertTextAtCursor()
Add insertTextAtCursorInternal() to properly handle newlines by splitting
lines at the cursor position.

- Normalize line endings (CRLF/CR to LF)
- Handle single-line and multi-line insertion
- Position cursor at end of inserted text
- Call onChange only once at the end

Refactor handlePaste() to use insertTextAtCursorInternal() for
multi-line pastes, while retaining character-by-character insertion for
single-line pastes to preserve autocomplete triggering.
2026-01-25 17:28:54 +04:00
haoqixu
1e718e63ea feat(ai): Support HTTP proxy through environment variables 2026-01-25 15:52:45 +08:00
Mario Zechner
3635e45ffd feat(ai): add OpenRouter provider routing support (#859) 2026-01-25 03:34:52 +01:00
jake
dac7474da2 feat(ai): add OpenRouter provider routing support
Allows custom models to specify which upstream providers OpenRouter
should route requests to via the `openRouterRouting` field in model
definitions.

Supported fields:
- `only`: list of provider slugs to exclusively use
- `order`: list of provider slugs to try in order
2026-01-25 03:34:49 +01:00
Mario Zechner
a6d878e804 fix(ai): default tool call arguments to empty object for Google providers
When Google providers return tool calls without an args field (common for
no-argument tools), the arguments field was undefined. This breaks
subsequent API calls that require tool_use.input to be present.

Now defaults to {} when args is missing.

Related: clawdbot/clawdbot#1509
2026-01-25 03:18:02 +01:00
Mario Zechner
d74fd82673 docs(coding-agent): add pi config to CLI Reference 2026-01-25 03:13:58 +01:00
Mario Zechner
150128fd2c feat(coding-agent): add pi config TUI to manage resources
Adds a new 'pi config' command with a TUI to list and toggle package
resources (extensions, skills, prompts, themes).

- Displays resources grouped by source (packages, user, project)
- Subgroups by resource type (Extensions, Skills, Prompts, Themes)
- Toggle enabled/disabled state with space
- Filter resources by typing
- Supports +pattern for force-include, !pattern for exclude
- Properly reads exclusion patterns from settings.json

fixes #938
2026-01-25 03:12:21 +01:00
Mario Zechner
ef5149fdf6 Fixes #933 2026-01-25 02:51:05 +01:00
Mario Zechner
6b4188fa0b Fixes #933 2026-01-25 02:47:17 +01:00
Mario Zechner
349c6420c7 fix(coding-agent): setWorkingMessage() now works in agent_start handlers
Extensions calling setWorkingMessage() in agent_start handlers previously
had no effect because the loading animation didn't exist yet. Now the
message is queued and applied once the loader is created.

Fixes #935
2026-01-25 02:37:12 +01:00
Mario Zechner
3e8eb956b3 feat(coding-agent): resolve resources with enabled state 2026-01-25 02:13:24 +01:00
Mario Zechner
9dc2b9b163 docs(coding-agent): document pi-package keyword for npm discoverability 2026-01-25 01:40:26 +01:00
Mario Zechner
353ac792eb chore(gitlab-duo): use pi's own GitLab OAuth client ID 2026-01-25 01:12:50 +01:00
Mario Zechner
7b920f27d2 fix(coding-agent): check npm package version before using cached copy
For temporary npm extensions (-e npm:...):
- Unpinned packages: fetch latest version from registry and reinstall if newer
- Pinned packages: reinstall if cached version doesn't match
2026-01-25 00:57:58 +01:00
Mario Zechner
0d24ddbb03 fix(ai): use model.api instead of hardcoding api type in streaming functions
- anthropic.ts: use model.api instead of hardcoding 'anthropic-messages'
- openai-responses.ts: use model.api instead of hardcoding 'openai-responses'
- gitlab-duo: simplify to use actual model IDs, export MODELS array
2026-01-25 00:52:34 +01:00
Mario Zechner
7019fdb92b fix(gitlab-duo): use Responses API for all GPT models
Ensures consistent tool call ID format when switching between models.
2026-01-25 00:29:05 +01:00
Mario Zechner
758baa9fec refactor: rename custom provider examples
- custom-provider -> custom-provider-anthropic
- gitlab-duo -> custom-provider-gitlab-duo
- Update READMEs with custom provider section
2026-01-25 00:18:13 +01:00
Mario Zechner
7caa08999e fix: use template literal in test.ts 2026-01-25 00:13:44 +01:00
Mario Zechner
7a5cfdaed0 fix: apply extension provider registrations before model resolution
- Extensions register providers via pendingProviderRegistrations
- These were only applied in bindCore() during AgentSession creation
- But model resolution in main.ts happens before session creation
- Fix: apply pending registrations immediately after loading extensions
- Also fix gitlab-duo to pass Authorization header instead of apiKey
2026-01-25 00:13:20 +01:00
Mario Zechner
dd01d83e64 fix: use opencode's OAuth client ID for localhost redirects 2026-01-24 23:53:56 +01:00
Mario Zechner
639d706156 fix: use correct GitLab OAuth redirect URI with port 8080 2026-01-24 23:52:04 +01:00
Mario Zechner
3e6d8dc72a feat: add GitLab Duo provider extension example
- Delegates to pi-ai's built-in Anthropic/OpenAI streaming
- OAuth support with GitLab's bundled client ID
- Direct access token caching (25 min TTL)
- Models: duo-chat-opus/sonnet/haiku-4-5, duo-chat-gpt-5-1/mini/codex
- No external dependencies beyond pi-ai
2026-01-24 23:51:17 +01:00
github-actions[bot]
a57eb399eb chore: approve contributor 4h9fbZ 2026-01-24 22:41:50 +00:00
Mario Zechner
2c5d202778 chore: add custom-provider to workspaces for auto-install 2026-01-24 23:22:33 +01:00
Mario Zechner
6aad6e30ce refactor: convert custom-provider example to package with deps
- Move custom-provider.ts to custom-provider/index.ts
- Add package.json with @anthropic-ai/sdk dependency
- Extension now requires npm install before use
2026-01-24 23:21:19 +01:00
Mario Zechner
d4bd1a956b docs: rewrite custom-provider.md with actual stream pattern
- Document stream.push/end pattern instead of yield
- Link to existing provider implementations on GitHub
- Add testing section with list of test files to run
- Include proper content block and tool call examples
2026-01-24 23:18:36 +01:00
Mario Zechner
177c694406 feat: custom provider support with streamSimple
- Add resetApiProviders() to clear and re-register built-in providers
- Add createAssistantMessageEventStream() factory for extensions
- Add streamSimple support in ProviderConfig for custom API implementations
- Call resetApiProviders() on /reload to clean up extension providers
- Add custom-provider.md documentation
- Add custom-provider.ts example with full Anthropic implementation
- Update extensions.md with streamSimple config option
2026-01-24 23:15:11 +01:00
Mario Zechner
c06163bc59 docs(ai): document api registry 2026-01-24 23:15:11 +01:00
Mario Zechner
c725135a76 refactor(ai): register api providers 2026-01-24 23:15:11 +01:00
Mario Zechner
3256d3c083 refactor(oauth): add provider registry 2026-01-24 23:15:11 +01:00
Mario Zechner
89636cfe6e fix(coding-agent): improve read tool description for full file reads 2026-01-24 23:15:11 +01:00
Mario Zechner
79ded84d46
Merge pull request #936 from Perlence/fix/extension-editor-padding-x
fix(coding-agent): propagate paddingX to custom editors
2026-01-24 20:48:41 +01:00
Mario Zechner
39b94ad7be
Merge pull request #930 from Perlence/fix/document-missing-hotkeys
docs(coding-agent): document missing hotkeys in README and /hotkeys
2026-01-24 20:48:22 +01:00
Mario Zechner
4ab9b769e6
Merge pull request #934 from Perlence/fix/reserve-col-for-cursor
fix(tui): reserve 1 column for the cursor in word wrap width
2026-01-24 20:47:46 +01:00
Mario Zechner
2d5b0c636f
Merge pull request #937 from mitsuhiko/defer-gitignore
Defer create .pi/*/.gitignore
2026-01-24 20:46:30 +01:00
Armin Ronacher
48020405f3 Defer create .gitignore 2026-01-24 19:53:01 +01:00
Sviatoslav Abakumov
2bbc255237
fix(coding-agent): propagate paddingX to custom editors
setCustomEditorComponent() was not copying the paddingX setting from
the default editor to extension-provided editors. Also propagate live
changes from the settings callback.
2026-01-24 21:00:14 +04:00
Sviatoslav Abakumov
b5ab90f837
fix(tui): reserve 1 column for cursor in word wrap width 2026-01-24 17:41:10 +04:00
Markus Ylisiurunen
151099e17e fix(ai): handle openai responses arguments.done events 2026-01-24 12:05:58 +01:00
Markus Ylisiurunen
c6e966bd1c adjust azure responses metadata and handoff gating 2026-01-24 12:05:58 +01:00