soothe-daemon 1.2.2__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/PKG-INFO +1 -1
  2. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/display/loop_card_manager.py +1 -1
  3. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/protocol/error_codes.py +2 -2
  4. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/protocol/router.py +2 -2
  5. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/protocol/schemas.py +1 -2
  6. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/server/core.py +30 -10
  7. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/server/session.py +1 -1
  8. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/.gitignore +0 -0
  9. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/README.md +0 -0
  10. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/pyproject.toml +0 -0
  11. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/README.md +0 -0
  12. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/__init__.py +0 -0
  13. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/__main__.py +0 -0
  14. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/admin_rpc.py +0 -0
  15. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/bootstrap/__init__.py +0 -0
  16. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/bootstrap/entrypoint.py +0 -0
  17. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/bootstrap/env.py +0 -0
  18. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/bootstrap/logging.py +0 -0
  19. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/bootstrap/paths.py +0 -0
  20. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/bootstrap/port_lookup.py +0 -0
  21. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/bootstrap/singleton.py +0 -0
  22. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channel_manager.py +0 -0
  23. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/__init__.py +0 -0
  24. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/acp.py +0 -0
  25. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/base.py +0 -0
  26. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/dingtalk.py +0 -0
  27. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/discord.py +0 -0
  28. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/email.py +0 -0
  29. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/events.py +0 -0
  30. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/feishu.py +0 -0
  31. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/matrix.py +0 -0
  32. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/message.py +0 -0
  33. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/mochat.py +0 -0
  34. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/msteams.py +0 -0
  35. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/platform_helpers.py +0 -0
  36. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/qq.py +0 -0
  37. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/registry.py +0 -0
  38. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/signal.py +0 -0
  39. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/slack.py +0 -0
  40. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/telegram.py +0 -0
  41. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/websocket.py +0 -0
  42. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/wecom.py +0 -0
  43. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/weixin.py +0 -0
  44. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/channels/whatsapp.py +0 -0
  45. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cli.py +0 -0
  46. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/config/__init__.py +0 -0
  47. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/config/models.py +0 -0
  48. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/config/settings.py +0 -0
  49. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/__init__.py +0 -0
  50. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/builtin.py +0 -0
  51. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/extraction.py +0 -0
  52. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/messages.py +0 -0
  53. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/models.py +0 -0
  54. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/schedule.py +0 -0
  55. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/service.py +0 -0
  56. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/store.py +0 -0
  57. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/store_factory.py +0 -0
  58. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/cron/store_postgres.py +0 -0
  59. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/display/__init__.py +0 -0
  60. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/display/display_store.py +0 -0
  61. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/display/display_store_postgres.py +0 -0
  62. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/display/loop_card_ledger.py +0 -0
  63. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/display/loop_history_probe.py +0 -0
  64. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/event/__init__.py +0 -0
  65. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/event/bus.py +0 -0
  66. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/event/reattachment.py +0 -0
  67. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/event/size_stats.py +0 -0
  68. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/event/topic.py +0 -0
  69. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/events/__init__.py +0 -0
  70. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/events/constants.py +0 -0
  71. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/__init__.py +0 -0
  72. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/checker.py +0 -0
  73. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/checks/__init__.py +0 -0
  74. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/checks/config_check.py +0 -0
  75. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/checks/daemon_check.py +0 -0
  76. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/checks/external_apis_check.py +0 -0
  77. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/checks/loop_stall_check.py +0 -0
  78. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/formatters.py +0 -0
  79. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/health/models.py +0 -0
  80. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/identity_cli.py +0 -0
  81. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/notify/__init__.py +0 -0
  82. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/notify/email_sink.py +0 -0
  83. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/notify/factory.py +0 -0
  84. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/notify/feishu_sink.py +0 -0
  85. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/notify/models.py +0 -0
  86. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/notify/protocol.py +0 -0
  87. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/notify/render.py +0 -0
  88. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/notify/webhook_sink.py +0 -0
  89. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/persistence/__init__.py +0 -0
  90. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/persistence/__main__.py +0 -0
  91. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/persistence/health_check.py +0 -0
  92. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/persistence/pools.py +0 -0
  93. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/persistence/process_cleanup.py +0 -0
  94. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/protocol/__init__.py +0 -0
  95. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/protocol/intake_scope.py +0 -0
  96. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/protocol/intent_hints.py +0 -0
  97. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/protocol/validation.py +0 -0
  98. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/query/__init__.py +0 -0
  99. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/query/engine.py +0 -0
  100. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/query/error_format.py +0 -0
  101. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/query/stream_delivery.py +0 -0
  102. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/query/turn_boundary.py +0 -0
  103. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/__init__.py +0 -0
  104. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/_worker_runner.py +0 -0
  105. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/boxlite_runner.py +0 -0
  106. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/factory.py +0 -0
  107. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/firecracker_runner.py +0 -0
  108. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/local_model_server.py +0 -0
  109. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/pool_runner.py +0 -0
  110. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/ray_actor.py +0 -0
  111. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/ray_runner.py +0 -0
  112. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/response_bridge.py +0 -0
  113. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/stream_cancel.py +0 -0
  114. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/thread_runner.py +0 -0
  115. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runner/worker_loop_ids.py +0 -0
  116. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runtime/__init__.py +0 -0
  117. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runtime/auto_resume.py +0 -0
  118. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runtime/loop_broadcast_budget.py +0 -0
  119. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runtime/loop_dispatcher.py +0 -0
  120. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runtime/loop_gc.py +0 -0
  121. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runtime/loop_reconcile.py +0 -0
  122. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/runtime/thread_state.py +0 -0
  123. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/server/__init__.py +0 -0
  124. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/server/auth_handler.py +0 -0
  125. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/server/commands.py +0 -0
  126. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/server/handlers.py +0 -0
  127. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/services/__init__.py +0 -0
  128. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/services/image_understanding.py +0 -0
  129. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/services/intent_hint_turn.py +0 -0
  130. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/services/memory_profiler.py +0 -0
  131. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/__init__.py +0 -0
  132. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/atomic.py +0 -0
  133. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/cmd.py +0 -0
  134. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/env_keys.py +0 -0
  135. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/paths.py +0 -0
  136. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/provider.py +0 -0
  137. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/scaffold.py +0 -0
  138. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/templates/__init__.py +0 -0
  139. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/templates/daemon.yml +0 -0
  140. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/templates/nano.yml +0 -0
  141. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/templates/soothe.yml +0 -0
  142. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/setup/validate.py +0 -0
  143. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/skillify/__init__.py +0 -0
  144. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/skillify/events.py +0 -0
  145. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/skillify/indexer.py +0 -0
  146. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/skillify/retriever.py +0 -0
  147. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/skillify/service.py +0 -0
  148. {soothe_daemon-1.2.2 → soothe_daemon-1.2.4}/src/soothe_daemon/skillify/warehouse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: soothe-daemon
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: Soothe daemon server - long-running agent runtime with WebSocket/HTTP transports
5
5
  Project-URL: Homepage, https://github.com/mirasoth/soothe
