SurfSense/surfsense_backend
CREDO23 6671c91841 multi_agent_chat/permissions: persist 'always' decisions to trusted-tools list
Until now an "Always Allow" reply only updated the in-memory runtime
ruleset, evaporating after the session ended. Persist it to the
existing connector.config['trusted_tools'] list so the next session's
fetch_user_allowlist_rulesets picks it up and the user is never asked
again for the same (connector, tool) pair.

- TrustedToolSaver + make_trusted_tool_saver(user_id) in
  user_tool_allowlist: opens its own session via async_session_maker
  per call, logs and swallows failures (in-memory promotion is the
  canonical "always" path, durable persistence is opportunistic).

- PermissionMiddleware._process is now pure: returns
  (state_update, list[_AlwaysPromotion]). aafter_model awaits the
  saver for each promotion; after_model discards them. Promotions are
  only emitted for tools whose metadata exposes mcp_connector_id, so
  native tools and KB FS ops are correctly skipped.

- main_agent factory builds the saver once per turn and stashes it in
  dependencies["trusted_tool_saver"]; pack_subagent and the KB
  middleware stack forward it through build_permission_mw.

- Renamed pm._process(state, None) call sites in two existing tests to
  pm.after_model(state, None) so they exercise the public hook
  contract instead of the now-tuple-returning private method.
2026-05-15 14:07:08 +02:00
..
alembic feat: moved chat persistance to Server Side 2026-05-04 03:06:15 -07:00
app multi_agent_chat/permissions: persist 'always' decisions to trusted-tools list 2026-05-15 14:07:08 +02:00
scripts feat: fixed vision/image provider specific errors and fixed podcast/video streaming 2026-05-02 19:18:53 -07:00
tests multi_agent_chat/permissions: persist 'always' decisions to trusted-tools list 2026-05-15 14:07:08 +02:00
.dockerignore chore(backend): exclude tests/ from production Docker image 2026-05-06 17:16:22 +05:30
.env.example refactor(chat): stream agent events via stream_output and remove parity v2 flag 2026-05-07 19:40:10 +02:00
.gitignore feat: init video presentation agent 2026-03-21 22:13:41 -07:00
.python-version feat: SurfSense v0.0.6 init 2025-03-14 18:53:14 -07:00
alembic.ini add github connector, add alembic for db migrations, fix bug updating connectors 2025-04-13 13:56:22 -07:00
celery_worker.py fix: celery_app path and gmail indexing 2025-10-21 21:11:41 -07:00
Dockerfile fix: docker issues 2026-05-03 00:39:27 -07:00
main.py feat: added configable summary calculation and various improvements 2026-02-26 18:24:57 -08:00
pyproject.toml feat: bumped version to 0.0.23 2026-05-05 19:21:43 -07:00
uv.lock feat: bumped version to 0.0.23 2026-05-05 19:21:43 -07:00