[PR #11543] fix(app): show retry status only on active turn #13830

Closed
opened 2026-02-16 18:18:39 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11543

State: closed
Merged: Yes


What does this PR do?

Retry error was rendered on every session turn instead of the current one

How did you verify your code works?

In session-turn.tsx replace line 350
const status = createMemo(() => data.store.session_status[props.sessionID] ?? idle)

with this:

const mock = createMemo(() => {
    if (typeof window === "undefined") return false
    if (new URLSearchParams(window.location.search).has("mockRetry")) return true

    // Some shells/apps use hash routing where query params live after `#`.
    const hash = window.location.hash
    const index = hash.indexOf("?")
    if (index < 0) return false
    return new URLSearchParams(hash.slice(index + 1)).has("mockRetry")
  })

  const status = createMemo(() => {
    if (!mock()) return data.store.session_status[props.sessionID] ?? idle
    return {
      type: "retry" as const,
      attempt: 1,
      message: "Time to first token is taking longer than expected...",
      next: Date.now() + 30_000,
    }
  })  

and enter a session link with link param ?mockRetry=1 for example http://localhost:4445/L2hvbWUvbmVyaW91c3kvcHJvZ3JhbW1pbmcvb3BlbmNvZGU/session/ses_3e9583af8ffeCPJn6IX9bUCVRV?mockRetry=1

Left screen is fixed, right screen is old one

image
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11543 **State:** closed **Merged:** Yes --- ### What does this PR do? Retry error was rendered on every session turn instead of the current one ### How did you verify your code works? In `session-turn.tsx` replace line 350 `const status = createMemo(() => data.store.session_status[props.sessionID] ?? idle)` with this: ``` const mock = createMemo(() => { if (typeof window === "undefined") return false if (new URLSearchParams(window.location.search).has("mockRetry")) return true // Some shells/apps use hash routing where query params live after `#`. const hash = window.location.hash const index = hash.indexOf("?") if (index < 0) return false return new URLSearchParams(hash.slice(index + 1)).has("mockRetry") }) const status = createMemo(() => { if (!mock()) return data.store.session_status[props.sessionID] ?? idle return { type: "retry" as const, attempt: 1, message: "Time to first token is taking longer than expected...", next: Date.now() + 30_000, } }) ``` and enter a session link with link param `?mockRetry=1` for example `http://localhost:4445/L2hvbWUvbmVyaW91c3kvcHJvZ3JhbW1pbmcvb3BlbmNvZGU/session/ses_3e9583af8ffeCPJn6IX9bUCVRV?mockRetry=1` Left screen is fixed, right screen is old one <img width="807" height="623" alt="image" src="https://github.com/user-attachments/assets/435ebfb4-fca0-4f04-a30b-13ef4afe7e81" />
yindo added the pull-request label 2026-02-16 18:18:39 -05:00
yindo closed this issue 2026-02-16 18:18:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13830