Skip to content

refactor(threads): inject adapter runtime dependencies#961

Merged
shuxueshuxue merged 9 commits intodevfrom
brother/chat-next-after-957
Apr 21, 2026
Merged

refactor(threads): inject adapter runtime dependencies#961
shuxueshuxue merged 9 commits intodevfrom
brother/chat-next-after-957

Conversation

@shuxueshuxue
Copy link
Copy Markdown
Collaborator

Summary

  • inject runtime thread activity, chat runtime services, and thread input handler dependencies instead of letting adapters hold the whole app and reach into state at runtime
  • keep the slice focused on the chat/threads seam only, with matching fixture updates for the new constructor contracts

Proof

  • uv run pytest -q tests/Unit/backend/test_thread_activity_reader.py tests/Unit/backend/test_chat_runtime_services.py tests/Unit/backend/test_thread_input_handler.py -> 5 passed
  • uv run pytest -q tests/Unit/backend/web/services/test_agent_runtime_gateway_thread_input.py tests/Unit/backend/web/services/test_agent_runtime_gateway_chat_delivery.py tests/Integration/test_messaging_social_handle_contract.py -k "agent_runtime_gateway or latest_live_child_thread_over_active_main or recipient_thread_resolution_requires_current_thread_repo_contract or uses_recipient_social_user_id_for_thread_lookup_and_passes_through_envelope_content" -> 11 passed, 102 deselected
  • targeted ruff check / ruff format --check / git diff --check green

Commit Density

  • this PR keeps 6 commits to satisfy the repo rule of at least 5 commits per PR

Copy link
Copy Markdown
Collaborator Author

@shuxueshuxue shuxueshuxue left a comment

Choose a reason for hiding this comment

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

Focused review on the adapter-injection slice: no blocking findings from my side.

I checked the constructor-contract changes across the activity reader, chat runtime services, thread input handler, bootstrap wiring, and the updated fixture surface. The write set stays inside the chat/threads adapter seam, and the touched tests now exercise the explicit injected dependencies rather than the old implicit app-state reach-through.

I am separately parking a /api/monitor/threads hang investigation because that read path overlaps this seam. Once this lands on shared dev, I will rerun that branch-local probe on the fresh head instead of competing on the same files now.

@shuxueshuxue shuxueshuxue force-pushed the brother/chat-next-after-957 branch from 2fa36cb to 7e20f47 Compare April 21, 2026 11:37
@shuxueshuxue shuxueshuxue merged commit f646186 into dev Apr 21, 2026
6 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.

1 participant