GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(service): ignore stale parked-reply interrupts by coderbruis · Pull Request #4015 · agentscope-ai/agentscope

Conversation

@coderbruis

@coderbruis coderbruis commented Nov 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

AgentScope Version

2.0.12dev

Description

Fixes #4013.

A stop request can capture parked reply A, enter the dispatcher retry path while the session is locked, and later be consumed after the session has advanced to parked reply B. The service currently applies that old event to B and ends B as interrupted.

Discard queued interrupts when the loaded agent has no awaiting work or the event targets a different reply. Check under the session lock, before starting channel delivery, registering an inbox consumer, reading/updating the current message or publishing a synthetic reply start. This also prevents an ignored channel-bound trigger from leaving a delivery subscription that duplicates the next legitimate response. Direct SDK behavior and the running-session pub/sub path are unchanged.

Related: #3690 covers the idle-interrupt subset. This combines idle and stale-target handling, with validation before channel delivery starts. These changes should be coordinated, and the guards can be consolidated if #3690 merges first.

The regression tests exercise the real interrupt producer, session lock, dispatcher retry/requeue, run registry and serialized service execution using event gates. Controls cover ASKING/SUBMITTED work, valid targets, idle sessions, session-lock release and channel delivery. A real ChannelClients stream also verifies that a stale interrupt followed by a legitimate confirmation produces exactly one response with the expected text and terminal reply ID.

Model/storage/resource factories and the platform sender remain offline fixtures. The A-to-B checkpoint transition models another serialized run; this is not an HTTP/Redis/multi-process end-to-end test.

Validation

Python 3.11.6 on macOS arm64:

  • 14 related agent/HITL/service/pipeline/channel suites: 170 passed, 42 subtests passed.
  • The dispatcher stale-target selection fails on unmodified main.
  • The channel regression tests fail with the late guard: an ignored trigger starts delivery, and the next legitimate confirmation is delivered twice. They pass with validation before channel delivery.
  • Original pre-commit run --all-files: passed; all applicable hooks passed, including add-trailing-comma, mypy, Black, Flake8, Pylint and Pyroma.
  • Full pytest tests was attempted in this local environment but stopped at collection because dependencies including anthropic, dashscope, fakeredis, redis, SQLAlchemy and aiortc are missing. The full repository suite has not been validated locally.

Related suite command:

PYTHONPATH=src:tests python -m pytest tests/agent_interrupt_test.py tests/service_stale_interrupt_test.py tests/agent_basic_test.py tests/hitl_user_confirmation_test.py tests/hitl_external_execution_test.py tests/hitl_mixed_test.py tests/service_agent_interrupt_test.py tests/service_chat_locking_test.py tests/service_chat_run_context_test.py tests/service_wakeup_dispatcher_test.py tests/pipeline_team_test.py tests/service_chat_channel_delivery_test.py tests/channel_clients_test.py tests/channel_stream_test.py -q --tb=short

Checklist

  • An issue has been created for this PR
  • I have read CONTRIBUTING.md
  • Docstrings follow the existing style
  • Related documentation in agentscope-ai/docs: no companion change included; the queued-target behavior is documented in ChatService.interrupt's docstring
  • Code is ready for review, with the full-suite environment limitation recorded above

AI-assisted investigation, implementation and regression testing.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
coderbruis added 2 commits November 13, 2026 14:39
@coderbruis
fix(service): ignore stale parked-reply interrupts
02ba44a
@coderbruis
fix(service): validate interrupt targets before channel delivery
74be32e
@github-actions github-actions Bot added the pr/awaiting-review Waiting for maintainers to review this PR label Nov 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

pr/awaiting-review Waiting for maintainers to review this PR

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: delayed parked-reply interrupts can stop a newer reply

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@coderbruis
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.