[chat] ai_interaction.py uses module-level mutable globals for all manager singletons #729
Labels
No labels
area:chat
area:core
area:llm
area:routes
area:tools
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sleepy/odysseus#729
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
src/ai_interaction.pylines 26-31 define module-level mutable globals for all manager references:With setter functions (
set_session_manager,set_memory_manager,set_rag_manager) that mutate them. Every tool function in the file accesses these globals directly.This creates:
The same pattern was flagged in #671 for the tool system.
AGENTS.md violations
Suggested fix
Replace globals with an explicit
AIToolContextclass that receives managers via constructor injection. Functions take the context as a parameter instead of reading globals.