-
-
Notifications
You must be signed in to change notification settings - Fork 4
GUI State Management
Redux state is split into feature slices, chat-thread runtime, selectors, and RTK Query APIs with very little persisted state.
src/app/store.ts uses combineSlices with 12+ slices plus 20+ RTK Query APIs.
- feature reducers:
config,active_file,current_project,sidebar,selected_snippet,chat,history,pages,integrationsSlice,checkpointsSlice,patchesAndDiffsTrackerSlice,tasksSlice,connectionSlice,browserSlice,notificationsSlice,schedulerSlice,buddySlice,errorSlice,informationSlice - RTK Query reducers:
statsApi,capsApi,promptsApi,toolsApi,commandsApi,pathApi,pingApi,linksApi,checkpointsApi,knowledgeApi,knowledgeGraphApi,providersApi,modelsApi,trajectoriesApi,trajectoryApi,tasksApi,schedulerApi,taskMemoriesApi,taskDocumentsApi,browserApi,worktreesApi,skillsStatusApi,mcpServerInfoApi,chatModesApi,customizationApi,projectInformationApi,setupStatusApi,extensionsApi,pluginsApi,mcpMarketplaceApi,extensionsMarketplaceApi,memoryEnrichmentApi,buddyApi
Per-thread runtime lives in state.chat.threads[id] as ChatThreadRuntime.
state.chat.threads[id] = {
thread,
streaming,
waiting_for_response,
prevent_send,
error,
queued_items,
confirmation,
snapshot_received,
}Additional thread-runtime fields in the code include things like send_immediately, attachments, background agents, compression flags, session_state, and message indexes.
current_thread_idopen_thread_ids-
threadsmap
These drive tab switching and allow threads to continue processing even when not visible.
The codebase expects selectors to be used instead of directly reading state.chat.threads[id] in UI code.
-
selectVisibleMessages(state, threadId)— excludeseventandplanmessages -
selectEventLog(state, threadId)— returns normalized event messages, excludingplan_delta -
selectCurrentPlan(state, threadId)— returns the latest base plan for plan UI -
selectPlanDeltaEvents(state, threadId)— returns hiddenevent(plan_delta)messages -
selectSynthesizedPlanText(state, threadId)— merges plan text with plan-delta notes -
selectPlanHistory(state, threadId)— returns base plan followed by plan-delta events
Redux Persist is configured with a root whitelist of only:
touruserSurvey
Chat/history are intentionally ephemeral and not persisted.
| API | Typical endpoints |
|---|---|
capsApi |
/v1/caps |
commandsApi |
/v1/at-command-completion, /v1/at-command-preview
|
toolsApi |
/v1/tools, /v1/tools/check_confirmation
|
dockerApi |
/v1/docker-container-list, /v1/docker-container-action
|
integrationsApi |
/v1/integrations-list, /v1/integration-get, /v1/integration-save
|
modelsApi, providersApi
|
/v1/customization |
checkpointsApi |
/v1/preview_checkpoints, /v1/restore_checkpoints
|
linksApi |
/v1/links |
trajectoriesApi, trajectoryApi
|
/v1/trajectories/* |
tasksApi |
task CRUD |
chatModesApi, customizationApi
|
agent modes/customization |
knowledgeApi, knowledgeGraphApi
|
knowledge/memory |
Refact on GitHub: https://github.com/JegernOUTT/refact
- Agent Modes
- Agent Tools
- Task Planner & Cards
- Worktrees
- Subagents
- Memory & Knowledge
- Hidden Roles & Plans
- Context Compression
- Scheduler & Cron
- Processes & PTY
- Buddy
- MCP
- Skills, Commands & Hooks
- Marketplace
- Chat System
- Providers
- Caps & Models
- Code Completion (FIM)
- AST
- VecDB
- Exec Runtime
- HTTP API
- Checkpoints & Git
- Voice