Commit Graph

536 Commits

Author SHA1 Message Date
can1357 df6d1e1ac5 fix(ai): completed oneshot transient retry handling 2026-08-16 02:14:12 +02:00
can1357 b445134b4d Merge PR #8370: fix: retry transient Anthropic failures at oneshot LLM call sites (@wonjun3991)
# Conflicts:
#	packages/coding-agent/src/utils/title-generator.ts
2026-08-16 02:14:12 +02:00
roboomp 2996f16a61 fix(agent): added codex v2 compaction feature header
- Negotiated remote_compaction_v2 on Codex compatibility fetches.

- Covered explicit endpoints and non-Codex request scoping.

Fixes #8524
2026-08-14 06:56:57 +00:00
wonjun3991 720ac2168a fix(agent): retry handoff, branch summary and manual /compact on a blip
Each is a single, side-effect-free completion whose result is parsed after
it resolves, so one transient provider failure previously aborted the
whole operation - for /compact that left the user's context full.

Adds SummaryOptions.oneshotRetry, because both compaction paths call the
same generateSummary and the policy therefore cannot be a constant inside
it. Manual /compact has no outer loop and gets retry by default;
auto-compaction passes false because session-maintenance already retries
the whole attempt, and nesting would multiply the budget (10 outer x 3
inner) while stacking each outer wait on an inner backoff.
2026-08-13 10:54:42 +09:00
wonjun3991 0523c7112f feat(agent): add opt-in transient retry to instrumentedCompleteSimple
instrumentedCompleteSimple is the single funnel for every oneshot LLM
call in the agent, so retry belongs here rather than in a try/catch above
each caller - the failure arrives as a resolved AssistantMessage.

Opt-in rather than default-on: oneshotKind is free-form and callers may
pass arbitrary ctx.tools, so the funnel cannot itself prove a request is
replay-safe.

Response headers are captured per attempt and cleared between attempts,
so a stale retry-after can never be reused for a later failure.
2026-08-13 10:54:42 +09:00
can1357 c25b008f4a Merge PR #8067: fix(compaction): manual /shake keeps a recent tail of tool results (@zhang17-24) 2026-08-13 02:00:49 +02:00
can1357 c101452bb5 refactor: restructured and condensed agent prompts and system instructions
- Refactored and condensed numerous system prompts, agent instructions, and tool documentation files across packages.
- Streamlined workflow rules, formatting constraints, and execution guidelines for improved clarity and brevity.
- Updated discovery rules, recommendation criteria, and syntax standards in prompt templates.
2026-08-12 01:48:14 +02:00
left-to-right 835a7db15a fix(compaction): keep rescue shake able to elide the newest result
RESCUE_SHAKE_CONFIG spreads AGGRESSIVE_SHAKE_CONFIG, so the new 4k manual
tail leaked into dead-end recovery and could block eliding the very
result that caused the dead end. Override protectTokens back to 0 in the
rescue preset and add the coding-agent changelog entry for the manual
/shake behavior change.

Addresses review on #8067.
2026-08-11 22:33:40 +08:00
can1357 64baa7c1bd chore(format): applied biome formatting and removed dead code from merged prs 2026-08-11 15:14:15 +02:00
can1357 270fe8d454 Merge PR #8183: fix(cursor): omit undefined exec args and keep exec-resolved under owned dialects (@jairuspace) 2026-08-11 15:06:16 +02:00
can1357 00d90809fc test: removed redundant policy-key suite 2026-08-11 15:06:11 +02:00
jairuspace 5cbd482f8e fix(cursor): omit undefined exec args and keep exec-resolved under owned dialects
Cursor bash/grep frames wrote optional kwargs as present-undefined, and
tools.format gemini projectors dropped kCursorExecResolved so settled
calls ran twice.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-10 13:39:40 -06:00
left-to-right c3da093a1d fix(compaction): manual /shake keeps a recent tail of tool results
Manual /shake used protectTokens: 0, stripping every eligible tool result
including the ones the agent is still working from. Keep a small 4k-token
recent window (matching the automatic shake mechanism, at a quarter of its
16k budget) so the full escape hatch stays aggressive without destroying
the live tail. Two matcher-focused tests that implicitly relied on the
zero window now pin protectTokens: 0 explicitly.

Fixes #7776
2026-08-09 18:09:17 +08:00
re2zero 9d0699e070 fix(coding-agent): resolve xd:// device dispatches against device user policy first
When an xd:// device is dispatched through the write tool, the outer
approval gate now consults tools.approval.<deviceName> before falling
back to tools.approval.write. This lets users scope allow/deny/prompt
to a single device mount without changing the blanket write tool policy.

