You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refresh workspace context (ENTITY TYPES) per turn, not per session #1062
build_workspace_context (which includes ENTITY TYPES, collections, and playbooks) is called once at session creation and cached in session.dynamic_context. If the user creates a new schema type mid-session (e.g., "Project"), the system prompt still shows the old type list for the rest of that session.
This means:
The model doesn't know "Project" is a valid type until a new chat session is started
The model can't create instances of newly-defined types within the same conversation
The ENTITY TYPES section becomes stale immediately after any schema CRUD
Rebuild the workspace context per turn instead of per session. Two options:
Option A (simplest): Refresh context in the Tauri command layer before each send_message call:
// In local_agent_send_message command:let context = build_workspace_context(&ns).await.unwrap_or_default();
service.set_session_context(&session_id, context.format_for_prompt(1500)).await;// Then proceed with send_message
Option B: Pass a context provider into the agent loop so run_turn can fetch fresh context itself, without depending on external refresh.
Option A is minimal and keeps the agent loop dependency-free. The cost is one get_all_schemas query per turn (~1ms with cached schemas).
Acceptance Criteria
ENTITY TYPES in system prompt reflects current schemas on every turn
Creating a schema in turn N makes it available in turn N+1 within the same session
Collections and playbooks also refresh per turn
No significant latency increase (schema query is fast)
Activity
malibio commentedon Apr 7, 2026
Baseline: 128 test files passed, 3918 tests passed
Add real inference test validating per-turn context refresh mechanism
Refresh workspace context (ENTITY TYPES) per turn, not per session
Refresh workspace context (ENTITY TYPES) per turn, not per session
Refresh workspace context (ENTITY TYPES) per turn, not per session (#…
Refresh workspace context (ENTITY TYPES) per turn, not per session
Fix: retroactive review findings for #1062 workspace context refresh
Fix: retroactive review findings for #1062 workspace context refresh (#…
Refresh workspace context (ENTITY TYPES) per turn, not per session (#…
Fix: retroactive review findings for #1062 workspace context refresh (#…