Commit Graph

23 Commits

Author SHA1 Message Date
can1357 e49f8f4fb2 test(coding-agent): added shared auth storage and model registry to tests
- Added shared auth storage and model registry for concurrent and eager compaction tests.
- Replaced per-test auth storage creation and cleanup routines with shared lifecycle management.
- Removed local auth storage variables and individual cleanup hooks from test harness instances.
2026-08-12 03:25:31 +02:00
can1357 e9888367d1 refactor: migrated packages to internal utility modules and removed external dependencies
- Implemented in-house, zero-dependency utility modules in `pi-utils` covering DOM manipulation, markdown parsing, templating, browser automation helpers, and terminal buffers.
- Migrated packages across the repository to consume the new internal utilities and `omptype` schema validators instead of external dependencies.
- Removed multiple external runtime and development dependencies including Zod, Marked, LRU cache, Turndown, and Puppeteer browser packages.
2026-08-05 13:39:09 +02:00
can1357 1b25ff01a2 style: apply biome formatting to merged changes 2026-07-30 02:01:03 +02:00
can1357 7ccbe51b2d fix(session): preserved Codex commentary on empty stops
(cherry picked from commit 0b4887a4098e6296ac72ea2837db22be18dc9894)
2026-07-30 02:01:02 +02:00
roboomp 2481a4c51a fix(session): awaited capped empty-stop persistence
Waited for the final assistant message_end persistence slot before reparenting past the capped empty turn.

Added a delayed extension hook regression proving the prompt cannot settle before persistence and the active branch remains clean.
2026-07-18 05:34:52 +00:00
roboomp 02443a1c5b fix(session): discarded capped empty assistant stops
Removed the final zero-content assistant after the empty-stop retry cap so its failed-request usage cannot re-anchor context maintenance.

Made the terminal error name model switching and /shake images as recovery options.

Fixes #5959
2026-07-18 05:27:30 +00:00
roboomp bacc24e12e fix(agent): preserved signed thinking-only stops
- Treated non-empty thinking signatures as terminal provider content.
- Added regression coverage for empty visible thinking with a valid signature.

Fixes #5881
2026-07-17 17:08:15 +00:00
roboomp e518bc22c4 fix(coding-agent): stopped post-turn maintenance turns
- Prevented compaction from reopening a settled terminal answer unless queued work or an active goal remains.
- Ran auto-learn capture in an abortable detached agent with constrained tools and isolated provider state.
- Replaced primary-turn capture coverage with private-capture regression tests.

Fixes #5715
2026-07-16 14:55:27 +00:00
can1357 280d4b039b fix(coding-agent): persist pruned autolearn captures 2026-07-14 18:41:16 +02:00
roboomp c36f64d4f0 fix(coding-agent): pruned noop autolearn captures
Removed accepted empty Auto-Learn capture stops from live and persisted context, including the hidden capture prompt when it directly parents the no-op stop.

Extended the regression to prove the next real prompt does not replay the stale Auto-Learn nudge.

Fixes #5211
2026-07-11 17:46:44 +00:00
roboomp 221196704a fix(coding-agent): cleared autolearn empty-stop override
Cleared the terminal empty-stop acceptance flag for every agent-initiated prompt so non-opt-in custom turns cannot inherit Auto-Learn capture behavior.

Added a regression covering a non-opt-in custom turn after a non-empty Auto-Learn capture response.

Fixes #5211
2026-07-11 17:20:46 +00:00
roboomp e2afc87a40 fix(coding-agent): accepted autolearn empty stops
Marked Auto-Learn capture turns as accepting terminal empty assistant stops so the empty-stop guard does not retry the expected no-reply completion.

Added a focused AgentSession regression covering the auto-continue capture turn.

Fixes #5211
2026-07-11 17:04:16 +00:00
roboomp 51cc34ac6d fix(agent): surfaced empty stop retry failures
Emitted a failed auto-retry event when empty assistant stop responses exhaust their retry cap so the TUI can show an error instead of silently settling.

Fixes #5128
2026-07-11 00:07:15 +00:00
metaphorics 42626b8c44 feat(coding-agent): make task.eager and todo.eager three-level eagerness enums 2026-06-14 11:09:29 +09:00
can1357 db573f713e fix(packages/coding-agent): resolved empty-stop retry handling regression
- Excluded assistant "thinking" content from non-empty stop detection in #isEmptyAssistantStop().
- Replaced the empty-stop retry prompt with the <system-injection> wrapper.
- Updated empty-stop reminder detection to accept <system-injection> messages.
- Added regression coverage for thinking-only stop retries to prevent skipped assistant output.
2026-06-13 00:20:05 +02:00
Theo Mathieu 416c9947bd fix(acp): finish prompt turn when extension/custom command is handled locally
Extension commands (e.g. /sonnet) and TypeScript custom commands that
consume the input without calling the LLM return early from
session.prompt() with no agent turn. In ACP mode this left the pending
prompt promise unresolved, hanging the client forever.

Change session.prompt() to return Promise<boolean>: true when the LLM
was invoked, false when the command was fully handled locally.
#runPromptOrCommand calls #finishPrompt immediately on a false return so
the ACP turn completes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 08:26:07 +02:00
DarkPhilosophy ad444f652c fix(coding-agent): retry orphaned toolUse stops to prevent history corruption
When Anthropic Claude returns stopReason: "toolUse" but the assistant
message contains no actual toolCall, the session would append a spurious
toolResult entry. This creates tool_result blocks without matching
tool_use blocks — structurally invalid for Anthropic's API validator.

The symptom is overloaded_error on every subsequent request (in: 0 out: 0),
even though servers aren't overloaded. Other providers handle the same
corrupted history more leniently, making the problem appear Anthropic-specific.

The #isEmptyAssistantStop guard now checks for stopReason === "toolUse"
with no text and no toolCall. When the retry cap is hit, tool-use orphans
are still removed from active context (unlike regular empty stops) because
they corrupt message history. A regression test covers both the retry and
cap scenarios.

For affected sessions: run /compact to drop the corrupted history tail.

Fixes review feedback from chatgpt-codex-connector.
2026-06-05 21:15:42 +03:00
can1357 5038ad7855 tests: delete/adjust brittle tests 2026-06-04 17:46:00 +02:00
can1357 51865fc1ea test(coding-agent): updated assertions for condensed prompt wording
- Aligned handoff, reminder, and system-prompt expectations with shortened copy.
- Added HTTP transport test for required initialize failures.
- Guarded SSE startup timeout against stale connection races.
2026-06-04 16:35:45 +02:00
SuperHedge a36e7d6192 fix(coding-agent): reset retry state on empty-stop cap 2026-06-01 09:35:20 +02:00
SuperHedge 49e029b33f fix(coding-agent): preserve retry state on empty stops 2026-06-01 09:35:20 +02:00
SuperHedge 23c339f6da Resolve empty-stop retry cap waits 2026-06-01 09:35:20 +02:00
SuperHedge 528f4c197b Guard empty assistant stops during active tasks 2026-06-01 09:35:20 +02:00