Q173: agents work in the company's or task's language, not the display language

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-09 04:40:52 -04:00
1 parent 538d834647
commit 3f14e3f706
36 files changed
+268 -105

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
import type { DatabaseSync } from "node:sqlite";
import type { WorkLanguage } from "../../shared/domain";
/** The language agents work in on a task: the task's own, else its company's; the app's display language plays no part. */
export function taskWorkLanguage(db: DatabaseSync, orgId: string, taskId: string): WorkLanguage {
const row = db.prepare(`
select coalesce(t.work_language, o.work_language) as language
from tasks t join organizations o on o.id = t.org_id
where t.id = ? and t.org_id = ?
`).get(taskId, orgId) as { language: WorkLanguage } | undefined;
if (!row) throw new Error("Task was not found.");
return row.language;
}