The write tool's approval function returns { tier, policyKey: deviceName }
for xd:// device dispatches. resolveApproval uses the policyKey to look
up the user override on the device name, falling back to the invoking
tool's own policy when the device has none configured.

Adds:
- ToolApprovalDecision.policyKey field (optional, additive)
- policyKey-aware lookup in resolveApproval and requiresApproval
- Updated error messages naming the correct config key
- Unit tests for policyKey resolution and WriteTool integration

Fixes can1357/oh-my-pi#7923
2026-08-08 02:45:19 +08:00
roboomp 86a856361a fix(agent): stripped output statuses from remote compaction
- Reused the Responses replay lifecycle policy for V1 and V2 compaction input.

- Covered persisted native history and converted assistant replay items.

Fixes #7742
2026-08-05 17:26:32 +00:00
can1357 94c838faea Merge PR #7539: fix(coding-agent): complete usage-aware fallback integration (@eggpeat) 2026-08-05 01:12:02 +02:00
metaphorics 3802d2dd80 chore(ts): enforce noImplicitOverride 2026-08-05 02:49:01 +09:00
Brent 2da96d77a7 fix(coding-agent): close fallback lifecycle races 2026-08-03 17:51:32 +00:00
Brent 353bbc034b fix(coding-agent): harden usage fallback review races 2026-08-03 17:15:57 +00:00
Brent db97103c32 fix(coding-agent): complete usage-aware fallback integration 2026-08-03 16:34:35 +00:00
can1357 6a44844c57 Merge PR #7377: fix(hub): wake owners when supervised processes exit (@paralin) 2026-08-03 15:12:03 +02:00
can1357 d841569ee8 Merge PR #7460: fix(agent): distinguish parent steering from advisories (@fatihaziz) 2026-08-03 14:46:14 +02:00
roboomp 4997423f10 fix(agent): keep queued non-interruptible tools alive on peer-IRC interrupt
A peer-IRC interrupt (e.g. a subagent message) aborts only interruptible
waits and leaves already-running non-interruptible foreground work alone.
But runTool's `interruptState.triggered` early-return skipped every
not-yet-started tool regardless of source, so a non-interruptible tool
queued behind an interruptible wait in the same batch (a batched todo/write
after `hub wait`) was dropped with "Skipped due to pending peer interrupt".

Exclude non-interruptible tools from the early skip on the IRC path; user
and system steering still preempt all queued work.

Fixes #7493
2026-08-03 12:24:10 +00:00
Christian Stewart 302148523f fix(hub): wake owners when supervised processes exit
Publish terminal daemon completions to the session that started the
process so idle agents can resume without polling hub status.

Persist every unacknowledged generation with a stable completion ID and
immutable snapshot. Replay the collection after reconnect or broker
recovery, and clear each event only after the owning client acknowledges
it.

Signed-off-by: Christian Stewart <christian@aperture.us>
2026-08-03 01:31:39 -07:00
Fatih Al-Aziz e4de9bf176 fix(agent): classify attributed custom user steering
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-03 13:32:25 +07:00
Fatih Al-Aziz 2416134cf0 fix(agent): classify next queued steering source
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-03 13:18:45 +07:00
Fatih Al-Aziz 1e448304ac Merge remote-tracking branch 'origin/main' into fix/clarify-interrupt-skip-wording 2026-08-03 13:14:07 +07:00
Fatih Al-Aziz f8cc29e8db fix(agent): distinguish parent steering from advisories
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-03 13:05:20 +07:00
Fatih Al-Aziz c61ed66dd3 fix(agent): clarify internal steering skip message
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-08-03 12:54:08 +07:00
can1357 a58584ff3c feat: implemented shared serialization utilities and standardized inventories
- Added shared Python call and literal serialization utilities with multiline verbatim support.
- Standardized tool inventories to format as an OpenAI-Harmony functions namespace using TypeScript declarations.
- Updated tool normalization and rendering functions to accept options objects and default to Python-syntax examples.
- Refactored Gemini dialect rendering to leverage shared serialization functions directly.
2026-08-03 05:06:49 +02:00
can1357 6e4a0e8125 Merge PR #7327: fix(compaction): stop shake from re-eliding artifact recovery reads (@jwmacd) 2026-08-02 20:52:07 +02:00
jwmacd 7428146556 review: changelog entries; note manual /shake intent; derive RESCUE from AGGRESSIVE 2026-08-02 03:41:55 -04:00
can1357 4e65a685ae fix(ai): addressed anthropic stream truncation errors for tool call recovery
- Added `isStreamEnvelopeErrorText` to packages/ai/src/error/flags.ts to recognize stream envelope truncation errors.
- Updated `streamAnthropicOnce` in packages/ai/src/providers/anthropic.ts to throw an envelope error when streams die mid-generation without a terminal frame.
- Updated `recoverTransientErrorToolTurn` in packages/agent/src/agent-loop.ts to recognize Anthropic stream envelope truncation errors for tool call salvage.
2026-08-02 06:14:01 +02:00
jwmacd 77028ae957 fix(compaction): stop shake from re-eliding artifact recovery reads
A recovered artifact:// read is an ordinary read result, so the next shake
pass elides it into a new artifact, indefinitely. Extends the 5f9558d17a
spill exemption to shake; the dead-end rescue gets a dedicated config
instead of falling through to AGGRESSIVE. Manual /shake unchanged.
2026-08-01 19:27:41 -04:00
can1357 1088ee2127 Merge PR #7203: fix(tui): render mid-turn steering skips as info, not errors (@roboomp) 2026-08-01 20:14:40 +02:00
roboomp af343f70d0 fix(agent): distinguished started steering aborts
Track entry into tool.execute separately from tool event emission. Never-started skips retain SyntheticToolResultDetails with executed:false; in-flight aborts now use distinct interrupted metadata with execution:started so consumers do not assume no partial work occurred.

