SurfSense/surfsense_backend/app
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
..
agents multi_agent_chat/permissions: persist 'always' decisions to trusted-tools list 2026-05-15 14:07:08 +02:00
config refactor(chat): drop alternate streaming entry path; use graph_stream 2026-05-07 19:25:20 +02:00
connectors chore: linting 2026-04-27 14:04:50 -07:00
etl_pipeline feat: unified credits and its cost calculations 2026-05-02 14:34:23 -07:00
indexing_pipeline feat(chunker): add table-aware chunk_text_hybrid to prevent mid-row table splits 2026-05-05 12:48:04 +08:00
observability chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
prompts feat: add PDF preview and export functionality for Typst-based reports, enhance report content handling 2026-04-15 21:11:27 +05:30
retriever feat: made agent file sytem optimized 2026-03-28 16:39:46 -07:00
routes user_tool_allowlist: extract trust-tool storage into reusable service 2026-05-14 21:20:30 +02:00
schemas feat: improved document, folder mentions rendering 2026-05-09 22:15:51 -07:00
services multi_agent_chat/permissions: persist 'always' decisions to trusted-tools list 2026-05-15 14:07:08 +02:00
tasks chat/stream_resume: salt thinking-step prefix with turn_id to avoid duplicate React keys 2026-05-13 21:15:51 +02:00
templates feat: update report generation and export capabilities to support multiple formats (PDF, DOCX, HTML, LaTeX, EPUB, ODT, plain text) across documentation and backend 2026-03-09 18:41:21 -07:00
utils chore: linting 2026-04-28 21:37:51 -07:00
__init__.py feat: SurfSense v0.0.6 init 2025-03-14 18:53:14 -07:00
app.py feat: add CORS preflight response caching for 24 hours 2026-05-04 19:55:19 -07:00
celery_app.py feat: unified credits and its cost calculations 2026-05-02 14:34:23 -07:00
db.py feat: moved chat persistance to Server Side 2026-05-04 03:06:15 -07:00
exceptions.py feat: add processing mode support for document uploads and ETL pipeline, improded error handling ux 2026-04-14 21:26:00 -07:00
rate_limiter.py try: ip fix for cludflare 2026-04-16 02:13:52 -07:00
users.py Seed default prompts on registration and for existing users 2026-03-31 18:12:09 +02:00