The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
Merge origin/main into fix/pkg10-creds-a
Teknium5541fa6c29ca
diff --cc gateway/session_authority.pyindex 26b01722b73,93a891be909..b25c95317b3--- a/gateway/session_authority.py+++ b/gateway/session_authority.py@@@ -58,11 -58,11 +58,14 @@@ class LiveSession# (a contended SQLite writer must not stall loop-side lock takers); readers holding that lock# still see the claim as started, so no snapshot shows a terminal row without its completion.settling: dict = field(default_factory=dict)+ # ``(revision key, payload)`` of the last ``session.context_breakdown``: Desktop re-polls it on+ # every idle mount and reconnect, and a rebuild walks the whole stored transcript (#140667).+ context_breakdown: tuple | None = None# A viewer attached while a guarded deferred pick awaits consent: the next boundary asks again.reask_pick: bool = False+ # (principal, effort) of a ``/reasoning`` command that arrived while a turn ran: applied in memory at+ # once, committed to the policy at the next boundary (gateway/session_setting_commands.py).+ pending_reasoning: tuple | None = None# A historic messaging row mounted for reading after its lane moved on (``/new``): ``route`` is# the lane's CURRENT key, which names another conversation, so nothing route-keyed (agent, Stop,# turns, eviction) may act through it (gateway/session_route_recovery.py). The lane publishingdiff --cc hermes_cli/gateway_agent.pyindex 4d47f1574a1,b83de5cff9f..39dc0190e33--- a/hermes_cli/gateway_agent.py+++ b/hermes_cli/gateway_agent.py@@@ -672,12 -610,16 +699,20 @@@ class GatewayAgentreceipt = adoptedelse:self._drain_stale()+ self._taken_turn_route = Nonetry:+ # Inside the try: staging an image is a gateway call, and its failure is a failed turn.+ # Building the params consumes a ``/model --once`` pick (``_take_turn_route``).- receipt = self.connection.call("prompt.submit", **self._submit_params(- user_message, persist_user_message, turn_author))+ state = self._state()+ if state.gaps != state.attached_gaps: # a replay gap between turns retired the subscription+ self.connection.reattach(turn.session_id, abandon=self._stop(turn))+ params = self._submit_params(user_message, persist_user_message, turn_author)+ if self._stop(turn)():+ raise CallStopped("prompt.submit")+ receipt = self.connection.call("prompt.submit", **{**params, "session_id": turn.session_id})+ except CallStopped: # main moved on (a later turn, /new, Ctrl-C's bound) before the submit++ self._give_back_turn_route() # nothing was sent: the pick is still owed+ return self._failed(history, user_message, "Stopped before the prompt was sent; nothing was sent.")except GatewayRPCError as exc:# The owner answered and refused: not a lost connection. Only its own site code# (session_busy: send again) is a verdict; any other refusal stays unclassified.