6
6
  Project-URL: Documentation, https://soothe.readthedocs.io
@@ -236,7 +236,7 @@ class LoopCardManager:
236
236
  mode: str,
237
237
  data: Any,
238
238
  ) -> None:
239
- """Queue one stream tuple for background card binding (§2.3).
239
+ """Queue one stream tuple for background card binding.
240
240
 
241
241
  Never blocks the daemon stream hot path. Failures are logged in the
242
242
  per-loop ingest worker.
@@ -171,8 +171,8 @@ class RpcProtocolError(Exception):
171
171
  def to_dict(self) -> dict[str, Any]:
172
172
  """Serialize the error object to a wire-ready envelope.
173
173
 
174
- Produces the `{type:'error', error:{code, message, data?}}` envelope
175
- §7.1. The nested `error` object always carries `code`
174
+ Produces the `{type:'error', error:{code, message, data?}}` envelope.
175
+ The nested `error` object always carries `code`
176
176
  and `message`; `data` is omitted when empty (no extra context).
177
177
 
178
178
  Returns:
@@ -2004,11 +2004,11 @@ class MessageRouter:
2004
2004
  loop_id: str,
2005
2005
  sync_source: str,
2006
2006
  ) -> str | None:
2007
- """Open a remote-sync workspace for a new loop (RFC-906 §51).
2007
+ """Open a remote-sync workspace for a new loop (RFC-906).
2008
2008
 
2009
2009
  Constructs the sync backend, opens a local workspace via the daemon's
2010
2010
  ``WorkspaceManager``, and returns the local root path. The agent
2011
- sees an ordinary filesystem path — never the remote URI (§52).
2011
+ sees an ordinary filesystem path — never the remote URI.
2012
2012
 
2013
2013
  Args:
2014
2014
  client_id: Client connection identifier (for error responses).
@@ -263,8 +263,7 @@ class JobDagParams(ParamsBase):
263
263
  class JobGuidanceParams(ParamsBase):
264
264
  """Params for method=job_guidance, type=request.
