Skip to content

Comments

Fix: Session queue pause/resume buttons disabled in single-user and multiuser modes#83

Merged
lstein merged 1 commit intofeature/multiuserfrom
copilot/fix-pause-resume-buttons
Feb 23, 2026
Merged

Fix: Session queue pause/resume buttons disabled in single-user and multiuser modes#83
lstein merged 1 commit intofeature/multiuserfrom
copilot/fix-pause-resume-buttons

Conversation

Copy link

Copilot AI commented Feb 23, 2026

Summary

The session queue Pause and Resume buttons were disabled in both single-user mode and multiuser mode. There were two bugs working together:

Frontend: usePauseProcessor and useResumeProcessor computed admin status as currentUser?.is_admin ?? false. In single-user mode, currentUser is never populated (no auth flow runs), so is_admin always defaulted to false, permanently disabling both buttons.

Backend: The pause and resume API endpoints used the AdminUser dependency, which requires a valid Bearer token. In single-user mode, no token is sent, so the backend returned 401/403 — causing a "Problem Pausing Processor" error even after the frontend buttons were re-enabled.

Frontend fix: Both hooks now mirror the pattern in useIsModelManagerEnabled — treat as admin when multiuser is disabled, check is_admin when it's enabled:

const isAdmin = useMemo(() => {
  if (setupStatus && !setupStatus.multiuser_enabled) {
    return true; // single-user mode = implicit admin
  }
  return currentUser?.is_admin ?? false;
}, [setupStatus, currentUser]);

Backend fix: Changed both pause and resume endpoints from AdminUser to AdminUserOrDefault. AdminUserOrDefault returns a system admin user in single-user mode without requiring a token, while still validating the token and enforcing admin privileges in multiuser mode.

Related Issues / Discussions

QA Instructions

  • Single-user mode: Pause button should be enabled while queue is processing and successfully pause it; Resume button should be enabled while queue is paused and successfully resume it.
  • Multiuser mode (admin): Same as single-user mode.
  • Multiuser mode (non-admin): Both buttons should remain disabled.

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)
Original prompt

This section details on the original issue you should resolve

<issue_title>[bug]: Session queue pause and resume buttons are disabled in multiuser mode</issue_title>
<issue_description>### Is there an existing issue for this problem?

  • I have searched the existing issues

Install method

Invoke's Launcher

Operating system

Linux

GPU vendor

Nvidia (CUDA)

GPU model

No response

GPU VRAM

No response

Version number

feature/multiuser branch

Browser

No response

System Information

No response

What happened

While the session queue was actively processing a series of sessions, I went to the frontend's Queue tab and discovered that the Pause and Resume buttons were both disabled.

What you expected to happen

I expect the Pause button to be active when a session item is being processed, and the Resume button to be active when the session queue is paused.

How to reproduce the problem

No response

Additional context

No response

Discord username

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix disabled pause and resume buttons in multiuser mode Fix: Session queue pause/resume buttons disabled in single-user and multiuser modes Feb 23, 2026
Copilot AI requested a review from lstein February 23, 2026 02:55
@lstein lstein marked this pull request as ready for review February 23, 2026 02:55
Copy link
Owner

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A problem was identified during testing. In single-user mode, clicking on the pause button fails to pause processing and the frontend shows a message saying "Problem Pausing Processor."

Copy link
Author

Copilot AI commented Feb 23, 2026

A problem was identified during testing. In single-user mode, clicking on the pause button fails to pause processing and the frontend shows a message saying "Problem Pausing Processor."

The root cause was in the backend: the pause and resume endpoints used AdminUser which requires a Bearer token, but in single-user mode no token is sent (no auth flow runs), causing a 401/403 response.

Fixed in commit 3f00717 by changing both endpoints to use AdminUserOrDefault instead of AdminUser. AdminUserOrDefault returns a system admin user in single-user mode without requiring a token, while in multiuser mode it still validates the token and enforces admin privileges.

In single-user mode, currentUser is never populated (no auth), so
`currentUser?.is_admin ?? false` always returns false, disabling the buttons.

Follow the same pattern as useIsModelManagerEnabled: treat as admin
when multiuser mode is disabled, and check is_admin flag when enabled.

Co-authored-by: lstein <111189+lstein@users.noreply.github.com>
@lstein lstein force-pushed the copilot/fix-pause-resume-buttons branch from d52fc85 to dc9c837 Compare February 23, 2026 03:35
Copy link
Owner

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised.

@lstein lstein merged commit a888c2e into feature/multiuser Feb 23, 2026
13 checks passed
@lstein lstein deleted the copilot/fix-pause-resume-buttons branch February 23, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants