deerflow2/backend/app/gateway
Nan Gao 926406e0d6
fix(channels): make runtime provider state authoritative (#3580)
* fix(channels): make runtime provider state authoritative

* make format

* fix(channels): close runtime provider config races and status gaps

Address review findings on the runtime-provider-state change:

- configure/disconnect now re-read the live app.state.channels_config
  after the worker await and mutate only the affected provider key in
  place, so a concurrent mutation for a different provider is no longer
  clobbered by a stale pre-await snapshot.
- disconnect revokes DB connection rows before committing the store and
  cache, so a repo failure cannot leave the store/cache "disconnected"
  while the DB keeps "connected" rows a later re-configure would
  silently reactivate.
- _provider_response preserves non-connected statuses (e.g. revoked)
  when the provider is unavailable, only masking a stale "connected"
  row as not_connected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 07:45:46 +08:00
..
auth fix(auth): persist auto-generated JWT secret to survive restarts (#2933) 2026-05-16 09:24:40 +08:00
routers fix(channels): make runtime provider state authoritative (#3580) 2026-06-17 07:45:46 +08:00
__init__.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
app.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
auth_disabled.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
auth_middleware.py fix: align auth-disabled mode and mock history loading (#3471) 2026-06-10 16:11:00 +08:00
authz.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
config.py fix(nginx): defer CORS to gateway allowlist (#2861) 2026-05-11 17:38:37 +08:00
csrf_middleware.py fix: align auth-disabled mode and mock history loading (#3471) 2026-06-10 16:11:00 +08:00
deps.py fix: align auth-disabled mode and mock history loading (#3471) 2026-06-10 16:11:00 +08:00
internal_auth.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
langgraph_auth.py fix: align auth-disabled mode and mock history loading (#3471) 2026-06-10 16:11:00 +08:00
pagination.py fix: load paginated run history messages (#3305) 2026-06-01 15:50:39 +08:00
path_utils.py feat(persistence): per-user filesystem isolation, run-scoped APIs, and state/history simplification (#2153) 2026-04-26 11:13:01 +08:00
services.py fix(subagents): raise general-purpose max_turns to 150 and default timeout to 30min (#3610) 2026-06-16 19:55:04 +08:00
utils.py feat(persistence): add unified persistence layer with event store, token tracking, and feedback (#1930) 2026-04-26 11:05:47 +08:00