Skip to content

refactor(context): extract end service#39

Merged
HugoSkylight merged 1 commit into
masterfrom
refactor/context-end-service
Apr 28, 2026
Merged

refactor(context): extract end service#39
HugoSkylight merged 1 commit into
masterfrom
refactor/context-end-service

Conversation

@HugoSkylight

Copy link
Copy Markdown
Contributor

Summary

Extracts ContextManager's end-phase coordination into a composed ContextEndService while keeping ContextManager._end(...) as the compatibility wrapper. The service now owns the end pipeline steps: merge wait/flush, immediate cleanup, conversation source persistence, orchestrator.session_end, autophagy scheduling, full recomposition wait, session summary generation, layer integrity checks, fail_fast handling, logging, and session cleanup.

This keeps prepare/commit behavior unchanged and preserves manager-owned session state plus collection-scoped session keys.

Validation

  • uv run --group dev ruff format --check .
  • uv run --group dev ruff check .
  • uv run --group dev pytest tests/test_context_manager.py -q
  • uv run --group dev pytest tests/test_noise_reduction.py tests/test_http_server.py tests/test_live_servers.py -q
  • uv run --group dev pytest -q (1271 passed, 28 skipped, 1 warning)

Browser Gate

Not applicable: this branch changes backend context lifecycle code and a plan document only; no browser-testable surface changed.

@HugoSkylight
HugoSkylight merged commit 0713217 into master Apr 28, 2026
1 check failed
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