Skip to content

fix(server): use session.phase_state instead of session.mode_state in…#6069

Open
xpushkal wants to merge 1 commit intoaden-hive:mainfrom
xpushkal:fix/handle-pause-phase-state-typo
Open

fix(server): use session.phase_state instead of session.mode_state in…#6069
xpushkal wants to merge 1 commit intoaden-hive:mainfrom
xpushkal:fix/handle-pause-phase-state-typo

Conversation

@xpushkal
Copy link

@xpushkal xpushkal commented Mar 9, 2026

for issue #5991
… handle_pause

The handle_pause endpoint referenced session.mode_state (lines 360-361), which does not exist on the Session dataclass. This caused an AttributeError every time the pause endpoint reached the phase transition step, preventing the queen phase from transitioning to staging and returning a 500 error to the frontend.

Changed to session.phase_state, consistent with handle_stop (line 412), handle_run (line 75), and the Session dataclass definition (session_manager.py line 44).

Description

Brief description of the changes in this PR.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Fixes #(issue number)

Changes Made

  • Change 1
  • Change 2
  • Change 3

Testing

Describe the tests you ran to verify your changes:

  • Unit tests pass (cd core && pytest tests/)
  • Lint passes (cd core && ruff check .)
  • Manual testing performed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Screenshots (if applicable)

Add screenshots to demonstrate UI changes.

… handle_pause

The handle_pause endpoint referenced session.mode_state (lines 360-361),
which does not exist on the Session dataclass. This caused an
AttributeError every time the pause endpoint reached the phase transition
step, preventing the queen phase from transitioning to staging and
returning a 500 error to the frontend.

Changed to session.phase_state, consistent with handle_stop (line 412),
handle_run (line 75), and the Session dataclass definition
(session_manager.py line 44).
Copilot AI review requested due to automatic review settings March 9, 2026 13:18
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

PR Requirements Warning

This PR does not meet the contribution requirements.
If the issue is not fixed within ~24 hours, it may be automatically closed.

Missing: No linked issue found.

To fix:

  1. Create or find an existing issue for this work
  2. Assign yourself to the issue
  3. Re-open this PR and add Fixes #123 in the description

Exception: To bypass this requirement, you can:

  • Add the micro-fix label or include micro-fix in your PR title for trivial fixes
  • Add the documentation label or include doc/docs in your PR title for documentation changes

Micro-fix requirements (must meet ALL):

Qualifies Disqualifies
< 20 lines changed Any functional bug fix
Typos & Documentation & Linting Refactoring for "clean code"
No logic/API/DB changes New features (even tiny ones)

Why is this required? See #472 for details.

@github-actions github-actions bot added the pr-requirements-warning PR doesn't follow contribution guidelines. Please fix or it will be auto-closed. label Mar 9, 2026
@github-actions github-actions bot removed the pr-requirements-warning PR doesn't follow contribution guidelines. Please fix or it will be auto-closed. label Mar 9, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the /pause execution route to use the correct Session attribute (phase_state) when switching the queen from running → staging, preventing an AttributeError and resulting 500s during pause-triggered phase transitions.

Changes:

  • Replace the invalid session.mode_state reference with session.phase_state in handle_pause.
  • Align pause-phase transition logic with handle_trigger/handle_stop and the Session dataclass.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@xpushkal
Copy link
Author

xpushkal commented Mar 9, 2026

@Hundao , kindly check the. issue #5991

@xpushkal xpushkal closed this Mar 9, 2026
@xpushkal xpushkal deleted the fix/handle-pause-phase-state-typo branch March 9, 2026 13:24
@xpushkal xpushkal restored the fix/handle-pause-phase-state-typo branch March 9, 2026 13:24
@xpushkal xpushkal deleted the fix/handle-pause-phase-state-typo branch March 9, 2026 13:25
@xpushkal xpushkal restored the fix/handle-pause-phase-state-typo branch March 9, 2026 13:25
@xpushkal xpushkal reopened this Mar 9, 2026
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.

2 participants