Skip to content

test(gateway): stall in-flight test answers the owner-DM members check - #5887

Merged
john-the-dev merged 1 commit into
mainfrom
fix/stall-test-owner-dm-members
Oct 26, 2026
Merged

john-the-dev merged 1 commit into
mainfrom
fix/stall-test-owner-dm-members

Conversation

@john-the-dev

Copy link
Copy Markdown
Collaborator

Problem

tests/gateway-stall-exit-inflight-send.test.py (added in #4564) has failed on main since it merged at 957e30f. That keeps tsc + tests (clean install) and python standalone tests (5/9) red for every gateway PR (for example #5883 and #5885). CI run 40239176069, job 121307141571:

  • FAIL: the exit waited for the slow answer (3.3s)
  • FAIL: the accepted message was archived as delivered
  • FAIL: the relay accepted the message exactly once (posts=0)

Cause

#5515 landed on main between #4564's last CI run (head 1f79824, green) and its squash merge. Since #5515, the bridge adopts the registry's owner_dm_room only after /v1/room {"op": "members"} lists just the agent and its owner. This test's fake relay answered every /v1/room post with {"ok": true}, so the bridge never adopted the owner DM and held proactive-200.txt. The bridge log shows it: holding owner-directed proactive-200.txt: no owner DM reading from the gateway yet (never the pinned room). No post was sent, so all three delivery assertions failed. The bridge behaves correctly; the fixture was stale.

Fix

The fake relay now answers the members op with the agent and the owner, matching the fixture in src/remote-gateway-bridge.test.py. This is a test-only change of 4 lines.

Evidence

Regression test: tests/gateway-stall-exit-inflight-send.test.py
Before fix: FAIL — 3 failures on main 957e30f (posts=0)
After fix: PASS — 0 failures, posts=1

🤖 Generated with Claude Code

#5515 made the bridge adopt the registry's owner_dm_room only after
/v1/room {"op":"members"} lists just the agent and its owner. This
test's fake relay answered every /v1/room post with {"ok": true}, so
the bridge never adopted the owner DM, held proactive-200.txt, and the
three delivery assertions failed on main from 957e30f (#4564).

The fake relay now answers the members op with the agent and owner,
matching src/remote-gateway-bridge.test.py. Passes 3/3 locally on
main; fails without the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@john-the-dev john-the-dev added the ag2product AG2 product related (packages, PyPI, task-relay) label Oct 26, 2026

@qingyun-wu qingyun-wu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving at 8bc9b57 (agent-assisted, Qingyun's Sutando seat). The mock relay now answers the bridge's /v1/room op: members probe (src/remote-gateway-bridge.py) with exactly the agent and its owner, the shape the owner-DM adoption check requires. So the bridge adopts the DM and reaches the in-flight send again. Ran locally: the test fails at the parent (3 failures, the same signature as main's shard 5: "no successful poll", posts=0) and passes at this head (posts=1, 0 failures). Test-only, with no production change.

@liususan091219 liususan091219 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving at 8bc9b57.

The diff is test-only: 4 added lines in tests/gateway-stall-exit-inflight-send.test.py, no production change. The fake relay now answers the bridge's /v1/room op: members probe (src/remote-gateway-bridge.py:217) with just the agent and the owner, the same shape as the fixture in src/remote-gateway-bridge.test.py:141. That lets the bridge adopt the owner DM and reach the in-flight send the test exists to check.

Verified locally in a scratch worktree, hermetic env (temp HOME and workspace, localhost mock relay):

  • main 957e30f: fails, 3 of the 6 assertions (exit wait 3.3s, not archived, posts=0). The bridge log shows holding owner-directed proactive-200.txt: no owner DM reading.
  • Head 8bc9b57: passes 3 of 3 runs, OK — 0 failure(s).
  • Head with the 4 lines removed: the same 3 failures come back (posts=0). The fixture is what fixes it.

CI at this head: all 9 python standalone shards pass, and license/cla is success (1 context). No unresolved review threads. #5883 and #5885 both fail on this same test right now (#5883 also has a separate pool-restart failure).

A note on "main green": the latest main run also failed shards 1/9 (watch-tasks-stream-shutdown-leaves-inflight-claim) and 6/9 (create-worker-roster-preflight). Those files aren't touched here and pass at this head, so they look like flakes, but this PR doesn't fix them.

Second approval at this head: @qingyun-wu.

— Sutando (susans-MacBook-Pro)

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Gate

✅ Diff coverage PASSES the 95% bar. Whole-tree (informational): 94%.

Diff Coverage

Diff: origin/main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.

@john-the-dev
john-the-dev merged commit 8d325e3 into main Oct 26, 2026
33 checks passed
@john-the-dev
john-the-dev deleted the fix/stall-test-owner-dm-members branch October 26, 2026 01:54
qingyun-wu added a commit that referenced this pull request Oct 26, 2026
Brings in #5887 so the gateway-stall shard runs on the fixed test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ag2product AG2 product related (packages, PyPI, task-relay)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants