Commit Graph

398 Commits

Author SHA1 Message Date
Cristina Poncela Cubeiro
cbf3c333ef revert 2026-05-04 15:43:45 +02:00
Cristina Poncela Cubeiro
c3c10737d8 feat: image content 2026-04-28 13:43:28 +02:00
Justin Barnett
7617c1ad92 fix(coding-agent): escape exported image data (#3819)
Fixes #3811
2026-04-27 23:22:06 +02:00
Mario Zechner
01e2536879 fix(coding-agent): prevent wrapped padding in HTML export 2026-04-27 21:49:46 +02:00
Mario Zechner
b8238a77a5 fix(coding-agent): tighten HTML export tool spacing 2026-04-27 21:18:34 +02:00
Mario Zechner
aefb0fedfe feat(coding-agent): add warnings.anthropicExtraUsage opt-out
closes #3808
2026-04-27 20:36:00 +02:00
mdsjip
5b8deef2f9 fix(coding-agent,ai): fallback to /proc/self/environ in Bun sandbox (#3801)
Bun compiled binaries have an empty process.env when running inside
sandbox environments (e.g. nono on Linux/macOS). This broke API key
detection and model discovery because all process.env.* lookups returned
undefined.

- Add restoreSandboxEnv() helper that reads /proc/self/environ when Bun
  is detected and process.env is empty, populating process.env before
  any other code runs (coding-agent/src/bun/cli.ts entry point)
- Add getProcEnv() fallback in env-api-keys.ts for direct @mariozechner/pi-ai
  consumers that may not go through the coding-agent entry point
- Add unit tests for restoreSandboxEnv
2026-04-27 18:36:53 +02:00
Aliou Diallo
10425abb87 fix(coding-agent): dedupe symlinked resources (#3818)
* fix(coding-agent): dedupe symlinked resources

Fixes #3767

* refactor(coding-agent): extract canonicalizePath util for symlink resolution
2026-04-27 18:33:10 +02:00
Mario Zechner
c19e64a444 fix(coding-agent): refresh title after extension session rename
closes #3686
2026-04-25 17:20:26 +02:00
Mario Zechner
a363b668ac fix(coding-agent): clear tree navigation compaction state
closes #3688
2026-04-25 17:03:09 +02:00
Armin Ronacher
dcf2651631 feat(coding-agent): Add built-in update command (#3680) 2026-04-25 13:09:33 +02:00
Mario Zechner
91154d9757 fix: update stale CI test expectations 2026-04-24 20:22:16 +02:00
Aliou Diallo
39a9784d2a fix(coding-agent): preserve models when re-registering provider with overrides only (#3651)
Previously, registerProvider() overwrote the stored config for a provider,
so a models registration followed by a baseUrl/headers-only override lost
the models. After refresh(), only the override-only config was replayed,
causing extension-provided models to disappear.

Added upsertRegisteredProvider() that merges defined fields into the
existing stored config instead of replacing it. Fields absent from the
incoming config are preserved from the stored config.

Also adds regression tests for dynamic provider override persistence
across refresh.
2026-04-24 20:15:35 +02:00
Armin Ronacher
39db145495 fix(coding-agent): show models.json auth in login selector 2026-04-24 17:28:40 +02:00
Mario Zechner
7bd9f6500d fix(coding-agent): avoid cmd.exe for git installs on windows closes #3642 2026-04-24 13:56:10 +02:00
Mario Zechner
1e33492525 fix(coding-agent): harden clipboard copy
closes #3639
2026-04-24 12:55:58 +02:00
Mario Zechner
86ba08a2e3 fix(coding-agent): preserve in-memory settings on reload
closes #3616
2026-04-23 23:47:49 +02:00
Mario Zechner
4cd4cfd98e fix(ai): support long cache retention compat
closes #3543
2026-04-23 23:43:34 +02:00
Mario Zechner
ffa0f31239 fix(ai): support Anthropic eager tool streaming compat
closes #3575
2026-04-23 23:12:45 +02:00
Mario Zechner
8700ac1f0e fix(coding-agent): support custom npmCommand for git deps
closes #3604
2026-04-23 22:32:32 +02:00
Mario Zechner
f0cf8a59d2 fix(coding-agent): handle stale extension contexts
fixes #3606
2026-04-23 22:07:13 +02:00
Mario Zechner
3fb2d11ce5 fix(coding-agent): honor no-tools in service sessions
fixes #3592
2026-04-23 21:36:16 +02:00
Mario Zechner
e38647f376 fix(coding-agent): restore builtin-only tool disabling
closes #3592
2026-04-23 21:36:16 +02:00
Armin Ronacher
e97051313d fix(coding-agent,ai): show env auth source in /login 2026-04-23 21:19:53 +02:00
Aliou Diallo
05e2e9d170 fix(coding-agent): strip trailing index.js|ts from extension labels in startup banner (#3596)
Strip `index.ts` and `index.js` from extension display paths in both
compact and expanded views of the startup banner. This makes the list more
readable by removing redundant filename noise.

Changes:
- Add `formatExtensionDisplayPath()` helper to centralize path formatting
- Update `getCompactExtensionLabels()` to strip index files from segments
- Update expanded view formatting to use the new helper
- Add comprehensive tests for both views

Fixes #3549
Fixes #3559
2026-04-23 21:03:26 +02:00
Julian LaNeve
ab744e216d test(coding-agent): update stale mocks and fix /clone expectation (#3608) 2026-04-23 20:52:03 +02:00
Mario Zechner
f3a2c9d05e fix(coding-agent,mom): retry fs watchers on async errors closes #3564 2026-04-22 23:03:19 +02:00
Mario Zechner
3dacaa8ed9 fix(coding-agent,tui): drop typebox compiler shim and fix progress 2026-04-22 21:12:20 +02:00
Armin Ronacher
35ff2689ee fix(typebox): migrate to v1 with extension compat (#3474)
* fix(typebox): migrate to v1 with extension compat

Replace AJV-based validation with TypeBox-native validation, keep legacy extension imports working (including @sinclair/typebox/compiler), and restore coercion for serialized/plain JSON schemas.

This change closes #3112.

* fix(typebox): use canonical imports and harden coercion

Switch first-party code to canonical typebox imports while retaining legacy extension aliases in the loader.

Remove obsolete runtime codegen guards, expand serialized JSON-schema coercion coverage, and update related tests and fixtures.

Fixes #3112.

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-22 19:59:33 +02:00
Mario Zechner
8234ebf9ee feat(coding-agent,tui): add stacked autocomplete providers closes #2983 2026-04-22 15:44:08 +02:00
Mario Zechner
4e919868f6 fix(coding-agent): chain system prompt in before_agent_start closes #3539 2026-04-22 14:58:17 +02:00
Mario Zechner
b4f9b618d3 fix(coding-agent): allow headers-only model overrides closes #3538 2026-04-22 13:26:01 +02:00
Mario Zechner
1cc303d053 fix(coding-agent): add replacement-session callbacks closes #2860 2026-04-22 12:13:54 +02:00
Mario Zechner
a900d25119 feat(tui,coding-agent): add OSC 9;4 terminal progress indicators
Emit OSC 9;4 progress start/end sequences during agent streaming and
compaction so terminals (iTerm2, WezTerm, Windows Terminal, Kitty, etc.)
show activity in their tab bar.

Made with love for @lucasmeijer
2026-04-22 11:55:52 +02:00
Samuel Painter
ee462dd70d fix(coding-agent): sanitize markdown links in exported session HTML (#3532)
marked v15 does not filter dangerous URL protocols. The default link
renderer passes href values through verbatim, so markdown like
`[click](javascript:alert(1))` renders as a clickable XSS link in
shared/exported session HTML.

Add custom link and image renderers that:
- Block javascript:, vbscript:, and data: protocol URLs
- Escape href/title/alt attributes via escapeHtml()

Also escape img.mimeType in session image rendering to prevent
attribute breakout from crafted session JSONL.

Fixes #3531
2026-04-22 10:53:03 +02:00
Mario Zechner
60290b0d75 fix(coding-agent): expand ~ in sessionDir
closes #3514
2026-04-22 00:21:57 +02:00
Mario Zechner
e58d631c89 Reapply "fix(ai): own Anthropic SSE parsing to avoid SDK JSON.parse hard-failures"
This reverts commit fc9220d2de.
2026-04-21 23:42:19 +02:00
Mario Zechner
fc9220d2de Revert "fix(ai): own Anthropic SSE parsing to avoid SDK JSON.parse hard-failures"
This reverts commit 4b926a30a2.
2026-04-21 23:19:52 +02:00
Aliou Diallo
81de426f96 test(coding-agent): fix showLoadedResources mocks (#3518)
Add getCommandDiagnostics and getShortcutDiagnostics mocks to fix
'Cannot read properties of undefined' errors in InteractiveMode tests.

regression from 32a305cb
2026-04-21 23:05:38 +02:00
Mario Zechner
4b926a30a2 fix(ai): own Anthropic SSE parsing to avoid SDK JSON.parse hard-failures
Bypass the Anthropic SDK streaming parser entirely. Use
client.messages.create().asResponse() and decode the SSE stream
ourselves with defensive JSON parsing that repairs invalid escape
sequences and control characters inside string literals.

- Switch from SDK .stream() to .asResponse() + pi-owned SSE decoder
- Add repairJson() / parseJsonWithRepair() to json-parse.ts
- Add anthropic-sse-parsing.test.ts regression for malformed tool deltas
- Update github-copilot-anthropic.test.ts mock to match new call path
- Update deprecated claude-3-5-haiku-20241022 refs to claude-haiku-4-5
- Remove stale non-reasoning model test

fixes #3175
2026-04-21 23:00:56 +02:00
Mario Zechner
12d7161884 fix(coding-agent): add session_shutdown reasons closes #2863 2026-04-20 23:11:08 +02:00
Douglas Stephen
1891b9ac01 feat: Expose BuildSystemPromptOptions on before-agent-start event. (#3473)
Resolves: #3463
2026-04-20 23:06:47 +02:00
Mario Zechner
e4f7fe7bb7 feat(coding-agent): batch package updates
closes #2980
2026-04-20 22:56:26 +02:00
Mario Zechner
c40efa9bab fix(coding-agent): resolve shell config from session settings
Stop shell resolution from consulting ambient process.cwd() during bash execution and use the active session's shellPath setting instead.

closes #3452
2026-04-20 22:32:11 +02:00
Mario Zechner
5a4e22ea44 fix(coding-agent): remove process-cwd tool singletons and use tool-name allowlists
- switch SDK/CLI tool selection to name-based allowlists
- apply allowlists across built-in, extension, and SDK tools
- remove ambient process.cwd defaults from core tooling and resource helpers
- update tests, examples, and TUI callers for explicit cwd plumbing
- add regression coverage for extension tool filtering

closes #3452
closes #2835
2026-04-20 22:05:28 +02:00
Mario Zechner
27c1544839 fix(coding-agent): use tool-name allowlists and remove cwd-bound singletons
- treat tools as a global allowlist across built-in, extension, and SDK tools
- remove process-cwd singleton tool usage from SDK and CLI paths
- add regression coverage for extension tool filtering

closes #3452
closes #2835
2026-04-20 22:05:28 +02:00
Mario Zechner
b73212616d fix(coding-agent): skip redundant npm package updates
closes #3000
2026-04-20 19:12:52 +02:00
Mario Zechner
3054fd7a3b fix(ai,coding-agent): support anthropic-style cache control for openai compatibles closes #3392 2026-04-20 17:12:05 +02:00
Mario Zechner
61579214c8 fix(coding-agent): handle symlinked session selector paths closes #3364 2026-04-20 16:25:12 +02:00
Mario Zechner
d56e5aea0b fix(coding-agent): detect Windows pnpm global installs closes #3378 2026-04-20 15:59:57 +02:00