Python
Merge main into feat/openrouter-account-signin
Rohit C Prasadbeca7058fb06
diff --cc coworker/server/manager.pyindex 08a5c040,9ee82e3c..d53d1faa--- a/coworker/server/manager.py+++ b/coworker/server/manager.py@@@ -3024,9 -4184,21 +4191,23 @@@ class SessionManagerfrom datetime import dateprofile["key_set_at"] = date.today().isoformat()+ if name == "openrouter" and "api_key" in fields:+ profile["auth_method"] = "api_key"self.secrets.put(f"provider:{name}", profile)+ self.adopt_provider_default(name)+ return {"ok": True, "provider": name, "recommended_model": d.recommended_model}++ def adopt_provider_default(self, name: str) -> Optional[str]:+ """After a provider's key arrived by ANY path (Settings, or a sealed+ deploy onto a machine): rebuild its client, surface its recommended+ model, and — first working provider wins — make that model the+ default when the current default cannot run (the fresh-install /+ fresh-sandbox gpt-5.6-sol case; owner-hit on a sandbox 2026-09-02).+ A default that already works is never stolen. Returns the model+ adopted, if any."""+ d = get_descriptor(name)+ if d is None:+ return Noneself._refresh_provider(name)# Convenience: if the provider recommends a model and it's actually available, add it to# the curated list so it shows up in the composer right after configuring the provider.diff --cc surfaces/gui/src/locales/en.jsonindex e45ae97c,964b7f83..fbf44bae--- a/surfaces/gui/src/locales/en.json+++ b/surfaces/gui/src/locales/en.json@@@ -1,20 -1,37 +1,53 @@@{+ "openrouter": {+ "title": "Or connect your OpenRouter account",+ "note": "Uses your OpenRouter credits. Signing in selects account billing; testing and saving an API key selects that key instead.",+ "signin": "Sign in with OpenRouter",+ "manual": "Use a manual code",+ "waiting": "Complete sign-in in your browser.",+ "reopen": "Reopen browser",+ "cancel": "Cancel",+ "code": "Authorization code",+ "connect": "Connect",+ "active": "Connected · account credentials active",+ "saved": "Account saved · API key active",+ "disconnect": "Disconnect account",+ "manage": "Manage or revoke keys on OpenRouter",+ "unreachable": "Could not complete the request. Check the connection and try again."+ },+ "proposal": {+ "manage_connectors": "Manage connectors",+ "proposed_work": "Proposed work",+ "proposed_team": "Proposed team",+ "acceptance_criteria": "Acceptance criteria",+ "final_acceptance": "Final acceptance",+ "owner_lead": "Owner: Lead",+ "owner_assigned_worker": "Owner: the worker assigned to this task",+ "tasks_one": "{{count}} task",+ "tasks_other": "{{count}} tasks",+ "workers_one": "{{count}} worker",+ "workers_other": "{{count}} workers",+ "depends_on": "Depends on",+ "verifies": "Verifies",+ "targets": "Targets",+ "external_actions": "External actions",+ "external_none": "None planned",+ "external_planned": "Planned actions",+ "external_undetermined": "Not yet determined",+ "not_planned": "Explicitly not planned",+ "intent_not_permission": "Declared intent, not an access grant. Actions still follow approval settings and permissions.",+ "approve_plan": "Approve plan",+ "request_changes": "Request changes",+ "what_changes": "What should change?",+ "send_feedback": "Send feedback",+ "cancel": "Cancel",+ "worker_name": "Worker name",+ "invalid_names": "Use unique worker names: 1–24 letters, numbers, dots, underscores, or hyphens. Lead, user, and board are reserved.",+ "planned_responsibilities": "Planned responsibilities",+ "connector_access": "Connector access",+ "no_connectors": "No connectors selected",+ "staffing_not_assignment": "Creating the team does not start these tasks. Approval lets the lead create, assign, and steer this team. Workers receive only the connectors you select."+ },"boot": {"starting": "Starting OpenWorker…","restoring": "Restoring your session…"diff --cc surfaces/gui/src/locales/zh.jsonindex ea236de4,5330f9d2..2d90ec88--- a/surfaces/gui/src/locales/zh.json+++ b/surfaces/gui/src/locales/zh.json@@@ -1,20 -1,37 +1,53 @@@{+ "openrouter": {+ "title": "或连接您的 OpenRouter 账户",+ "note": "使用您的 OpenRouter 额度。登录后使用账户凭据;测试并保存 API 密钥后改用该密钥。",+ "signin": "使用 OpenRouter 登录",+ "manual": "手动输入授权码",+ "waiting": "请在浏览器中完成登录。",+ "reopen": "重新打开浏览器",+ "cancel": "取消",+ "code": "授权码",+ "connect": "连接",+ "active": "已连接 · 正在使用账户凭据",+ "saved": "账户已保存 · 正在使用 API 密钥",+ "disconnect": "断开账户连接",+ "manage": "在 OpenRouter 管理或撤销密钥",+ "unreachable": "无法完成请求。请检查连接后重试。"+ },+ "proposal": {+ "manage_connectors": "管理连接器",+ "proposed_work": "工作提案",+ "proposed_team": "团队提案",+ "acceptance_criteria": "验收标准",+ "final_acceptance": "最终验收",+ "owner_lead": "负责人:主管",+ "owner_assigned_worker": "负责人:被分配此任务的工作者",+ "tasks_one": "{{count}} 个任务",+ "tasks_other": "{{count}} 个任务",+ "workers_one": "{{count}} 位工作者",+ "workers_other": "{{count}} 位工作者",+ "depends_on": "依赖任务",+ "verifies": "验证任务",+ "targets": "目标",+ "external_actions": "外部操作",+ "external_none": "未计划外部操作",+ "external_planned": "计划的操作",+ "external_undetermined": "尚未确定",+ "not_planned": "明确不在计划内",+ "intent_not_permission": "这是意图声明,不是访问授权。操作仍须遵循审批设置和权限。",+ "approve_plan": "批准计划",+ "request_changes": "请求修改",+ "what_changes": "需要修改什么?",+ "send_feedback": "发送反馈",+ "cancel": "取消",+ "worker_name": "工作者名称",+ "invalid_names": "工作者名称必须唯一,使用 1–24 个字母、数字、点、下划线或连字符。lead、user 和 board 为保留名称。",+ "planned_responsibilities": "计划职责",+ "connector_access": "连接器访问权限",+ "no_connectors": "未选择连接器",+ "staffing_not_assignment": "创建团队不会启动这些任务。批准后,主管可以创建、分配和指导此团队。工作者仅获得您选择的连接器。"+ },"boot": {"starting": "正在启动 OpenWorker…","restoring": "正在恢复你的会话…"