265
265
 
266
- The canonical field name for the guidance text is `content` (
267
- §10.1).
266
+ The canonical field name for the guidance text is `content`.
268
267
  """
269
268
 
270
269
  job_id: str = Field(..., min_length=1)
@@ -867,7 +867,7 @@ class SootheDaemon(DaemonHandlersMixin):
867
867
  accept_proto: list[str] | None = None,
868
868
  client_capabilities: list[str] | None = None,
869
869
  ) -> dict[str, Any]:
870
- """Build a `connection_ack` message §8.2.
870
+ """Build a `connection_ack` message.
871
871
 
872
872
  Negotiates protocol version and capabilities, then returns the
873
873
  ack envelope with daemon readiness state and heartbeat interval.
@@ -1471,11 +1471,39 @@ class SootheDaemon(DaemonHandlersMixin):
1471
1471
  )
1472
1472
 
1473
1473
  async def stop(self) -> None:
1474
- """Shut down the daemon gracefully."""
1474
+ """Shut down the daemon gracefully.
1475
+
1476
+ The singleton PID lock is released in a ``finally`` block so it is
1477
+ always freed — even when a background-task cancellation or pool
1478
+ teardown raises mid-shutdown. Without this, a timed-out ``stop()``
1479
+ leaves the lock held and poisons every subsequent ``start()`` with
1480
+ ``RuntimeError: Another Soothe daemon is already running``.
1481
+ """
1475
1482
  self._readiness_state = "stopped"
1476
1483
  self._readiness_message = None
1477
1484
  self._running = False
1478
1485
 
1486
+ try:
1487
+ await self._stop_internal()
1488
+ finally:
1489
+ # Release singleton lock and clean up files unconditionally.
1490
+ # ``_stop_internal`` may raise (e.g. CancelledError from a stuck
1491
+ # pool worker), but the PID lock must still be released so the
1492
+ # next daemon can start.
1493
+ if self._pid_lock_fd is not None:
1494
+ release_pid_lock(self._pid_lock_fd)
1495
+ self._pid_lock_fd = None
1496
+ else:
1497
+ cleanup_pid()
1498
+ logger.info("Soothe daemon stopped")
1499
+
1500
+ async def _stop_internal(self) -> None:
1501
+ """Perform the graceful shutdown steps (everything except PID lock release).
1502
+
1503
+ Raises propagate to :meth:`stop`, which releases the PID lock in its
1504
+ ``finally`` block. Keeping the lock release out of this method ensures
1505
+ a partial shutdown never strands the singleton lock.
1506
+ """
1479
1507
  # Stop memory profiler if running
1480
1508
  if self._memory_profiler is not None:
1481
1509
  self._memory_profiler.stop()
@@ -1643,14 +1671,6 @@ class SootheDaemon(DaemonHandlersMixin):
1643
1671
  self._default_executor.shutdown(wait=True)
1644
1672
  logger.debug("Default executor shut down")
1645
1673
 
1646
- # Release singleton lock and clean up files
1647
- if self._pid_lock_fd is not None:
1648
- release_pid_lock(self._pid_lock_fd)
1649
- self._pid_lock_fd = None
1650
- else:
1651
- cleanup_pid()
1652
- logger.info("Soothe daemon stopped")
1653
-
1654
1674
  # -- broadcast ----------------------------------------------------------
1655
1675
 
1656
1676
  def _stamp_active_turn_on_broadcast(self, msg: dict[str, Any]) -> dict[str, Any]:
@@ -299,7 +299,7 @@ class ClientSessionManager:
299
299
  ) -> StreamDeliveryMode:
300
300
  """Return stream shaping mode for a client or loop.
301
301
 
302
- §3.2: Preference is stored on `ClientSession`, not a shared
302
+ Preference is stored on `ClientSession`, not a shared
303
303
  per-loop map. When `client_id` is provided, that session's mode wins.
304
304
  Otherwise resolve via the client that owns in-flight work on `loop_id`.
305
305
 
File without changes
File without changes