Skip to content

fix(ask): harden async recovery and failed-save paths - #133

Merged
GaganSD merged 7 commits into
mainfrom
fix/pi-ask-review-minors
Nov 18, 2026
Merged

GaganSD merged 7 commits into
mainfrom
fix/pi-ask-review-minors

Conversation

@GaganSD

@GaganSD GaganSD commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Follow-up to feat(ask): background questions, answer later and expiry #132: harden pi-ask recovery when session storage fails.
  • Keep failed blocking replies available in the panel as the conversation continues; persist them for reload once storage recovers, and tell the agent not to re-ask.
  • Retry recovery after failed journal reads without blocking panel refresh, and prevent duplicate delivery while a blocking tool result is still pending.
  • Preserve countdown stops and the first keystroke when saving fails; report the storage error without skipping other timer listeners.
  • Add regression coverage for recovery, failed saves, mixed answer/cancel boundaries, and hidden-panel branch changes; simplify return tracking and attach cleanup.

Validation

  • Passed: lint, typecheck, 201 unit tests, 141 integration tests, 41 tooling tests, package build, and clean-consumer/local registration smoke tests.
  • Model-facing footprint unchanged: approximately 400 tokens, or 384 with expiry disabled.

Compatibility

  • No tool API, configuration, schema, or version change.

@GaganSD

GaganSD commented Nov 18, 2026

Copy link
Copy Markdown
Owner Author

@greptile-apps please review

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect failure recovery and answer delivery within pi-ask.

Keep failed-save forms available for retry before merging.

Findings

  1. P1 Unsaved forms disappear after replies ▶

Summary

This PR hardens question recovery and storage-failure paths without changing the tool’s input format.

  • Failed blocking replies return to the panel for another try.
  • Countdown stops keep the user's key working when saving fails.
  • Session recovery retries failed reads and holds answers still returning as tool results.

One recovery gap remains: an unsaved blocking form can disappear after the conversation continues.

Reviews (1) · Last reviewed commit: "fix(ask): never adopt a blocking answer ..." · Reviewed by Greptile

Comment thread pi-ask/src/ask-tool.ts Resolved
A blocking form whose outcome or deferral could not be journalled was
promised back to the user, but replay treated it as superseded once the
conversation continued. Track failed-save ids in the runtime, keep them in
the panel, and persist a defer entry once the journal accepts writes.
@GaganSD
GaganSD merged commit b70d027 into main Nov 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant