Skip to content

Keep command-context cancellation with the target owner - #1245

Merged
trissim merged 1 commit into
mainfrom
fix/command-discovery-navigation
Oct 25, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/command-discovery-navigation

Conversation

@trissim

@trissim trissim commented Oct 25, 2026

Copy link
Copy Markdown

Follow-up to merged #1244; fixes the dependency ownership defect exposed by its hosted debt check.

Owner

The target context can expire both during discovery and during command application. Put CommandContextChanged beside TargetContext in target_commands.py, not in the catalog that already imports that module. It still inherits asyncio.CancelledError: Textual cancels obsolete background discovery, while the catalog consumes only this nominal foreground cancellation and never submits it as agent input. Ordinary task cancellation and unrelated errors still propagate.

Delete the target module's runtime import of its consumer and Conversation's unnecessary local TargetContext import. No compatibility alias, new helper module, alternate command cache, or state mirror. The old discovery-only name also incorrectly described invalidation during application.

Evidence

  • Hosted Cancel obsolete command discovery without crashing the UI #1244 debt output identifies exactly FunctionLocalImport:src/toad/target_commands.py +1 at the former line122. This is a real consumer-to-owner dependency loop, not a reason to raise a counter.
  • Actual source imports of TargetContext, CommandCatalog and Conversation succeed together. Exception MRO is CommandContextChanged -> asyncio.CancelledError -> BaseException.
  • Prior NRA enumeration covers all declarations/consumers in 1,042 Core/Toad/Textual modules with zero parse omissions; this move keeps one exception declaration. Final source search removes the former name and runtime back-import.
  • Real installed Toad/ACP, plain st/Xvfb, saved history, slash completion and physical tab changes qualified Cancel obsolete command discovery without crashing the UI #1244's cancellation behavior. Separately, the real installed frontend survived one configured-provider DM, an autonomous second turn, owner pause, channel opening and physical tab return while using Core #3285's source overlay. Both real responses and the Paused state are visible in retained screenshots.
  • No exact asynchronous invalidation race or foreground rejection was deterministically reproduced. No automated test success is claimed; Toad's CLAUDE.md prohibits those tests. The previous hosted suite reported 101 failures including calls to removed Core APIs (Messaging.send_message, HistoryViews.channel_history), not an application acceptance result.

Assumed: original #1244 is merged and its local hotfix is installed. This follow-up's new owner/name is source-published; installation/cold frontend confirmation is recorded after application. Source/installed distinction is deliberate. No Core runtime restart, source-session mutation, paid-provider substitution or uncertain-input replay.

@trissim

trissim commented Oct 25, 2026

Copy link
Copy Markdown
Author

Actual pushed-head source qualification: fe62d5c cold-started the real saved-session Toad/ACP frontend on isolated Xvfb :94, displayed both retained real-provider replies and Paused state, survived 24 physical channel/agent-tab clicks, and opened actual slash completion. No Enter/provider input was sent. Retained cold-open.png and slash-after-navigation.png under the owned toad-owner-ui evidence directory. No exact invalidation race or automated-test success claimed. The installed hotfix remains the merged #1244 code; this follow-up source is not silently substituted into live packages.

@trissim
trissim marked this pull request as ready for review October 25, 2026 10:00
Copilot AI balanced review requested due to automatic review settings October 25, 2026 10:00
@trissim
trissim enabled auto-merge October 25, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit f241a8d into main Oct 25, 2026
2 of 3 checks passed
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