When resolving --model zai/glm-5, the resolver now correctly interprets
'zai' as the provider and 'glm-5' as the model id, rather than matching
a vercel-ai-gateway model whose id is literally 'zai/glm-5'.
If the provider/model split fails to find a match, falls back to raw id
matching to still support OpenRouter-style ids like 'openai/gpt-4o:extended'.
The extension system currently only forwards agent_start, agent_end,
turn_start, and turn_end events. This means extensions cannot access
streaming text (token-by-token), message lifecycle, or tool execution
progress — all of which are available to internal subscribers.
This adds forwarding for the remaining 6 agent event types:
- message_start, message_update, message_end
- tool_execution_start, tool_execution_update, tool_execution_end
These follow the exact same pattern as the existing forwarded events:
new interfaces in types.ts, exports in index.ts, and else-if blocks
in _emitExtensionEvent(). The new types are included in ExtensionEvent
and automatically flow through RunnerEmitEvent (they're not in the
exclusion list).
This enables extensions to build real-time UIs, streaming WebSocket
bridges, and other integrations that need fine-grained event access.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
After compaction, context token count is unknown until the next LLM
response. Instead of showing stale pre-compaction values or heuristic
estimates, the footer now shows ?/200k.
ContextUsage.tokens and ContextUsage.percent are now number | null
(breaking change). Removed usageTokens, trailingTokens, lastUsageIndex
from ContextUsage (internal details).
Also fixed _checkCompaction() using .find() (first compaction) instead
of getLatestCompactionEntry() (latest), which caused incorrect overflow
detection with multiple compactions.
Closes#1382
Include tool parameter names, types, descriptions in a collapsible
section under each tool in the export HTML. Also adds parameters to
pi.getAllTools() return value.
closes#1407, closes#1416
rg was only downloaded lazily when the grep tool was invoked, but the
LLM often uses rg directly via the bash tool. Ensure both fd and rg
are downloaded at startup so they are available in PATH for all tools.
fixes#1348
Windows does not ship with unzip, causing fd/rg download to fail on
first run in PowerShell. Use tar (bsdtar, available on Windows 10+)
for both .tar.gz and .zip extraction. Also adds proper error checking
on the extraction result.
fixes#1348
Add pasteToEditor(text) method that pastes text into the editor via
bracketed paste sequences, triggering paste handling (including collapse
for large content). Unlike setEditorText which directly replaces content,
pasteToEditor routes through handleInput on the active editor component.
- Add pasteToEditor to ExtensionUIContext interface
- Add handleInput to EditorComponent interface (was missing, all
concrete implementations already had it)
- Implement in interactive mode via bracketed paste sequence
- Add fallback in RPC mode (delegates to setEditorText)
- Document in extensions.md
* fix(coding-agent): update test model from opus-4-5 to opus-4-6
* fix(coding-agent): delegate onEscape/onCtrlD/onPasteImage to defaultEditor
When an extension provides a custom editor via setEditorComponent(),
onEscape, onCtrlD, and onPasteImage were copied by value from
defaultEditor. Later, when retry/compaction/branch-summary temporarily
swapped defaultEditor.onEscape to an abort handler, the custom editor
still held the stale reference, so pressing Escape during retry did
nothing.
Use closures that delegate to defaultEditor at call time, matching the
pattern from f1b1d54 which fixed the same issue for onExtensionShortcut.
setupAutocomplete only sets the provider on defaultEditor. When an
extension customizes the editor via setEditorComponent during
session_start, the custom editor is created before setupAutocomplete
runs, so it never receives the autocomplete provider. This breaks forced
file suggestions, slash commands, and all other completions.
Set the provider on the active editor too when it differs from the
default, covering initial load, reload, and settings changes.
collectAutoExtensionEntries now checks if the directory itself has a
package.json with pi.extensions (or index.ts) before scanning children.
This fixes duplicate extension loading when a manifest-aware directory
is specified directly in settings.json extensions array.
Fixes#1274