Keep both interrupt states neutral in the TUI and cover the agent metadata boundary plus rendering behavior.

Fixes #7199
2026-07-31 21:16:28 +00:00
roboomp ebd84d4f85 fix(tui): render mid-turn steering skips as info, not errors
A tool call aborted mid-batch to service queued steering/peer input emits a synthetic placeholder result with isError:true so the model retries it. The TUI keyed all error styling (red ✘, red frame/text) off that flag, so a normal steering skip rendered identically to a real tool failure.

Mark the skip placeholder with the existing SyntheticToolResultDetails discriminator (source: "interrupt_skipped", executed:false) and render benign skips through the neutral generic card (info glyph, dim text, neutral background), bypassing any bespoke error frame. Genuine failures keep their error styling.

Fixes #7199
2026-07-31 21:06:07 +00:00
roboomp 5283c4c99b fix(agent): routed codex v2 compaction through websockets
- Reused the live Codex provider session for WebSocket-first V2 compaction.
- Fell back to SSE V2 on WebSocket transport failure before the existing V1 fallback.
- Propagated the configured WebSocket preference through manual, automatic, and advisor compaction paths.
- Added transport reuse and fallback regression coverage.

Fixes #7198
2026-07-31 21:00:15 +00:00
can1357 5764021c81 fix(compaction): cap every summary transport 2026-07-31 19:42:43 +02:00
can1357 0d9c634665 Merge PR #7008: fix(compaction): cap the generated summary output budget (@terrxo) 2026-07-31 19:42:42 +02:00
can1357 40120fd2b4 fix(context): preserve total-only usage anchors 2026-07-31 19:07:16 +02:00
Harsha Vardhan 66a7126b5b fix(session): reconstruct context without prompt usage 2026-07-31 20:10:01 +10:00
usr-bin-roygbiv 17e678fa2d fix(agent): honor explicit compaction endpoint
(cherry picked from commit 3bc5c578ddd2e626eda2049a660de7bffb674b52)
2026-07-30 01:42:53 +02:00
usr-bin-roygbiv 66c8f27d23 style(compaction): format fallback repairs
(cherry picked from commit bf909c728adf80b1ad4c70f79701f6057138c6d9)
2026-07-30 01:42:33 +02:00
usr-bin-roygbiv c83e506954 fix(compaction): require native-capable fallbacks
(cherry picked from commit 6ac4efd9d2fe37fb50be6e9ba6664e8924bce602)
2026-07-30 01:42:33 +02:00
usr-bin-roygbiv 0c31095d34 fix(agent): skip V2 retries for compaction auth errors
(cherry picked from commit 07a54771834435b7897208ab9d6d42401f0203e1)
2026-07-30 01:42:06 +02:00
usr-bin-roygbiv b927da95e6 fix(agent): preserve native compaction error precedence
(cherry picked from commit 3b1c1a420132485ac4f5a4803615a70d1e05c794)
2026-07-30 01:42:06 +02:00
usr-bin-roygbiv 3abf17e7b9 fix(compaction): stop cross-provider native fallback
(cherry picked from commit 01455dc1e681e385d0a46e64a72009364e8f510e)
2026-07-30 01:42:06 +02:00
usr-bin-roygbiv 4c2b40f8b3 fix: preserve streaming compaction auth errors
(cherry picked from commit 6fe25c6a08e169a15fca057a56e1ce36f46bc641)
2026-07-30 01:42:06 +02:00
usr-bin-roygbiv 2fe31c61b6 fix: preserve native compaction auth errors
(cherry picked from commit ab8a823e1de425735825392db7d98b33905f0dc3)
2026-07-30 01:42:06 +02:00