Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions echo/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,16 @@ Production uses webhook mode (`ASSEMBLYAI_WEBHOOK_URL`); polling is only a fallb

The `agent/` directory contains the agentic chat service (LangGraph-based). It runs as a separate FastAPI service on port 8001. Agentic chat streams via `POST /api/agentic/runs/{run_id}/stream` — no Dramatiq dispatch. See `agent/README.md`.

## Directus File Cleanup

When removing a file reference from a user record (e.g. avatar, whitelabel logo), always delete the orphaned Directus file after clearing the reference. Pattern:

1. Fetch the current file ID from the user record
2. Update the user record to set the field to `None`
3. Delete the file via `directus.delete_file(file_id)`

Wrap all blocking Directus SDK calls in `run_in_thread_pool` (from `dembrane.async_helpers`) when used in async endpoints. See `server/dembrane/api/user_settings.py` for reference implementations in `remove_avatar` and `remove_whitelabel_logo`.

## Tech Debt / Known Issues
- Some mypy errors in `llm_router.py` and `settings.py` (pre-existing, non-blocking)

Expand Down
36 changes: 18 additions & 18 deletions echo/directus/sync/collections/operations.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"resolve": null,
"reject": null,
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "84c38ea6-5d15-429f-8c24-9485d54ba7be"
"_syncId": "615a54cd-a72e-41ad-9403-9577c80280d6"
},
{
"name": "Email Send Operation Failed Dutch",
Expand All @@ -93,7 +93,7 @@
"resolve": null,
"reject": null,
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "615a54cd-a72e-41ad-9403-9577c80280d6"
"_syncId": "84c38ea6-5d15-429f-8c24-9485d54ba7be"
},
{
"name": "failed",
Expand All @@ -107,7 +107,7 @@
"resolve": null,
"reject": null,
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "eb6f8253-647f-4fb1-9010-e93594ba065e"
"_syncId": "8d8d787a-dbc4-44f9-9ab4-28e3f3d5f31c"
},
{
"name": "failed",
Expand All @@ -121,7 +121,7 @@
"resolve": null,
"reject": null,
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "8d8d787a-dbc4-44f9-9ab4-28e3f3d5f31c"
"_syncId": "eb6f8253-647f-4fb1-9010-e93594ba065e"
},
{
"name": "Filter Emails",
Expand All @@ -132,10 +132,10 @@
"options": {
"code": "module.exports = async function(data) {\n\n const submissions = data.get_all_participants;\n \n // Filter submissions to only include those where email_opt_in is true\n const filteredSubmissions = submissions.filter(sub => sub.email_opt_in === true);\n\n // Create an array with email, project_id and an email_opt_out token for each submission\n const result = filteredSubmissions.map(sub => ({\n project_name: data.project_data[0].name || '',\n\t\tdefault_conversation_title: data.project_data[0].default_conversation_title || '',\n\t\tconversation_name: sub.conversation_id.participant_name || '',\n email: sub.email,\n project_id: sub.project_id || '',\n token: sub.email_opt_out_token,\n language: data.check_report_language[0].language || 'empty',\n ADMIN_BASE_URL: \"{{ $env.ADMIN_BASE_URL }}\" || \"http://localhost:5173\",\n PARTICIPANT_BASE_URL: \"{{ $env.PARTICIPANT_BASE_URL }}\" || \"http://localhost:5174\", \n }));\n \n return result;\n};"
},
"resolve": "e101f00d-2fb8-4f40-9e0e-4d24da5bb1e9",
"resolve": "b8144cee-59f6-40d9-a849-dd0c639e4e31",
"reject": null,
"flow": "ec4e7ea5-72de-4365-b66f-d8f11b549495",
"_syncId": "efb3982e-5703-4c07-8982-a6e1b5218e4a"
"_syncId": "ca1ffbc5-cfce-4fb4-8f15-c128ea407d41"
},
{
"name": "Filter Emails",
Expand All @@ -146,10 +146,10 @@
"options": {
"code": "module.exports = async function(data) {\n\n const submissions = data.get_all_participants;\n \n // Filter submissions to only include those where email_opt_in is true\n const filteredSubmissions = submissions.filter(sub => sub.email_opt_in === true);\n\n // Create an array with email, project_id and an email_opt_out token for each submission\n const result = filteredSubmissions.map(sub => ({\n project_name: data.project_data[0].name || '',\n\t\tdefault_conversation_title: data.project_data[0].default_conversation_title || '',\n\t\tconversation_name: sub.conversation_id.participant_name || '',\n email: sub.email,\n project_id: sub.project_id || '',\n token: sub.email_opt_out_token,\n language: data.check_report_language[0].language || 'empty',\n ADMIN_BASE_URL: \"{{ $env.ADMIN_BASE_URL }}\" || \"http://localhost:5173\",\n PARTICIPANT_BASE_URL: \"{{ $env.PARTICIPANT_BASE_URL }}\" || \"http://localhost:5174\", \n }));\n \n return result;\n};"
},
"resolve": "b8144cee-59f6-40d9-a849-dd0c639e4e31",
"resolve": "e101f00d-2fb8-4f40-9e0e-4d24da5bb1e9",
"reject": null,
"flow": "ec4e7ea5-72de-4365-b66f-d8f11b549495",
"_syncId": "ca1ffbc5-cfce-4fb4-8f15-c128ea407d41"
"_syncId": "efb3982e-5703-4c07-8982-a6e1b5218e4a"
},
{
"name": "log environment vars",
Expand Down Expand Up @@ -213,7 +213,7 @@
"resolve": null,
"reject": null,
"flow": "ec4e7ea5-72de-4365-b66f-d8f11b549495",
"_syncId": "e8274ad4-5844-42cd-8a6b-d40d08cf83d3"
"_syncId": "84852456-3f3a-4906-be94-8b750159883b"
},
{
"name": "Report Not Published",
Expand All @@ -227,7 +227,7 @@
"resolve": null,
"reject": null,
"flow": "ec4e7ea5-72de-4365-b66f-d8f11b549495",
"_syncId": "84852456-3f3a-4906-be94-8b750159883b"
"_syncId": "e8274ad4-5844-42cd-8a6b-d40d08cf83d3"
},
{
"name": "Send Email Dutch",
Expand Down Expand Up @@ -256,9 +256,9 @@
]
},
"resolve": null,
"reject": "615a54cd-a72e-41ad-9403-9577c80280d6",
"reject": "84c38ea6-5d15-429f-8c24-9485d54ba7be",
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "ea78ec02-364d-4f18-80f8-ea5ac4c787ed"
"_syncId": "34fb6ee5-2813-484a-a1cc-f97de097509b"
},
{
"name": "Send Email Dutch",
Expand Down Expand Up @@ -287,9 +287,9 @@
]
},
"resolve": null,
"reject": "84c38ea6-5d15-429f-8c24-9485d54ba7be",
"reject": "615a54cd-a72e-41ad-9403-9577c80280d6",
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "34fb6ee5-2813-484a-a1cc-f97de097509b"
"_syncId": "ea78ec02-364d-4f18-80f8-ea5ac4c787ed"
},
{
"name": "Send Email English",
Expand Down Expand Up @@ -318,9 +318,9 @@
]
},
"resolve": null,
"reject": "920bd181-b2a2-4f0d-94dc-3b1a08c3f4ef",
"reject": "2b24450b-6a2e-4452-aba1-9814d17fef42",
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "3dbf2ea1-17f8-4bde-aa89-43278fe9a00f"
"_syncId": "9390ed2f-7dc6-4a6a-83da-2d87d478261d"
},
{
"name": "Send Email English",
Expand Down Expand Up @@ -349,9 +349,9 @@
]
},
"resolve": null,
"reject": "2b24450b-6a2e-4452-aba1-9814d17fef42",
"reject": "920bd181-b2a2-4f0d-94dc-3b1a08c3f4ef",
"flow": "17703446-fef0-49e9-bdc4-385db1311137",
"_syncId": "9390ed2f-7dc6-4a6a-83da-2d87d478261d"
"_syncId": "3dbf2ea1-17f8-4bde-aa89-43278fe9a00f"
},
{
"name": "Trigger Email Flow",
Expand Down
4 changes: 4 additions & 0 deletions echo/directus/sync/collections/policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
{
"role": "_sync_default_admin_role",
"sort": 1
},
{
"role": null,
"sort": null
}
],
"_syncId": "_sync_default_admin_policy"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
{
"collection": "prompt_template_preference",
"field": "static_template_id",
"type": "string",
"collection": "directus_users",
"field": "quick_access_preferences",
"type": "json",
"meta": {
"collection": "prompt_template_preference",
"collection": "directus_users",
"conditions": null,
"display": null,
"display_options": null,
"field": "static_template_id",
"field": "quick_access_preferences",
"group": null,
"hidden": false,
"interface": "input",
"interface": "input-code",
"note": null,
"options": null,
"readonly": false,
"required": false,
"searchable": true,
"sort": 5,
"special": null,
"sort": 9,
"special": [
"cast-json"
],
"translations": null,
"validation": null,
"validation_message": null,
"width": "full"
},
"schema": {
"name": "static_template_id",
"table": "prompt_template_preference",
"data_type": "character varying",
"default_value": null,
"max_length": 100,
"name": "quick_access_preferences",
"table": "directus_users",
"data_type": "json",
"default_value": [],
"max_length": null,
"numeric_precision": null,
"numeric_scale": null,
"is_nullable": true,
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading