fix: resume interrupted Pi agent turns - #60
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe PR increases default retries from two to five across provider and simple completion configuration. Harness streams disable stream-level retries and add session-level recovery that rewinds failed turns, reruns the agent loop, and honors delay and cancellation handling. ChangesRetry configuration and harness recovery
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant HarnessPrompt
participant retryAssistantCall
participant continueHarnessTurn
participant PiSession
HarnessPrompt->>retryAssistantCall: Execute assistant turn
retryAssistantCall->>continueHarnessTurn: Retry failed turn
continueHarnessTurn->>PiSession: Rewind failed turn branches
continueHarnessTurn->>continueHarnessTurn: Rerun agent loop
continueHarnessTurn-->>retryAssistantCall: Return assistant response
retryAssistantCall-->>HarnessPrompt: Return result or abort
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8ec075d to
54feb61
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pi-bridge/src/bridge.ts`:
- Around line 40-47: Verify the pinned `@earendil-works/pi-agent-core` API before
changing continueHarnessTurn: confirm whether runAgentLoopContinue is an
exported symbol or replace it with the documented agentLoopContinue export.
Remove the HarnessRetryInternals cast and direct calls to private AgentHarness
methods such as createTurnState, createContext, createLoopConfig,
createStreamFn, and handleAgentEvent by using the public AgentHarness
retry-continuation surface; if no public equivalent exists, document and
validate the internal dependency across supported patch releases.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 7a6837fb-bb9d-46ab-89c8-42420c9a9ee6
📒 Files selected for processing (3)
app/src/main/java/com/zhousl/aether/data/pi/PiProviderMapper.ktpi-bridge/src/bridge.tsshared/src/commonMain/kotlin/com/zhousl/aether/data/pi/SharedPiChatClient.kt
🚧 Files skipped from review as they are similar to previous changes (2)
- app/src/main/java/com/zhousl/aether/data/pi/PiProviderMapper.kt
- shared/src/commonMain/kotlin/com/zhousl/aether/data/pi/SharedPiChatClient.kt
d2a195e to
dc1fa0a
Compare
- Retry failed harness turns after rewinding the failed assistant leaf - Raise default agent max_retries from 2 to 5 across bridge and clients
dc1fa0a to
d1f3bc5
Compare
Fixes #58
Summary by CodeRabbit