Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

fix(pi): clear retry status when streaming resumes - #4034

Merged
trunk-io[bot] merged 2 commits into
mainfrom
fix/pi-retry-status
Jul 31, 2026
Merged

fix(pi): clear retry status when streaming resumes#4034
trunk-io[bot] merged 2 commits into
mainfrom
fix/pi-retry-status

Conversation

@jonathanlab

@jonathanlab jonathanlab commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Problem

THIS UGLY THING

CleanShot 2026-07-30 at 13 03 59@2x

Changes

  • Clear Pi retry status as soon as a successful retry streams text or reasoning.
  • Complete an earlier retry before showing a later retry.
  • Replace raw retry errors with concise rate-limit and retry messages.

Validation

  • pnpm --filter @posthog/agent exec vitest run src/pi/conversation/translatePiConversation.test.ts
  • pnpm --filter @posthog/ui exec vitest run src/features/sessions/components/session-update/StatusNotificationView.test.ts
  • pnpm --filter @posthog/agent exec tsc --noEmit
  • pnpm --filter @posthog/ui exec tsc --noEmit
  • Pre-commit pnpm typecheck

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@trunk-io

trunk-io Bot commented Jul 31, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

React Doctor found 1 issue in 1 file · 1 warning.

1 warning

src/features/sessions/components/session-update/StatusNotificationView.tsx

Reviewed by React Doctor for commit de9badb.

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
### Issue 1
packages/ui/src/features/sessions/components/session-update/StatusNotificationView.tsx:49-51
**Rate-limit variants go unrecognized**

When Pi reports a retry as `Rate limited` or `rate_limit`, this expression does not classify it as a rate limit, causing the UI to show only the generic retry countdown instead of the intended rate-limit explanation.

```suggestion
  const rateLimited = /\b429\b|rate[ _]limit(?:ed)?|too many requests/i.test(
    message ?? "",
  );
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "fix(pi): clear retry status when streami..." | Re-trigger Greptile

@trunk-io
trunk-io Bot merged commit ac6df3c into main Jul 31, 2026
34 checks passed
@trunk-io
trunk-io Bot deleted the fix/pi-retry-status branch July 31, 2026 10:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants