[PR #3952] Fixed shimmer animation on permission deny #10815

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

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

State: closed
Merged: No


Summary

I've successfully located and fixed the bug where the progress animation doesn't stop when denying a command. Here's what I found and fixed:

Bug Location: /home/runner/work/opencode/opencode/packages/opencode/src/session/prompt.ts in the process function around lines 1182-1187

Root Cause: When a permission was rejected:

  1. The blocked = true flag was set correctly
  2. But the processing loop continued instead of breaking out immediately
  3. The message completion (time.completed) was only set at the very end of processing
  4. This caused the shimmer animation condition !props.message.time.completed to remain true

Fix Applied: Added a check after the switch statement (lines 1294-1296) to break out of the processing loop immediately when blocked = true:

// If permission was rejected and blocked, break out of processing loop
if (blocked) {
  break
}

How it works now:

  1. Permission rejected → blocked = true
  2. New check breaks out of processing loop immediately
  3. Message completion time is set at the end: assistantMsg.time.completed = Date.now()
  4. TUI updates and shimmer animation stops correctly

The fix ensures that when a user denies a permission request, the progress animation stops immediately instead of continuing indefinitely.

Closes #3951

New%20session%20-%202025-11-05T22%3A33%3A25.035Z
opencode session  |  github run

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/3952 **State:** closed **Merged:** No --- ## Summary I've successfully located and fixed the bug where the progress animation doesn't stop when denying a command. Here's what I found and fixed: **Bug Location**: `/home/runner/work/opencode/opencode/packages/opencode/src/session/prompt.ts` in the `process` function around lines 1182-1187 **Root Cause**: When a permission was rejected: 1. The `blocked = true` flag was set correctly 2. But the processing loop continued instead of breaking out immediately 3. The message completion (`time.completed`) was only set at the very end of processing 4. This caused the shimmer animation condition `!props.message.time.completed` to remain true **Fix Applied**: Added a check after the switch statement (lines 1294-1296) to break out of the processing loop immediately when `blocked = true`: ```typescript // If permission was rejected and blocked, break out of processing loop if (blocked) { break } ``` **How it works now**: 1. Permission rejected → `blocked = true` 2. New check breaks out of processing loop immediately 3. Message completion time is set at the end: `assistantMsg.time.completed = Date.now()` 4. TUI updates and shimmer animation stops correctly The fix ensures that when a user denies a permission request, the progress animation stops immediately instead of continuing indefinitely. Closes #3951 <a href="https://opencode.ai/s/1NBZQGb6"><img width="200" alt="New%20session%20-%202025-11-05T22%3A33%3A25.035Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI1LTExLTA1VDIyOjMzOjI1LjAzNVo=.png?model=opencode/glm-4.6&version=1.0.29&id=1NBZQGb6" /></a> [opencode session](https://opencode.ai/s/1NBZQGb6)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/sst/opencode/actions/runs/19118406986)
yindo added the pull-request label 2026-02-16 18:15:33 -05:00
yindo closed this issue 2026-02-16 18:15:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#10815