Skip to content

refactor: inject explicit dependencies into routes and completion handlers - #197

Merged
hlin99 merged 2 commits into
mainfrom
refactor/explicit-route-dependencies
Oct 29, 2026
Merged

hlin99 merged 2 commits into
mainfrom
refactor/explicit-route-dependencies

Conversation

@hlin99

@hlin99 hlin99 commented Oct 29, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #196.

  • Remove Proxy/server objects and reverse type references from endpoint registration, completion helpers, and application assembly.
  • Inject explicit scheduling, forwarding, tokenization, model lookup, and outcome callbacks into completion execution; pass only configuration in CompletionOptions.
  • Give each endpoint only its required callbacks or data, with narrow contracts in xpyd/interfaces.py rather than a generic service container.
  • Compose discovery, health monitoring, and the shared ZMQ listener in ProxyServer; app.create_app only receives the router and background services.
  • Document the dependency boundary. Concrete operations may still be supplied as bound Proxy methods, but consumers do not depend on that implementation.

Validation

  • 185 targeted handler, route, application, and aggregated tests passed during implementation.
  • 222 additional CLI, scheduler, discovery, metrics, tokenizer, launcher, and monitoring compatibility tests passed.
  • Final 83 focused cases passed after adding resolvable-annotation and shared-ZMQ-listener coverage (overlaps the earlier targeted run).
  • Covered standalone callback handlers, sync/async custom handlers, proxy-first startup, partial node loss, reconnection, status/heartbeat output, cancellation/reservation cleanup, and lifecycle ordering.
  • Ruff, isort, Black, Flake8/bugbear, and whitespace checks passed.
  • Lifecycle validation used simulated backends; no model/GPU services were started.

…dlers

Signed-off-by: Tony Lin <tony.lin@intel.com>
Comment thread xpyd/interfaces.py Fixed
Comment thread xpyd/interfaces.py Fixed
Comment thread xpyd/interfaces.py Fixed
Comment thread xpyd/interfaces.py Fixed
Comment thread xpyd/interfaces.py Fixed
Comment thread xpyd/interfaces.py Fixed
Comment thread xpyd/interfaces.py Fixed
CodeQL flags the standalone ellipsis expression in the new Protocol method
bodies (alerts 47-53). 'pass' is equivalent for typing purposes and does not
trip py/ineffectual-statement.
@hlin99
hlin99 merged commit 181e614 into main Oct 29, 2026
24 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