Skip to content

refactor(bub-ag-ui): scope adapter to AG-UI protocol interactions - #102

Merged
PsiACE merged 10 commits into
mainfrom
fix/ag-ui-protocol-scope
Nov 10, 2026
Merged

PsiACE merged 10 commits into
mainfrom
fix/ag-ui-protocol-scope

Conversation

@PsiACE

@PsiACE PsiACE commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Use Bub's native run_stream with scoped EventBus observers for AG-UI output and external tool continuation.
  • Keep conversation recording and context management in Bub; leave display history to the application.
  • Fix incremental requests replacing the client's message history, including frontend-tool and interrupt continuations.

Compatibility

  • Exposes POST /agent; removes the separate history, replay, and cancellation endpoints.
  • Pending calls must resume on the same adapter before the turn timeout (600 seconds by default). Persistent conversation storage does not restore unfinished calls after a restart.
  • No Bub source or dependency-pin changes.

Tests

  • AG-UI Python: 67 passed.
  • Official AG-UI client / assistant-ui socket tests: 16 passed. The three new history-preservation regressions fail on the previous implementation and pass here.
  • Full repository: 1152 passed, 11 skipped. Ruff and formatting checks pass.

github-actions[bot]

This comment was marked as outdated.

@PsiACE

This comment has been minimized.

github-actions[bot]

This comment was marked as outdated.

@PsiACE

This comment has been minimized.

github-actions[bot]

This comment was marked as outdated.

@PsiACE

This comment has been minimized.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

github-actions[bot]

This comment was marked as outdated.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blocking findings; recommend allowing 921a6d8.

The last finding — the 50 ms turn budget in the deadline test thread — is resolved, and the fix keeps the timeout scenario rather than masking it. advance_time freezes loop.time(), so asyncio.timeout(self.max_run_seconds) in runtime.py gets a deadline that only moves when the test advances it, and each test waits for the observable phase (entered, save_started) before jumping past the deadline. The tests are not vacuous: with the turn timeout replaced by asyncio.timeout(None) the same three tests hang at those waits instead of passing, so they still exercise the real timeout and cancellation path. They are also no longer timing-sensitive: 10/10 passes of the four touched tests with eight CPU hogs on four cores, and the package suite is 67 passed at this head.

The reduction of the backpressure sleep to asyncio.sleep(0) keeps its guard: with asyncio.Queue(maxsize=16) made unbounded the test still fails at assert 10000 < 10000, so bounded delivery is still detected without the wall-clock wait.

The changed Markdown matches what this head does. The development block works in the order shown — in a fresh environment the uv sync --frozen --group test line installs the test group, and uv run --frozen pytest then resolves pytest (9.2.0); run on its own in an environment without that group it fails to spawn pytest, so the two lines need to stay together.

Nothing else in this test-only revision changes the behavior reviewed at fda86d6.

@PsiACE
PsiACE merged commit 9de406f into main Nov 10, 2026
3 checks passed
@PsiACE
PsiACE deleted the fix/ag-ui-protocol-scope branch November 10, 2026 17:18
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