Skip to content

fix(display): a failed on-demand request drops the session it ended - #779

Open
ChuckBuilds wants to merge 1 commit into
mainfrom
claude/on-demand-error-clears-session
Open

ChuckBuilds wants to merge 1 commit into
mainfrom
claude/on-demand-error-clears-session

Conversation

@ChuckBuilds

Copy link
Copy Markdown
Owner

Follow-up from #678.

Problem

_set_on_demand_error ends any running session through _reset_on_demand_fields, but it left that session's saved copy, display_on_demand_config, in the cache. So a failed request that replaced a running session (an invalid mode, load-failed, plugin-reloading, ...) made the next restart of the display resume the session that had already ended.

Fix

_set_on_demand_error clears display_on_demand_config. All eight error paths go through it. The two restore-failed callers cleared it themselves first; I dropped those lines because the new clear covers them.

Testing

  • New test test_a_failed_request_that_ends_the_session_drops_its_saved_copy in test/test_on_demand_disabled_plugin.py. It passes with the fix and fails against main's display_controller.py.
  • The existing restore tests check this clear with assert_any_call and still pass.
  • Full pytest test/ on Windows, compared against a baseline run of main (e40bc47d) in a separate worktree: FAILED/ERROR IDs identical (62 failed + 6 errors on both, all already failing on this host).
  • Not run on ledpi: another session is testing about 140 uncommitted edits there, and restarting its display would disrupt that.

🤖 Generated with Claude Code

_set_on_demand_error ends any running session (_reset_on_demand_fields)
but left its saved copy, display_on_demand_config, in the cache. A failed
request that replaced a running session therefore made the next restart
resume the session that had already ended.

Clear the saved copy where every error path goes through, and drop the
two restore-failed callers' own clears, which this now covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e257b663-55d0-4176-9d16-90f45986d00b
📥 Commits

Reviewing files that changed from the base of the PR and between e40bc47 and 4b9fc3c.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/display_controller.py
  • test/test_on_demand_disabled_plugin.py
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

1 participant