SurfSense/surfsense_backend/app/agents/new_chat
CREDO23 227983a104 refactor(agents): move middleware package to app/agents/shared (slice 5c)
Relocate the entire new_chat/middleware/ package to the shared kernel as one
cohesive unit (it is live shared infrastructure: the multi-agent stack wraps
nearly every middleware via multi_agent_chat/middleware/main_agent/*, and
anonymous_agent consumes it too). Flip 69 live importers across both the
package-path and submodule-path forms.

Shims left for the frozen single-agent stack: a package __init__ re-export plus
submodule shims for permission, skills_backends, and scoped_model_fallback
(the three imported via submodule path by chat_deepagent/subagents).

Cycle break: importing shared.middleware previously reached back into
new_chat.tools at module load, which dragged in new_chat.__init__ ->
chat_deepagent -> the middleware shim -> half-initialized shared.middleware.
Made action_log's ToolDefinition import TYPE_CHECKING-only and
tool_call_repair's INVALID_TOOL_NAME import function-local. These tools-package
back-edges fully resolve in slice 6.

Asset note: skills_backends._default_builtin_root now walks to
app/agents/new_chat/skills/builtin (the skills/ tree migrates in slice 7).
2026-06-04 13:00:41 +02:00
..
middleware refactor(agents): move middleware package to app/agents/shared (slice 5c) 2026-06-04 13:00:41 +02:00
plugins chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
prompts refactor: remove search_surfsense_docs tool and related references 2026-05-28 22:35:14 -07:00
skills refactor: remove search_surfsense_docs tool and related references 2026-05-28 22:35:14 -07:00
subagents refactor: remove search_surfsense_docs tool and related references 2026-05-28 22:35:14 -07:00
tools refactor(agents): move middleware package to app/agents/shared (slice 5c) 2026-06-04 13:00:41 +02:00
__init__.py cloud: added openrouter integration with global configs 2026-04-15 23:46:29 -07:00
agent_cache.py feat: implement agent caches and fix invalid prompt cache configs 2026-05-03 06:03:40 -07:00
anonymous_agent.py refactor(agents): move middleware package to app/agents/shared (slice 5c) 2026-06-04 13:00:41 +02:00
chat_deepagent.py refactor: extract shared connector->searchable-type mapping out of chat_deepagent 2026-06-04 12:05:17 +02:00
connector_searchable_types.py refactor: extract shared connector->searchable-type mapping out of chat_deepagent 2026-06-04 12:05:17 +02:00
context.py refactor(agents): move context schema + state reducers to app/agents/shared (slice 2) 2026-06-04 12:19:22 +02:00
feature_flags.py refactor(agents): move feature flags to app/agents/shared/feature_flags (slice 2b) 2026-06-04 12:23:12 +02:00
filesystem_backends.py refactor(agents): move middleware package to app/agents/shared (slice 5c) 2026-06-04 13:00:41 +02:00
filesystem_selection.py refactor(agents): move filesystem_selection to app/agents/shared (slice 3a) 2026-06-04 12:28:20 +02:00
llm_config.py refactor(agents): move llm_config + prompt_caching to app/agents/shared (slice 4b) 2026-06-04 12:41:52 +02:00
permissions.py refactor(agents): move permissions to app/agents/shared (slice 4a) 2026-06-04 12:38:30 +02:00
plugin_loader.py chore: cleaned comments slop 2026-04-28 23:52:37 -07:00
prompt_caching.py refactor(agents): move llm_config + prompt_caching to app/agents/shared (slice 4b) 2026-06-04 12:41:52 +02:00
system_prompt.py Wire Linear and Slack specialists and prompt routing. 2026-04-29 20:51:06 +02:00