diff --git a/conftest.py b/conftest.py index 9a139df42..c75faca88 100644 --- a/conftest.py +++ b/conftest.py @@ -235,9 +235,6 @@ class DisplayHistoryFixture: def prompt_response(self, key, previous_revision, **kwargs): return self._project("prompt_index_response", key, previous_revision, **kwargs) - def unfinished(self, key): - return self._project("has_unfinished_transcript_tail", key) - @pytest.fixture async def history(tmp_path: Path): diff --git a/nanobot/agent/hooks/file_edit_activity.py b/nanobot/agent/hooks/file_edit_activity.py index 17bddf41f..344607d41 100644 --- a/nanobot/agent/hooks/file_edit_activity.py +++ b/nanobot/agent/hooks/file_edit_activity.py @@ -62,7 +62,7 @@ class FileEditActivityHook(AgentHook): return self._trackers_by_call[self._tool_call_key(tool_call)] = trackers await self._emit([ - build_file_edit_start_event(tracker, typed_params) + build_file_edit_start_event(tracker) for tracker in trackers ]) diff --git a/nanobot/channels/email/tests/test_email_channel.py b/nanobot/channels/email/tests/test_email_channel.py index 668ebce05..e5cf50caf 100644 --- a/nanobot/channels/email/tests/test_email_channel.py +++ b/nanobot/channels/email/tests/test_email_channel.py @@ -62,7 +62,7 @@ def test_email_only_enables_final_reply_delivery() -> None: manager.config = Config.model_validate({"channels": {"email": {"enabled": True}}}) manager.bus = MessageBus() - channel = manager._build_channel("email", EmailChannel, {"enabled": True}) + channel = manager._build_channel(EmailChannel, {"enabled": True}) assert channel.send_progress is False assert channel.send_tool_hints is False diff --git a/nanobot/channels/email/webui/locales/en.json b/nanobot/channels/email/webui/locales/en.json index 73bda84d1..7c316ce34 100644 --- a/nanobot/channels/email/webui/locales/en.json +++ b/nanobot/channels/email/webui/locales/en.json @@ -157,8 +157,7 @@ }, "trustedAuthservIds": { "label": "Trusted authentication services", - "placeholder": "mx.google.com, comma separated", - "help": "Enter trusted authserv-id values.\n\nExact authserv-id values added by the receiving mail service. Required when SPF or DKIM verification is on." + "placeholder": "mx.google.com, comma separated" } } } diff --git a/nanobot/channels/email/webui/locales/es.json b/nanobot/channels/email/webui/locales/es.json index 183b9b263..67b81d0e3 100644 --- a/nanobot/channels/email/webui/locales/es.json +++ b/nanobot/channels/email/webui/locales/es.json @@ -158,8 +158,7 @@ }, "trustedAuthservIds": { "label": "Servicios de autenticación confiables", - "placeholder": "mx.google.com, separados por comas", - "help": "Introduce valores authserv-id de confianza.\n\nValores authserv-id exactos añadidos por el servicio receptor. Obligatorio al verificar SPF o DKIM." + "placeholder": "mx.google.com, separados por comas" } } } diff --git a/nanobot/channels/email/webui/locales/fr.json b/nanobot/channels/email/webui/locales/fr.json index 9d4bbd32d..2b8f5b964 100644 --- a/nanobot/channels/email/webui/locales/fr.json +++ b/nanobot/channels/email/webui/locales/fr.json @@ -158,8 +158,7 @@ }, "trustedAuthservIds": { "label": "Services d’authentification approuvés", - "placeholder": "mx.google.com, séparés par des virgules", - "help": "Saisissez les valeurs authserv-id de confiance.\n\nValeurs authserv-id exactes ajoutées par le service de réception. Requis si SPF ou DKIM est vérifié." + "placeholder": "mx.google.com, séparés par des virgules" } } } diff --git a/nanobot/channels/email/webui/locales/id.json b/nanobot/channels/email/webui/locales/id.json index 5ef23e055..c0fc82bf2 100644 --- a/nanobot/channels/email/webui/locales/id.json +++ b/nanobot/channels/email/webui/locales/id.json @@ -158,8 +158,7 @@ }, "trustedAuthservIds": { "label": "Layanan autentikasi tepercaya", - "placeholder": "mx.google.com, pisahkan dengan koma", - "help": "Masukkan nilai authserv-id tepercaya.\n\nNilai authserv-id persis yang ditambahkan layanan penerima. Wajib saat verifikasi SPF atau DKIM aktif." + "placeholder": "mx.google.com, pisahkan dengan koma" } } } diff --git a/nanobot/channels/email/webui/locales/ja.json b/nanobot/channels/email/webui/locales/ja.json index 7134385e7..f96091ed7 100644 --- a/nanobot/channels/email/webui/locales/ja.json +++ b/nanobot/channels/email/webui/locales/ja.json @@ -158,8 +158,7 @@ }, "trustedAuthservIds": { "label": "信頼する認証サービス", - "placeholder": "mx.google.com(カンマ区切り)", - "help": "信頼する authserv-id を入力します。\n\n受信メールサービスが追加する正確な authserv-id。SPF または DKIM 検証時は必須です。" + "placeholder": "mx.google.com(カンマ区切り)" } } } diff --git a/nanobot/channels/email/webui/locales/ko.json b/nanobot/channels/email/webui/locales/ko.json index 0251e56a3..4bc4f31d3 100644 --- a/nanobot/channels/email/webui/locales/ko.json +++ b/nanobot/channels/email/webui/locales/ko.json @@ -158,8 +158,7 @@ }, "trustedAuthservIds": { "label": "신뢰할 인증 서비스", - "placeholder": "mx.google.com, 쉼표로 구분", - "help": "신뢰하는 authserv-id를 입력하세요.\n\n수신 메일 서비스가 추가한 정확한 authserv-id입니다. SPF 또는 DKIM 확인 시 필수입니다." + "placeholder": "mx.google.com, 쉼표로 구분" } } } diff --git a/nanobot/channels/email/webui/locales/pt-BR.json b/nanobot/channels/email/webui/locales/pt-BR.json index 8ca20b136..011bd92cb 100644 --- a/nanobot/channels/email/webui/locales/pt-BR.json +++ b/nanobot/channels/email/webui/locales/pt-BR.json @@ -158,8 +158,7 @@ }, "trustedAuthservIds": { "label": "Serviços de autenticação confiáveis", - "placeholder": "mx.google.com, separados por vírgulas", - "help": "Informe valores authserv-id confiáveis.\n\nValores authserv-id exatos adicionados pelo serviço receptor. Obrigatório ao verificar SPF ou DKIM." + "placeholder": "mx.google.com, separados por vírgulas" } } } diff --git a/nanobot/channels/email/webui/locales/vi.json b/nanobot/channels/email/webui/locales/vi.json index e42cc3659..52ee621a7 100644 --- a/nanobot/channels/email/webui/locales/vi.json +++ b/nanobot/channels/email/webui/locales/vi.json @@ -158,8 +158,7 @@ }, "trustedAuthservIds": { "label": "Dịch vụ xác thực tin cậy", - "placeholder": "mx.google.com, phân tách bằng dấu phẩy", - "help": "Nhập các authserv-id đáng tin cậy.\n\nGiá trị authserv-id chính xác do dịch vụ nhận thư thêm vào. Bắt buộc khi xác minh SPF hoặc DKIM." + "placeholder": "mx.google.com, phân tách bằng dấu phẩy" } } } diff --git a/nanobot/channels/email/webui/locales/zh-CN.json b/nanobot/channels/email/webui/locales/zh-CN.json index 61002f117..946afaf71 100644 --- a/nanobot/channels/email/webui/locales/zh-CN.json +++ b/nanobot/channels/email/webui/locales/zh-CN.json @@ -157,8 +157,7 @@ }, "trustedAuthservIds": { "label": "可信邮件认证服务", - "placeholder": "mx.google.com,用逗号分隔", - "help": "填写可信的 authserv-id\n\n接收邮件服务添加的准确 authserv-id。启用 SPF 或 DKIM 验证时必填。" + "placeholder": "mx.google.com,用逗号分隔" } } }, diff --git a/nanobot/channels/email/webui/locales/zh-TW.json b/nanobot/channels/email/webui/locales/zh-TW.json index 14d200a69..bdf95ae6d 100644 --- a/nanobot/channels/email/webui/locales/zh-TW.json +++ b/nanobot/channels/email/webui/locales/zh-TW.json @@ -158,8 +158,7 @@ }, "trustedAuthservIds": { "label": "可信郵件驗證服務", - "placeholder": "mx.google.com,以逗號分隔", - "help": "填寫可信的 authserv-id\n\n接收郵件服務新增的準確 authserv-id。啟用 SPF 或 DKIM 驗證時必填。" + "placeholder": "mx.google.com,以逗號分隔" } } } diff --git a/nanobot/channels/feishu/connect.py b/nanobot/channels/feishu/connect.py index 14e9fa5df..d2882e358 100644 --- a/nanobot/channels/feishu/connect.py +++ b/nanobot/channels/feishu/connect.py @@ -31,7 +31,6 @@ class FeishuConnectSession: expire_in: int created_wall: float deadline: float - last_error: str | None = None class FeishuConnectStore: @@ -141,8 +140,7 @@ class FeishuConnectStore: device_code=session.device_code, domain=session.domain, ) - except (RuntimeError, OSError, json.JSONDecodeError, httpx.HTTPError) as exc: - session.last_error = str(exc) + except (RuntimeError, OSError, json.JSONDecodeError, httpx.HTTPError): return _pending_payload(session) status = result.get("status") diff --git a/nanobot/channels/feishu/webui/FeishuConnectFlow.tsx b/nanobot/channels/feishu/webui/FeishuConnectFlow.tsx index 85bac0ecc..981d561b9 100644 --- a/nanobot/channels/feishu/webui/FeishuConnectFlow.tsx +++ b/nanobot/channels/feishu/webui/FeishuConnectFlow.tsx @@ -4,7 +4,6 @@ import type { NanobotFeaturesPayload } from "@/lib/types"; import { FeishuConnectFlowView, useFeishuConnectLabels } from "./FeishuConnectFlowView"; export function FeishuConnectFlow({ - token, instanceId = "default", mode = "replace", idleLabel, @@ -21,7 +20,6 @@ export function FeishuConnectFlow({ const labels = useFeishuConnectLabels(); return ( None: port = _free_port() state = LinearStateStore(tmp_path / "linear.sqlite3") - write_entered, allow_write, listener_stopped = threading.Event(), threading.Event(), threading.Event() + loop = asyncio.get_running_loop() + write_entered, writer_join_entered = asyncio.Event(), asyncio.Event() + allow_write = threading.Event() + writer_thread: threading.Thread | None = None enqueue = state.enqueue_webhook monkeypatch.setattr(linear_connect, "_load_linear_config", lambda: _config(port)) monkeypatch.setattr(linear_connect, "LinearStateStore", lambda: state) def enqueue_after_release(delivery, payload): - write_entered.set() - assert allow_write.wait(3) + nonlocal writer_thread + writer_thread = threading.current_thread() + loop.call_soon_threadsafe(write_entered.set) + allow_write.wait() return enqueue(delivery, payload) monkeypatch.setattr(state, "enqueue_webhook", enqueue_after_release) store = linear_connect.LinearConnectStore() - started = await store.start() - lease = store._sessions[started["session_id"]].server - server = lease._server._server - shutdown_listener = server.shutdown + await store.start() + raw = json.dumps(_agent_webhook(), separators=(",", ":")).encode() + signature = hmac.new(b"webhook-secret", raw, hashlib.sha256).hexdigest() + # The request must not expire while the test deliberately holds its writer. + async with httpx.AsyncClient(timeout=None, trust_env=False) as client: + request = asyncio.create_task(client.post( + f"http://127.0.0.1:{port}/linear/webhook", + content=raw, + headers={ + "Content-Type": "application/json", + "Linear-Signature": signature, + "Linear-Delivery": "delivery-1", + }, + )) + closing = None + try: + async with asyncio.timeout(10): + await write_entered.wait() + assert writer_thread is not None + writer_join = writer_thread.join - def shutdown_and_signal(): - shutdown_listener() - listener_stopped.set() + def join_and_signal(timeout=None): + loop.call_soon_threadsafe(writer_join_entered.set) + writer_join(timeout) - monkeypatch.setattr(server, "shutdown", shutdown_and_signal) - request = asyncio.create_task(asyncio.to_thread(_post_webhook, port, _agent_webhook())) - closing = None - try: - assert await asyncio.to_thread(write_entered.wait, 1) - closing = asyncio.create_task(store.close()) - assert await asyncio.to_thread(listener_stopped.wait, 1) - assert not closing.done() - assert store.has_pending_work is True - finally: - allow_write.set() - response = await request - if closing is not None: - await closing - else: - await store.close() - assert response[0] == 200 + monkeypatch.setattr(writer_thread, "join", join_and_signal) + closing = asyncio.create_task(store.close()) + await writer_join_entered.wait() + assert not closing.done() + assert store.has_pending_work is True + finally: + allow_write.set() + try: + response = await asyncio.wait_for(request, timeout=10) + finally: + if closing is not None: + await closing + else: + await store.close() + assert response.status_code == 200 assert store.has_pending_work is False assert not store._sessions + assert [event.delivery_id for event in state.claim_webhooks()] == ["delivery-1"] @pytest.mark.asyncio diff --git a/nanobot/channels/linear/webui/LinearConnectFlow.tsx b/nanobot/channels/linear/webui/LinearConnectFlow.tsx index 42e07d44d..dd3b99bf6 100644 --- a/nanobot/channels/linear/webui/LinearConnectFlow.tsx +++ b/nanobot/channels/linear/webui/LinearConnectFlow.tsx @@ -8,7 +8,6 @@ import type { ChannelPluginConnectFlowProps } from "@/channel-plugins/types"; import { LinearConnectFlowView, linearConnectLabels } from "./LinearConnectFlowView"; export function LinearConnectFlow({ - token, feature, idleLabel, connectRequestId, @@ -23,7 +22,7 @@ export function LinearConnectFlow({ }) { const { t } = useTranslation(); const tx = channelTranslator(t, "linear"); - return tuple[dict[str, Any] | None, str]: """Download, decrypt if needed, and persist a Matrix attachment.""" atype = self._event_attachment_type(event) @@ -1437,7 +1437,7 @@ class MatrixChannel(BaseChannel): or not self._should_process_message(room, event) ): return - attachment, marker = await self._fetch_media_attachment(room, event) + attachment, marker = await self._fetch_media_attachment(event) parts: list[str] = [] if isinstance(body := getattr(event, "body", None), str) and body.strip(): parts.append(body.strip()) diff --git a/nanobot/channels/matrix/tests/test_matrix_channel.py b/nanobot/channels/matrix/tests/test_matrix_channel.py index 1cc943c41..c105d6f63 100644 --- a/nanobot/channels/matrix/tests/test_matrix_channel.py +++ b/nanobot/channels/matrix/tests/test_matrix_channel.py @@ -2781,7 +2781,6 @@ async def test_fetch_media_rejects_missing_declared_size(monkeypatch, tmp_path) ) attachment, marker = await channel._fetch_media_attachment( - SimpleNamespace(room_id="!room:matrix.org"), event, ) @@ -2809,7 +2808,6 @@ async def test_fetch_media_rejects_bool_declared_size(monkeypatch, tmp_path) -> ) attachment, marker = await channel._fetch_media_attachment( - SimpleNamespace(room_id="!room:matrix.org"), event, ) @@ -2837,7 +2835,6 @@ async def test_fetch_media_rejects_declared_oversized_before_download(monkeypatc ) attachment, marker = await channel._fetch_media_attachment( - SimpleNamespace(room_id="!room:matrix.org"), event, ) @@ -2865,7 +2862,6 @@ async def test_fetch_media_maps_streaming_cap_to_too_large(monkeypatch, tmp_path ) attachment, marker = await channel._fetch_media_attachment( - SimpleNamespace(room_id="!room:matrix.org"), event, ) diff --git a/nanobot/channels/mattermost/runtime.py b/nanobot/channels/mattermost/runtime.py index 0f8b06263..163ba2c4c 100644 --- a/nanobot/channels/mattermost/runtime.py +++ b/nanobot/channels/mattermost/runtime.py @@ -278,7 +278,7 @@ class MattermostChannel(BaseChannel): session_key = f"mattermost:{channel_id}:{thread_ts}" if thread_ts else None try: - await self._add_reaction(channel_id, post_id, self.config.react_emoji) + await self._add_reaction(post_id, self.config.react_emoji) except Exception: self.logger.debug("add reaction failed") @@ -537,7 +537,7 @@ class MattermostChannel(BaseChannel): self.logger.debug("remove reaction failed") if self.config.done_emoji: try: - await self._add_reaction(chat_id, meta["message_id"], self.config.done_emoji) + await self._add_reaction(meta["message_id"], self.config.done_emoji) except Exception: self.logger.debug("done reaction failed") @@ -612,7 +612,7 @@ class MattermostChannel(BaseChannel): self.logger.debug("remove reaction failed") if first_post_id and self.config.done_emoji: try: - await self._add_reaction(chat_id, first_post_id, self.config.done_emoji) + await self._add_reaction(first_post_id, self.config.done_emoji) except Exception: self.logger.debug("done reaction failed") @@ -721,7 +721,7 @@ class MattermostChannel(BaseChannel): self.logger.warning("file download failed for {}: {}", file_id, e) return None - async def _add_reaction(self, channel_id: str, post_id: str, emoji: str) -> None: + async def _add_reaction(self, post_id: str, emoji: str) -> None: if not self._self_id or not emoji: return await self._api_post("/api/v4/reactions", { diff --git a/nanobot/channels/mattermost/tests/test_mattermost_channel.py b/nanobot/channels/mattermost/tests/test_mattermost_channel.py index 47bb05c11..da8c7f0ad 100644 --- a/nanobot/channels/mattermost/tests/test_mattermost_channel.py +++ b/nanobot/channels/mattermost/tests/test_mattermost_channel.py @@ -784,7 +784,7 @@ async def test_coalesced_stream_end_posts_inline_content(): async def test_reaction_add_on_receipt(): channel, fake = _make_channel() channel._self_id = "bot_id" - await channel._add_reaction("chan_1", "post_1", "eyes") + await channel._add_reaction("post_1", "eyes") reactions = [c for c in fake.post_calls if c["path"] == "/api/v4/reactions"] assert len(reactions) >= 1 assert reactions[-1]["json"]["emoji_name"] == "eyes" diff --git a/nanobot/channels/qq/webui/QQConnectFlow.tsx b/nanobot/channels/qq/webui/QQConnectFlow.tsx index f00d37999..3b15f861e 100644 --- a/nanobot/channels/qq/webui/QQConnectFlow.tsx +++ b/nanobot/channels/qq/webui/QQConnectFlow.tsx @@ -7,7 +7,6 @@ import { channelStatusLabel } from "@/components/settings/channels/ChannelIdenti import { QQConnectFlowView, useQQConnectLabels } from "./QQConnectFlowView"; export function QQConnectFlow({ - token, feature, connectRequestId, onOpenAdvanced, @@ -20,7 +19,6 @@ export function QQConnectFlow({ : channelStatusLabel(feature, (key, fallback) => t(key, { defaultValue: fallback })); return ( str: """Include thread history the first time the bot is pulled into a Slack thread.""" - del channel_type # DM and channel threads are both fetched via conversations.replies if ( not self.config.include_thread_context or not self._web_client diff --git a/nanobot/channels/slack/tests/test_slack_channel.py b/nanobot/channels/slack/tests/test_slack_channel.py index 4aa9a58e2..e031ce0fb 100644 --- a/nanobot/channels/slack/tests/test_slack_channel.py +++ b/nanobot/channels/slack/tests/test_slack_channel.py @@ -464,7 +464,6 @@ async def test_with_thread_context_fetches_root_once() -> None: content = await channel._with_thread_context( "what did you see?", chat_id="C123", - channel_type="channel", thread_ts="111.000", raw_thread_ts="111.000", current_ts="113.000", @@ -483,7 +482,6 @@ async def test_with_thread_context_fetches_root_once() -> None: second = await channel._with_thread_context( "again", chat_id="C123", - channel_type="channel", thread_ts="111.000", raw_thread_ts="111.000", current_ts="114.000", @@ -509,7 +507,6 @@ async def test_with_thread_context_fetches_replies_in_dm_thread() -> None: content = await channel._with_thread_context( "what did you see?", chat_id="D123", - channel_type="im", thread_ts="211.000", raw_thread_ts="211.000", current_ts="213.000", diff --git a/nanobot/channels/telegram/runtime.py b/nanobot/channels/telegram/runtime.py index 0d7c894cb..fb9fa00ec 100644 --- a/nanobot/channels/telegram/runtime.py +++ b/nanobot/channels/telegram/runtime.py @@ -485,7 +485,6 @@ class _QueuedTelegramUpdate: kind: Literal["command", "message"] update: Update - context: ContextTypes.DEFAULT_TYPE sort_key: tuple[int, int] @@ -1937,7 +1936,6 @@ class TelegramChannel(BaseChannel): *, kind: Literal["command", "message"], update: Update, - context: ContextTypes.DEFAULT_TYPE, ) -> None: """Stage a Telegram update behind a short per-session reorder window.""" message = update.message @@ -1948,7 +1946,6 @@ class TelegramChannel(BaseChannel): _QueuedTelegramUpdate( kind=kind, update=update, - context=context, sort_key=self._sort_key_for_update(update), ) ) @@ -1970,9 +1967,9 @@ class TelegramChannel(BaseChannel): for item in batch: try: if item.kind == "command": - await self._process_forward_command(item.update, item.context) + await self._process_forward_command(item.update) else: - await self._process_message_update(item.update, item.context) + await self._process_message_update(item.update) except Exception as e: self.logger.warning( "Telegram queued update handling failed for {}: {}", @@ -1994,11 +1991,11 @@ class TelegramChannel(BaseChannel): if not update.message or not update.effective_user: return if not self._running: - await self._process_forward_command(update, context) + await self._process_forward_command(update) return - self._enqueue_ordered_update(kind="command", update=update, context=context) + self._enqueue_ordered_update(kind="command", update=update) - async def _process_forward_command(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: + async def _process_forward_command(self, update: Update) -> None: """Process a queued slash command.""" message = update.message user = update.effective_user @@ -2031,11 +2028,11 @@ class TelegramChannel(BaseChannel): if not update.message or not update.effective_user: return if not self._running: - await self._process_message_update(update, context) + await self._process_message_update(update) return - self._enqueue_ordered_update(kind="message", update=update, context=context) + self._enqueue_ordered_update(kind="message", update=update) - async def _process_message_update(self, update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: + async def _process_message_update(self, update: Update) -> None: """Process a queued Telegram message update.""" message = update.message diff --git a/nanobot/channels/telegram/tests/test_telegram_channel.py b/nanobot/channels/telegram/tests/test_telegram_channel.py index f8f7d8724..26d3b8b95 100644 --- a/nanobot/channels/telegram/tests/test_telegram_channel.py +++ b/nanobot/channels/telegram/tests/test_telegram_channel.py @@ -794,7 +794,7 @@ async def test_running_message_handler_reorders_same_session_updates() -> None: seen: list[int] = [] processed = asyncio.Event() - async def fake_process(update, context) -> None: + async def fake_process(update) -> None: seen.append(update.message.message_id) if len(seen) == 2: processed.set() diff --git a/nanobot/channels/tests/test_network_proxy.py b/nanobot/channels/tests/test_network_proxy.py index 83c526020..681a0fb1b 100644 --- a/nanobot/channels/tests/test_network_proxy.py +++ b/nanobot/channels/tests/test_network_proxy.py @@ -127,7 +127,7 @@ async def test_manager_keeps_shared_proxy_instance_scoped(monkeypatch) -> None: manager = object.__new__(ChannelManager) manager.config = Config(network=NetworkConfig(proxy=address)) manager.bus = MessageBus() - channel = manager._build_channel("whatsapp", WhatsAppChannel, {"useProxy": True}) + channel = manager._build_channel(WhatsAppChannel, {"useProxy": True}) assert channel.network is manager.config.network channels.append(channel) diff --git a/nanobot/channels/wecom/runtime.py b/nanobot/channels/wecom/runtime.py index 3fe3a8293..7fa6a0dcb 100644 --- a/nanobot/channels/wecom/runtime.py +++ b/nanobot/channels/wecom/runtime.py @@ -92,7 +92,6 @@ class WecomChannel(BaseChannel): self.config: WecomConfig = config self._client: Any = None self._processed_message_ids: OrderedDict[str, None] = OrderedDict() - self._loop: asyncio.AbstractEventLoop | None = None self._generate_req_id: Callable[[str], str] | None = None # Store frame headers for each chat to enable replies self._chat_frames: dict[str, Any] = {} @@ -114,7 +113,6 @@ class WecomChannel(BaseChannel): from wecom_aibot_sdk import WSClient, generate_req_id self._running = True - self._loop = asyncio.get_running_loop() self._generate_req_id = generate_req_id # Create WebSocket client diff --git a/nanobot/channels/wecom/tests/test_wecom_channel.py b/nanobot/channels/wecom/tests/test_wecom_channel.py index a2f5766a0..805e9d465 100644 --- a/nanobot/channels/wecom/tests/test_wecom_channel.py +++ b/nanobot/channels/wecom/tests/test_wecom_channel.py @@ -490,8 +490,6 @@ async def test_process_image_message() -> None: assert msg.media[0].endswith("photo.png") assert "[image:" in msg.content finally: - if os.path.exists(saved): - pass # may have been overwritten; clean up if exists # Clean up any photo.png in tempdir p = os.path.join(os.path.dirname(saved), "photo.png") if os.path.exists(p): diff --git a/nanobot/channels/weixin/connect.py b/nanobot/channels/weixin/connect.py index 746d8675d..fca2483a9 100644 --- a/nanobot/channels/weixin/connect.py +++ b/nanobot/channels/weixin/connect.py @@ -25,7 +25,6 @@ class WeixinConnectSession: force: bool created_wall: float deadline: float - last_error: str | None = None class WeixinConnectStore: @@ -123,7 +122,6 @@ class WeixinConnectStore: ) except Exception as exc: if session.channel.connect_poll_error_is_retryable(exc): - session.last_error = str(exc) return self._pending_payload(session) self._sessions.pop(session_id, None) await self._close_channel(session.channel) diff --git a/nanobot/channels/weixin/tests/test_weixin_hardening.py b/nanobot/channels/weixin/tests/test_weixin_hardening.py index e23ad9e9c..674eec270 100644 --- a/nanobot/channels/weixin/tests/test_weixin_hardening.py +++ b/nanobot/channels/weixin/tests/test_weixin_hardening.py @@ -107,7 +107,7 @@ def test_channel_manager_preserves_weixin_quota_defaults( manager.config = Config.model_validate({"channels": {"weixin": section}}) manager.bus = MessageBus() - channel = manager._build_channel("weixin", WeixinChannel, section) + channel = manager._build_channel(WeixinChannel, section) assert channel.send_progress is send_progress assert channel.send_tool_hints is send_tool_hints diff --git a/nanobot/channels/weixin/webui/WeixinConnectFlow.tsx b/nanobot/channels/weixin/webui/WeixinConnectFlow.tsx index a87286018..89069a656 100644 --- a/nanobot/channels/weixin/webui/WeixinConnectFlow.tsx +++ b/nanobot/channels/weixin/webui/WeixinConnectFlow.tsx @@ -9,7 +9,6 @@ import { isVerificationChallenge, WEIXIN_AUTH_EXPIRED_MESSAGE } from "./presenta export { WEIXIN_AUTH_EXPIRED_MESSAGE } from "./presentation"; export function WeixinConnectFlow({ - token, feature, authRecoveryActive = false, idleLabel, @@ -27,7 +26,6 @@ export function WeixinConnectFlow({ return ( dict } -def _json_response(status: int, payload: Any) -> httpx.Response: - return httpx.Response(status, json=payload) - - # ---------------------------------------------------------------------- # Retry policy # ---------------------------------------------------------------------- diff --git a/nanobot/channels/whatsapp_agent/webui/locales/en.json b/nanobot/channels/whatsapp_agent/webui/locales/en.json index 8d724ec75..7862c338e 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/en.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/en.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "Open agent setup guide", "officialLabel": "Open WhatsApp agent help", - "summary": "Connect nanobot through WhatsApp's Agent Platform API. Only you can chat with it, and it cannot access your other WhatsApp chats.", "privacyNotice": "Agent chats are not end-to-end encrypted. Messages are processed by nanobot and your configured model provider.", "fields": { "token": { "label": "API token", - "placeholder": "In WhatsApp, open Settings → Agents, create the agent, then copy the key from the agent chat → Chat info → API key.", - "help": "In WhatsApp, open Settings → Agents, create the agent, then copy the key from the agent chat → Chat info → API key." + "placeholder": "In WhatsApp, open Settings → Agents, create the agent, then copy the key from the agent chat → Chat info → API key." }, "allowFrom": { "label": "Allowed senders", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/es.json b/nanobot/channels/whatsapp_agent/webui/locales/es.json index 0ea0feecb..11af0dc93 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/es.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/es.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "Abrir la guía de configuración del agente", "officialLabel": "Abrir la ayuda de agentes de WhatsApp", - "summary": "Conecta nanobot mediante la API de WhatsApp Agent Platform. Solo tú puedes chatear con él y no puede acceder a tus otros chats de WhatsApp.", "privacyNotice": "Los chats con el agente no están cifrados de extremo a extremo. nanobot y el proveedor de modelos que hayas configurado procesan los mensajes.", "fields": { "token": { "label": "Token de API", - "placeholder": "En WhatsApp, abre Ajustes → Agentes, crea el agente y copia la clave desde el chat del agente → Info del chat → Clave de API.", - "help": "En WhatsApp, abre Ajustes → Agentes, crea el agente y copia la clave desde el chat del agente → Info del chat → Clave de API." + "placeholder": "En WhatsApp, abre Ajustes → Agentes, crea el agente y copia la clave desde el chat del agente → Info del chat → Clave de API." }, "allowFrom": { "label": "Remitentes permitidos", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/fr.json b/nanobot/channels/whatsapp_agent/webui/locales/fr.json index 57e4ddd36..4f4f49486 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/fr.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/fr.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "Ouvrir le guide de configuration de l'agent", "officialLabel": "Ouvrir l'aide des agents WhatsApp", - "summary": "Connectez nanobot via l'API WhatsApp Agent Platform. Vous seul pouvez lui écrire, et il ne peut pas accéder à vos autres conversations WhatsApp.", "privacyNotice": "Les conversations avec l'agent ne sont pas chiffrées de bout en bout. Les messages sont traités par nanobot et le fournisseur de modèles que vous avez configuré.", "fields": { "token": { "label": "Jeton d'API", - "placeholder": "Dans WhatsApp, ouvrez Réglages → Agents, créez l'agent, puis copiez la clé depuis la conversation de l'agent → Infos de la discussion → Clé API.", - "help": "Dans WhatsApp, ouvrez Réglages → Agents, créez l'agent, puis copiez la clé depuis la conversation de l'agent → Infos de la discussion → Clé API." + "placeholder": "Dans WhatsApp, ouvrez Réglages → Agents, créez l'agent, puis copiez la clé depuis la conversation de l'agent → Infos de la discussion → Clé API." }, "allowFrom": { "label": "Expéditeurs autorisés", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/id.json b/nanobot/channels/whatsapp_agent/webui/locales/id.json index e1f7a9673..112304fc9 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/id.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/id.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "Buka panduan penyiapan agen", "officialLabel": "Buka bantuan agen WhatsApp", - "summary": "Hubungkan nanobot melalui API WhatsApp Agent Platform. Hanya Anda yang dapat mengobrol dengannya, dan agen tidak dapat mengakses obrolan WhatsApp Anda yang lain.", "privacyNotice": "Obrolan dengan agen tidak dienkripsi secara menyeluruh. Pesan diproses oleh nanobot dan penyedia model yang Anda konfigurasikan.", "fields": { "token": { "label": "Token API", - "placeholder": "Di WhatsApp, buka Setelan → Agen, buat agen, lalu salin kunci dari obrolan agen → Info obrolan → Kunci API.", - "help": "Di WhatsApp, buka Setelan → Agen, buat agen, lalu salin kunci dari obrolan agen → Info obrolan → Kunci API." + "placeholder": "Di WhatsApp, buka Setelan → Agen, buat agen, lalu salin kunci dari obrolan agen → Info obrolan → Kunci API." }, "allowFrom": { "label": "Pengirim yang diizinkan", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/ja.json b/nanobot/channels/whatsapp_agent/webui/locales/ja.json index c8bfce81f..724809994 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/ja.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/ja.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "エージェント設定ガイドを開く", "officialLabel": "WhatsApp エージェントのヘルプを開く", - "summary": "WhatsApp Agent Platform API を通じて nanobot を接続します。会話できるのは本人だけで、他の WhatsApp チャットにはアクセスできません。", "privacyNotice": "エージェントとのチャットはエンドツーエンド暗号化されません。メッセージは nanobot と設定したモデルプロバイダーによって処理されます。", "fields": { "token": { "label": "API トークン", - "placeholder": "WhatsApp で 設定 → エージェント を開き、エージェントを作成して、エージェントのチャット → チャット情報 → API キー からキーをコピーします。", - "help": "WhatsApp で 設定 → エージェント を開き、エージェントを作成して、エージェントのチャット → チャット情報 → API キー からキーをコピーします。" + "placeholder": "WhatsApp で 設定 → エージェント を開き、エージェントを作成して、エージェントのチャット → チャット情報 → API キー からキーをコピーします。" }, "allowFrom": { "label": "許可する送信者", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/ko.json b/nanobot/channels/whatsapp_agent/webui/locales/ko.json index 08a072ce2..4c293530a 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/ko.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/ko.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "에이전트 설정 가이드 열기", "officialLabel": "WhatsApp 에이전트 도움말 열기", - "summary": "WhatsApp Agent Platform API를 통해 nanobot을 연결합니다. 나만 대화할 수 있으며 다른 WhatsApp 채팅에는 접근할 수 없습니다.", "privacyNotice": "에이전트와의 채팅에는 종단간 암호화가 적용되지 않습니다. 메시지는 nanobot과 설정한 모델 제공업체가 처리합니다.", "fields": { "token": { "label": "API 토큰", - "placeholder": "WhatsApp에서 설정 → 에이전트를 열고 에이전트를 만든 뒤 에이전트 채팅 → 채팅 정보 → API 키에서 키를 복사하세요.", - "help": "WhatsApp에서 설정 → 에이전트를 열고 에이전트를 만든 뒤 에이전트 채팅 → 채팅 정보 → API 키에서 키를 복사하세요." + "placeholder": "WhatsApp에서 설정 → 에이전트를 열고 에이전트를 만든 뒤 에이전트 채팅 → 채팅 정보 → API 키에서 키를 복사하세요." }, "allowFrom": { "label": "허용된 발신자", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/pt-BR.json b/nanobot/channels/whatsapp_agent/webui/locales/pt-BR.json index 5c12d353a..9e8000ecf 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/pt-BR.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/pt-BR.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "Abrir o guia de configuração do agente", "officialLabel": "Abrir a ajuda de agentes do WhatsApp", - "summary": "Conecte o nanobot pela API do WhatsApp Agent Platform. Só você pode conversar com ele, e ele não pode acessar suas outras conversas do WhatsApp.", "privacyNotice": "As conversas com o agente não têm criptografia de ponta a ponta. As mensagens são processadas pelo nanobot e pelo provedor de modelos que você configurou.", "fields": { "token": { "label": "Token de API", - "placeholder": "No WhatsApp, abra Configurações → Agentes, crie o agente e copie a chave em conversa do agente → Informações da conversa → Chave de API.", - "help": "No WhatsApp, abra Configurações → Agentes, crie o agente e copie a chave em conversa do agente → Informações da conversa → Chave de API." + "placeholder": "No WhatsApp, abra Configurações → Agentes, crie o agente e copie a chave em conversa do agente → Informações da conversa → Chave de API." }, "allowFrom": { "label": "Remetentes permitidos", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/vi.json b/nanobot/channels/whatsapp_agent/webui/locales/vi.json index 9820860d6..071949b2d 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/vi.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/vi.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "Mở hướng dẫn thiết lập tác nhân", "officialLabel": "Mở trợ giúp tác nhân WhatsApp", - "summary": "Kết nối nanobot qua API WhatsApp Agent Platform. Chỉ bạn có thể trò chuyện với tác nhân và tác nhân không thể truy cập các cuộc trò chuyện WhatsApp khác của bạn.", "privacyNotice": "Cuộc trò chuyện với tác nhân không được mã hóa đầu cuối. Tin nhắn được xử lý bởi nanobot và nhà cung cấp mô hình bạn đã cấu hình.", "fields": { "token": { "label": "Mã thông báo API", - "placeholder": "Trong WhatsApp, mở Cài đặt → Tác nhân, tạo tác nhân, rồi sao chép khóa từ trò chuyện của tác nhân → Thông tin trò chuyện → Khóa API.", - "help": "Trong WhatsApp, mở Cài đặt → Tác nhân, tạo tác nhân, rồi sao chép khóa từ trò chuyện của tác nhân → Thông tin trò chuyện → Khóa API." + "placeholder": "Trong WhatsApp, mở Cài đặt → Tác nhân, tạo tác nhân, rồi sao chép khóa từ trò chuyện của tác nhân → Thông tin trò chuyện → Khóa API." }, "allowFrom": { "label": "Người gửi được phép", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/zh-CN.json b/nanobot/channels/whatsapp_agent/webui/locales/zh-CN.json index 05f0340e0..54a61f3b3 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/zh-CN.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/zh-CN.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "打开智能体设置指南", "officialLabel": "打开 WhatsApp 智能体帮助", - "summary": "通过 WhatsApp Agent Platform API 接入 nanobot。只有你可以与它对话,它无法访问你的其他 WhatsApp 聊天。", "privacyNotice": "智能体对话不采用端到端加密。消息由 nanobot 和你配置的模型服务商处理。", "fields": { "token": { "label": "API 令牌", - "placeholder": "在 WhatsApp 中打开 设置 → 智能体,创建智能体,然后从智能体聊天 → 聊天信息 → API 密钥 复制密钥。", - "help": "在 WhatsApp 中打开 设置 → 智能体,创建智能体,然后从智能体聊天 → 聊天信息 → API 密钥 复制密钥。" + "placeholder": "在 WhatsApp 中打开 设置 → 智能体,创建智能体,然后从智能体聊天 → 聊天信息 → API 密钥 复制密钥。" }, "allowFrom": { "label": "允许的发送者", diff --git a/nanobot/channels/whatsapp_agent/webui/locales/zh-TW.json b/nanobot/channels/whatsapp_agent/webui/locales/zh-TW.json index 7ce24cd7f..e3f56eb33 100644 --- a/nanobot/channels/whatsapp_agent/webui/locales/zh-TW.json +++ b/nanobot/channels/whatsapp_agent/webui/locales/zh-TW.json @@ -2,13 +2,11 @@ "setup": { "docsLabel": "開啟代理設定指南", "officialLabel": "開啟 WhatsApp 代理說明", - "summary": "透過 WhatsApp Agent Platform API 連接 nanobot。只有你可以與它對話,它無法存取你的其他 WhatsApp 聊天。", "privacyNotice": "代理對話不採用端對端加密。訊息由 nanobot 和你設定的模型服務供應商處理。", "fields": { "token": { "label": "API 權杖", - "placeholder": "在 WhatsApp 中開啟 設定 → 代理,建立代理,然後從代理聊天 → 聊天資訊 → API 金鑰 複製金鑰。", - "help": "在 WhatsApp 中開啟 設定 → 代理,建立代理,然後從代理聊天 → 聊天資訊 → API 金鑰 複製金鑰。" + "placeholder": "在 WhatsApp 中開啟 設定 → 代理,建立代理,然後從代理聊天 → 聊天資訊 → API 金鑰 複製金鑰。" }, "allowFrom": { "label": "允許的寄件者", diff --git a/nanobot/cli/webui.py b/nanobot/cli/webui.py index 41fe275fc..1298d0f73 100644 --- a/nanobot/cli/webui.py +++ b/nanobot/cli/webui.py @@ -282,7 +282,6 @@ def webui( try: with run_webui_dev_server( target_url=webui_dev_proxy_target(webui_url), - browser_url=dev_browser_url, output=lambda message: console.print(message, style="dim", markup=False), ) as dev_server: managed = not existing_gateway or runtime.status().running diff --git a/nanobot/providers/openai_codex_provider.py b/nanobot/providers/openai_codex_provider.py index 539bf65de..ec1d0517a 100644 --- a/nanobot/providers/openai_codex_provider.py +++ b/nanobot/providers/openai_codex_provider.py @@ -630,7 +630,7 @@ def _build_codex_http_error(status_code: int, headers: httpx.Headers, raw: str) for marker in ("context_management", "compact_threshold", "compaction_trigger") ) return _CodexHTTPError( - _friendly_error(status_code, raw), status_code=status_code, + _friendly_error(status_code), status_code=status_code, retry_after=retry_after, error_type=error_type, error_code=error_code, should_retry=_should_retry_status(status_code, error_type, error_code, raw), compaction_unsupported=compaction_unsupported, @@ -643,8 +643,7 @@ def _prompt_cache_key(session_id: str) -> str: return hashlib.sha256(session_id.encode("utf-8")).hexdigest() -def _friendly_error(status_code: int, raw: str) -> str: - _ = raw +def _friendly_error(status_code: int) -> str: if status_code == 429: return "ChatGPT usage quota exceeded or rate limit triggered. Please try again later." return f"HTTP {status_code}: Codex API request failed" diff --git a/nanobot/session/display_history.py b/nanobot/session/display_history.py index a73d35264..044598fa4 100644 --- a/nanobot/session/display_history.py +++ b/nanobot/session/display_history.py @@ -111,9 +111,6 @@ class HistoryReader: ): yield HistoryTurn(*row) - def read_turn(self, ordinal: int) -> list[HistoryFact]: - return [fact for _, fact in self.read_entries(ordinal)] - def read_entries( self, ordinal: int, *, max_records: int | None = None, max_bytes: int | None = None, ) -> list[tuple[int, HistoryFact]]: diff --git a/nanobot/session/manager.py b/nanobot/session/manager.py index 00724f05d..1a55246d0 100644 --- a/nanobot/session/manager.py +++ b/nanobot/session/manager.py @@ -40,8 +40,6 @@ _MESSAGE_TIME_PREFIX_RE = re.compile(r"^\[Message Time: [^\]]+\]\n?") _LOCAL_IMAGE_BREADCRUMB_RE = re.compile(r"^\[image: (?:/|~)[^\]]+\]\s*$") _TOOL_CALL_ECHO_RE = re.compile(r'^\s*(?:generate_image|message)\([^)]*\)\s*$') _SESSION_PREVIEW_MAX_CHARS = 120 -_SESSION_LIST_PREVIEW_MAX_RECORDS = 200 -_SESSION_LIST_PREVIEW_MAX_CHARS = 1_000_000 _FORK_VOLATILE_METADATA_KEYS = { "_stopped_at_iteration_limit", PARENT_SESSION_KEY, @@ -484,11 +482,6 @@ class SessionManager: """Public decoder for components that inspect canonical session filenames.""" return SessionManager._decode_storage_key(stem) - @classmethod - def _session_key_from_path(cls, path: Path) -> str | None: - """Decode a session key only from a canonical collision-resistant filename.""" - return SessionLocation.session_key_from_path(path) - def _require_offline_mutation(self) -> None: if self._state is not None and self._state.is_bound: raise RuntimeError( diff --git a/nanobot/utils/file_edit_events.py b/nanobot/utils/file_edit_events.py index 27242a57d..2ce22cc1d 100644 --- a/nanobot/utils/file_edit_events.py +++ b/nanobot/utils/file_edit_events.py @@ -434,10 +434,7 @@ def _display_workspace(tool: Any, fallback: Path | None) -> Path | None: return fallback -def build_file_edit_start_event( - tracker: FileEditTracker, - params: dict[str, Any] | None = None, -) -> dict[str, Any]: +def build_file_edit_start_event(tracker: FileEditTracker) -> dict[str, Any]: return _event_payload( tracker, phase="start", @@ -450,7 +447,6 @@ def build_file_edit_start_event( def build_file_edit_end_event( tracker: FileEditTracker, - params: dict[str, Any] | None = None, *, diff: FileDiff | None = None, ) -> dict[str, Any]: diff --git a/nanobot/webui/build.py b/nanobot/webui/build.py index 07f36d1b0..d773f6325 100644 --- a/nanobot/webui/build.py +++ b/nanobot/webui/build.py @@ -45,14 +45,11 @@ class WebUIBundleStatus: source_dir: Path dist_dir: Path - index_html: Path source_available: bool dist_available: bool stale: bool reason: str newest_source: Path | None = None - newest_source_mtime_ns: int | None = None - dist_mtime_ns: int | None = None @property def needs_build(self) -> bool: @@ -116,7 +113,6 @@ def inspect_webui_bundle( return WebUIBundleStatus( source_dir=resolved_source, dist_dir=resolved_dist, - index_html=index_html, source_available=False, dist_available=index_html.is_file(), stale=False, @@ -127,7 +123,6 @@ def inspect_webui_bundle( return WebUIBundleStatus( source_dir=resolved_source, dist_dir=resolved_dist, - index_html=index_html, source_available=True, dist_available=False, stale=True, @@ -150,27 +145,21 @@ def inspect_webui_bundle( return WebUIBundleStatus( source_dir=resolved_source, dist_dir=resolved_dist, - index_html=index_html, source_available=True, dist_available=True, stale=True, reason="source_newer", newest_source=newest_source, - newest_source_mtime_ns=newest_source_mtime_ns, - dist_mtime_ns=dist_mtime_ns, ) return WebUIBundleStatus( source_dir=resolved_source, dist_dir=resolved_dist, - index_html=index_html, source_available=True, dist_available=True, stale=False, reason="fresh", newest_source=newest_source, - newest_source_mtime_ns=newest_source_mtime_ns, - dist_mtime_ns=dist_mtime_ns, ) diff --git a/nanobot/webui/dev.py b/nanobot/webui/dev.py index d4d312541..d6965d7d6 100644 --- a/nanobot/webui/dev.py +++ b/nanobot/webui/dev.py @@ -124,7 +124,6 @@ def _vite_command(runner: str, vite_cli: Path) -> list[str]: def start_webui_dev_server( *, target_url: str, - browser_url: str, source_dir: Path | None = None, runner: str | None = None, environ: Mapping[str, str] | None = None, @@ -190,13 +189,11 @@ def start_webui_dev_server( def run_webui_dev_server( *, target_url: str, - browser_url: str, output: Callable[[str], None] | None = None, ) -> Generator[WebUIDevServer, None, None]: """Run a Vite sidecar for the duration of a foreground WebUI command.""" server = start_webui_dev_server( target_url=target_url, - browser_url=browser_url, output=output, ) try: diff --git a/nanobot/webui/settings_api.py b/nanobot/webui/settings_api.py index 768b64fb6..36a2f9caf 100644 --- a/nanobot/webui/settings_api.py +++ b/nanobot/webui/settings_api.py @@ -361,7 +361,6 @@ def login_oauth_provider( query, oauth_flows=oauth_flows, config_path=config_path, - settings_payload=settings_payload, ) diff --git a/nanobot/webui/settings_models.py b/nanobot/webui/settings_models.py index 67a7fd7d9..514805724 100644 --- a/nanobot/webui/settings_models.py +++ b/nanobot/webui/settings_models.py @@ -178,19 +178,11 @@ def mask_secret_hint(secret: str | None) -> str | None: def _resolve_env_placeholders(value: str | None) -> str | None: if not value: return None - missing = False def replace(match: re.Match[str]) -> str: - nonlocal missing - env_value = os.environ.get(match.group(1)) - if env_value is None: - missing = True - return "" - return env_value + return os.environ.get(match.group(1), "") resolved = _ENV_REF_RE.sub(replace, value).strip() - if missing and not resolved: - return None return resolved or None @@ -1729,7 +1721,6 @@ def login_oauth_provider( *, oauth_flows: WebUIOAuthFlowRegistry, config_path: Path | None, - settings_payload: SettingsPayloadBuilder, ) -> dict[str, Any]: provider_name = (query_first(query, "provider") or "").strip() if not provider_name: diff --git a/nanobot/webui/transcript.py b/nanobot/webui/transcript.py index 0d72abc73..af8d7f472 100644 --- a/nanobot/webui/transcript.py +++ b/nanobot/webui/transcript.py @@ -389,13 +389,13 @@ def _coerce_page_limit(limit: int | None) -> int: def _transcript_turn_at_ordinal( - session_key: str, ordinal: int, *, history: HistoryReader, + ordinal: int, *, history: HistoryReader, ) -> list[dict[str, Any]] | None: return turn_records(history, ordinal) or None def _select_transcript_page( - session_key: str, *, history: HistoryReader, limit: int | None, + *, history: HistoryReader, limit: int | None, before: str | None, after: str | None = None, stats: TranscriptReplayStats | None = None, ) -> tuple[list[dict[str, Any]], dict[str, Any]]: stats = stats or TranscriptReplayStats() @@ -1302,7 +1302,7 @@ def build_webui_trace_detail_response( return None ordinal = int(match.group("turn")) message_id = match.group("message") - turn = _transcript_turn_at_ordinal(session_key, ordinal, history=history) + turn = _transcript_turn_at_ordinal(ordinal, history=history) if turn is None: return None turn, _ = _compact_completed_stream_deltas(turn, include_projection_receipts=True) @@ -1762,7 +1762,6 @@ def build_webui_thread_response( """Return canonical transcript events for the WebUI projector.""" replay_stats = stats or TranscriptReplayStats() lines, page = _select_transcript_page( - session_key, history=history, limit=limit, before=before, @@ -1919,7 +1918,6 @@ def _history_prompt_summaries(history: HistoryReader) -> _ChunkPromptView: def _build_prompt_view( - session_key: str, *, history: HistoryReader, session_turns_loader: Callable[[], list[_SessionBackfillTurn]] | None = None, @@ -2009,7 +2007,7 @@ def _prompt_view_snapshot( if cached is not None and (not cached.needs_canonical or session_version_loader is not None): _PROMPT_SNAPSHOTS.move_to_end(cache_key) return cached, revision - view = _build_prompt_view(session_key, history=history, session_turns_loader=session_turns_loader) + view = _build_prompt_view(history=history, session_turns_loader=session_turns_loader) # A caller supplying only messages cannot validate canonical changes, so a # recovered view needs a version loader before it can be reused. if (view.needs_canonical and session_version_loader is None) or revision != read_revision(): diff --git a/tests/agent/test_onboard_logic.py b/tests/agent/test_onboard_logic.py index 71476f611..8925f3891 100644 --- a/tests/agent/test_onboard_logic.py +++ b/tests/agent/test_onboard_logic.py @@ -196,9 +196,6 @@ class TestGetFieldTypeInfo: def test_handles_none_annotation(self): """Field with None annotation defaults to str.""" - class Model(BaseModel): - field: Any = None - # Create a mock field_info with None annotation field_info = SimpleNamespace(annotation=None) type_name, inner = _get_field_type_info(field_info) diff --git a/tests/agent/test_runner_governance.py b/tests/agent/test_runner_governance.py index a2b6b971a..5cf9726df 100644 --- a/tests/agent/test_runner_governance.py +++ b/tests/agent/test_runner_governance.py @@ -3,13 +3,12 @@ from __future__ import annotations import asyncio -from unittest.mock import AsyncMock, MagicMock, patch +from unittest.mock import AsyncMock, MagicMock import pytest import tiktoken from agent.runner_helpers import make_run_spec -from agent.session_helpers import mock_session_manager from nanobot.agent.context import TranscriptInput from nanobot.agent.context_governance import ( BACKFILL_CONTENT, @@ -77,22 +76,6 @@ def _compaction_state(spec: AgentRunSpec) -> ContextCompactionState: ) -def _make_loop(tmp_path): - from nanobot.agent.loop import AgentLoop - from nanobot.bus.queue import MessageBus - - bus = MessageBus() - provider = MagicMock() - provider.get_default_model.return_value = "test-model" - - with patch("nanobot.agent.loop.ContextBuilder"), \ - patch("nanobot.agent.loop.SessionManager", side_effect=mock_session_manager), \ - patch("nanobot.agent.loop.SubagentManager") as mock_sub_mgr: - mock_sub_mgr.return_value.cancel_by_session = AsyncMock(return_value=0) - loop = AgentLoop(bus=bus, provider=provider, workspace=tmp_path) - return loop - - async def test_provider_can_emit_without_an_event_specific_runner_callback(): from nanobot.events import AgentEvent diff --git a/tests/agent/test_unified_session.py b/tests/agent/test_unified_session.py index 4fe9c8eb0..dbeea73fc 100644 --- a/tests/agent/test_unified_session.py +++ b/tests/agent/test_unified_session.py @@ -27,10 +27,8 @@ from nanobot.bus.queue import MessageBus from nanobot.command.builtin import cmd_new, register_builtin_commands from nanobot.command.router import CommandContext, CommandRouter from nanobot.config.schema import AgentDefaults, Config -from nanobot.providers.base import GenerationSettings from nanobot.session.keys import UNIFIED_SESSION_KEY from nanobot.session.manager import SessionManager -from nanobot.utils.llm_runtime import LLMRuntime # --------------------------------------------------------------------------- # Helpers @@ -54,15 +52,6 @@ def _make_loop(tmp_path: Path, unified_session: bool = False) -> AgentLoop: return loop -def _runtime(provider) -> LLMRuntime: - provider.generation = GenerationSettings(max_tokens=100) - return LLMRuntime.capture( - provider, - "test-model", - context_window_tokens=1000, - ) - - def _make_msg(channel: str = "telegram", chat_id: str = "111", session_key_override: str | None = None) -> InboundMessage: return InboundMessage( diff --git a/tests/channels/test_channel_manager_compaction_notices.py b/tests/channels/test_channel_manager_compaction_notices.py index fa8da10f9..a2446d3a3 100644 --- a/tests/channels/test_channel_manager_compaction_notices.py +++ b/tests/channels/test_channel_manager_compaction_notices.py @@ -104,7 +104,7 @@ async def test_dispatch_forwards_all_compaction_phases_before_adapter_filtering( def test_global_notice_policy_and_channel_override(manager, global_value, override, key): manager.config.channels.show_compaction_notices = global_value section = {} if override is None else {key: override} - channel = manager._build_channel("mock", _MockChannel, section) + channel = manager._build_channel(_MockChannel, section) assert channel.show_compaction_notices is (global_value if override is None else override) @@ -112,10 +112,10 @@ def test_global_notice_config_round_trip_and_rebuild(manager): assert Config().channels.show_compaction_notices is False manager.config = Config.model_validate({"channels": {"showCompactionNotices": True}}) manager.config = Config.model_validate_json(manager.config.model_dump_json(by_alias=True)) - assert manager._build_channel("mock", _MockChannel, {}).show_compaction_notices is True + assert manager._build_channel(_MockChannel, {}).show_compaction_notices is True # Rebuilding an adapter after a config change must resolve the new default. manager.config.channels.show_compaction_notices = False - assert manager._build_channel("mock", _MockChannel, {}).show_compaction_notices is False + assert manager._build_channel(_MockChannel, {}).show_compaction_notices is False assert manager._build_channel( - "mock", _MockChannel, {"showCompactionNotices": True}, + _MockChannel, {"showCompactionNotices": True}, ).show_compaction_notices diff --git a/tests/channels/test_channel_manager_delta_coalescing.py b/tests/channels/test_channel_manager_delta_coalescing.py index 18fdf2b23..b73433f2b 100644 --- a/tests/channels/test_channel_manager_delta_coalescing.py +++ b/tests/channels/test_channel_manager_delta_coalescing.py @@ -77,7 +77,7 @@ def bus(): @pytest.fixture def manager(config, bus, tmp_path): manager = ChannelManager(config, bus, config_path=tmp_path / "config.json") - manager.channels["mock"] = manager._build_channel("mock", MockChannel, {}) + manager.channels["mock"] = manager._build_channel(MockChannel, {}) return manager @@ -288,7 +288,6 @@ class TestProgressFiltering: def test_progress_visibility_uses_channel_overrides(self, manager, bus): manager.channels["mock"] = manager._build_channel( - "mock", MockChannel, {"sendProgress": False, "sendToolHints": False}, ) @@ -307,7 +306,6 @@ class TestProgressFiltering: manager.bus = bus channel = manager._build_channel( - "mattermost", MattermostChannel, {"enabled": True}, ) @@ -316,7 +314,6 @@ class TestProgressFiltering: assert channel.send_tool_hints is False opted_in = manager._build_channel( - "mattermost", MattermostChannel, { "enabled": True, diff --git a/tests/channels/test_qq_compaction_notices.py b/tests/channels/test_qq_compaction_notices.py index 59418578b..be2cbca5f 100644 --- a/tests/channels/test_qq_compaction_notices.py +++ b/tests/channels/test_qq_compaction_notices.py @@ -110,5 +110,5 @@ def test_qq_inherits_global_unless_legacy_override_is_explicit( section["showCompactionNotices"] = str(override).lower() if legacy_string else override if typed: section = QQConfig.model_validate(section) - channel = manager._build_channel("qq", QQChannel, section) + channel = manager._build_channel(QQChannel, section) assert channel.show_compaction_notices is (global_value if override is None else override) diff --git a/tests/cli/test_commands.py b/tests/cli/test_commands.py index 658aec544..0d11f6928 100644 --- a/tests/cli/test_commands.py +++ b/tests/cli/test_commands.py @@ -2416,10 +2416,7 @@ def test_webui_dev_starts_vite_sidecar_and_gateway(monkeypatch, tmp_path: Path) def fake_dev_server(**kwargs): seen["dev_kwargs"] = kwargs seen["dev_running"] = True - dev_server = SimpleNamespace( - url=kwargs["browser_url"], - ensure_running=lambda: None, - ) + dev_server = SimpleNamespace(ensure_running=lambda: None) seen["dev_server"] = dev_server try: yield dev_server @@ -2464,11 +2461,9 @@ def test_webui_dev_starts_vite_sidecar_and_gateway(monkeypatch, tmp_path: Path) dev_kwargs = seen["dev_kwargs"] assert isinstance(dev_kwargs, dict) assert dev_kwargs["target_url"] == "http://127.0.0.1:8899" - browser_url = dev_kwargs["browser_url"] - assert isinstance(browser_url, str) saved = json.loads(config_file.read_text(encoding="utf-8")) secret = saved["channels"]["websocket"]["tokenIssueSecret"] - assert browser_url == f"http://127.0.0.1:5173/#/?bootstrapSecret={secret}" + browser_url = f"http://127.0.0.1:5173/#/?bootstrapSecret={secret}" assert seen["start_options"].port == 18888 assert seen["attached_while_dev_running"] is True assert seen["attach_kwargs"]["poll_hook"] == seen["dev_server"].ensure_running diff --git a/tests/providers/test_openai_codex_provider.py b/tests/providers/test_openai_codex_provider.py index dc62a53d1..7ad250ea6 100644 --- a/tests/providers/test_openai_codex_provider.py +++ b/tests/providers/test_openai_codex_provider.py @@ -16,13 +16,12 @@ from nanobot.events import ContextCompactionEvent, EventSink from nanobot.providers.factory import make_provider from nanobot.providers.openai_codex_provider import ( OpenAICodexProvider, + _build_codex_http_error, _build_reasoning_options, _codex_error_details, _codex_error_response, _CodexHTTPError, - _friendly_error, _request_codex, - _should_retry_status, ) from nanobot.providers.openai_responses import ( build_responses_state, @@ -107,7 +106,7 @@ def codex_warning_log(monkeypatch): def test_codex_http_friendly_error_omits_raw_body() -> None: raw = "raw upstream body with PRIVATE PROMPT MUST NOT APPEAR" - message = _friendly_error(500, raw) + message = str(_build_codex_http_error(500, httpx.Headers(), raw)) assert message == "HTTP 500: Codex API request failed" assert "PRIVATE PROMPT MUST NOT APPEAR" not in message @@ -825,7 +824,10 @@ async def test_codex_429_preserves_retry_semantics( def test_codex_429_friendly_message_fallback_does_not_override_unknown_retry() -> None: response = _codex_error_response( - _CodexHTTPError(_friendly_error(429, ""), status_code=429) + _CodexHTTPError( + "ChatGPT usage quota exceeded or rate limit triggered. Please try again later.", + status_code=429, + ) ) assert response.error_status_code == 429 @@ -843,9 +845,9 @@ def test_codex_429_classification_uses_raw_error_semantics( raw: str, expected_retry: bool, ) -> None: - error_type, error_code = provider_base.LLMProvider._extract_error_type_code(raw) + error = _build_codex_http_error(429, httpx.Headers(), raw) - assert _should_retry_status(429, error_type, error_code, raw) is expected_retry + assert error.should_retry is expected_retry def test_codex_reasoning_options_request_summary_without_forcing_effort() -> None: diff --git a/tests/test_api_attachment.py b/tests/test_api_attachment.py index 3d13a6398..d212869f5 100644 --- a/tests/test_api_attachment.py +++ b/tests/test_api_attachment.py @@ -44,11 +44,6 @@ def mock_agent(): return _make_mock_agent() -@pytest.fixture -def app(mock_agent): - return create_app(mock_agent, model_name="test-model", request_timeout=10.0, api_key=API_KEY) - - @pytest_asyncio.fixture async def aiohttp_client(): clients: list[TestClient] = [] diff --git a/tests/webui/test_copilot_device_login.py b/tests/webui/test_copilot_device_login.py index a825c289b..4450f2dd0 100644 --- a/tests/webui/test_copilot_device_login.py +++ b/tests/webui/test_copilot_device_login.py @@ -30,7 +30,7 @@ def test_copilot_prompt_poll_and_owned_cancellation(monkeypatch): registry = WebUIOAuthFlowRegistry() payload = login_oauth_provider( Config(), {"provider": ["github_copilot"]}, oauth_flows=registry, - config_path=None, settings_payload=lambda **_: {}, + config_path=None, ) assert set(payload) == { "status", "provider", "flow_id", "authorization_url", "user_code", @@ -73,14 +73,14 @@ def test_cancels_copilot_login_while_device_prompt_is_loading(monkeypatch, tmp_p get_token_path=lambda: tmp_path / "copilot.json", save=saved.append, )) registry = WebUIOAuthFlowRegistry() - kwargs = dict(oauth_flows=registry, config_path=None, settings_payload=lambda **_: {}) + kwargs = dict(oauth_flows=registry, config_path=None) query = {"provider": ["github_copilot"]} with ThreadPoolExecutor(max_workers=1) as pool: started = pool.submit(login_oauth_provider, Config(), query, **kwargs) try: assert entered.wait(2) if action == "logout": - logout_oauth_provider(query, **kwargs) + logout_oauth_provider(query, **kwargs, settings_payload=lambda **_: {}) else: replacement = login_oauth_provider(Config(), query, **kwargs) assert registry.get("github_copilot", replacement["flow_id"]) is not None @@ -114,7 +114,7 @@ def test_failed_copilot_start_removes_registered_flow(monkeypatch): with pytest.raises(WebUISettingsError, match="GitHub sign-in failed"): login_oauth_provider( Config(), {"provider": ["github_copilot"]}, oauth_flows=registry, - config_path=None, settings_payload=lambda **_: {}, + config_path=None, ) assert len(registered) == 1 provider, flow_id, flow = registered[0] diff --git a/tests/webui/test_dev.py b/tests/webui/test_dev.py index f06a097f0..75253ba4f 100644 --- a/tests/webui/test_dev.py +++ b/tests/webui/test_dev.py @@ -81,7 +81,6 @@ def test_start_webui_dev_server_uses_vite_directly_and_sets_proxy_target( server = start_webui_dev_server( target_url="http://127.0.0.1:8899", - browser_url="http://127.0.0.1:5173/#/?bootstrapSecret=secret", source_dir=source, runner="bun", environ={"EXISTING": "value"}, @@ -119,7 +118,6 @@ def test_dev_server_installs_locked_dependencies_when_vite_is_missing(tmp_path: start_webui_dev_server( target_url="http://127.0.0.1:8765", - browser_url="http://127.0.0.1:5173", source_dir=source, runner="bun", popen=lambda *_args, **_kwargs: process, @@ -135,7 +133,6 @@ def test_dev_server_requires_a_source_checkout(tmp_path: Path) -> None: with pytest.raises(WebUIDevError, match="source checkout"): start_webui_dev_server( target_url="http://127.0.0.1:8765", - browser_url="http://127.0.0.1:5173", source_dir=tmp_path / "missing", ) @@ -168,7 +165,7 @@ def test_dev_server_context_stops_the_child(monkeypatch) -> None: server.stop = lambda: stopped.append(True) monkeypatch.setattr("nanobot.webui.dev.start_webui_dev_server", lambda **_kwargs: server) - with run_webui_dev_server(target_url="unused", browser_url="unused") as running: + with run_webui_dev_server(target_url="unused") as running: assert running is server assert stopped == [True] diff --git a/tests/webui/test_session_mentions.py b/tests/webui/test_session_mentions.py index 48f0c4abb..9fd7722f8 100644 --- a/tests/webui/test_session_mentions.py +++ b/tests/webui/test_session_mentions.py @@ -8,7 +8,6 @@ import pytest from nanobot.session.manager import SessionManager from nanobot.session.session_handles import ( - SessionHandle, SessionHandleResolver, session_handle_for_name, ) @@ -26,12 +25,6 @@ def _save_session(manager: SessionManager, key: str, title: str) -> None: manager.save(session) -def _handle(manager: SessionManager, key: str) -> SessionHandle: - handle = SessionHandleResolver(manager).handle_for_session(key) - assert handle is not None - return handle - - @pytest.mark.parametrize("raw", [None, []], ids=["missing", "empty"]) async def test_empty_mentions_do_not_wait_for_unrelated_storage(tmp_path, monkeypatch, raw): manager = SessionManager(tmp_path) diff --git a/tui/src/app/app.ts b/tui/src/app/app.ts index 848510650..17fa644c1 100644 --- a/tui/src/app/app.ts +++ b/tui/src/app/app.ts @@ -1688,8 +1688,6 @@ export class NanobotTui { mode, this.renderer.width, footerHintTheme(this.palette), - process.platform, - Boolean(this.renderer.capabilities?.kitty_keyboard), ) } diff --git a/tui/src/app/theme.ts b/tui/src/app/theme.ts index c16e9f7d1..ed78bf9a5 100644 --- a/tui/src/app/theme.ts +++ b/tui/src/app/theme.ts @@ -225,7 +225,6 @@ export function footerHintTheme(palette: Palette): FooterHintTheme { accent: palette.accent, danger: palette.error, muted: palette.muted, - separator: palette.faint, } } diff --git a/tui/src/client/nanobot-client.ts b/tui/src/client/nanobot-client.ts index 6f589b7f7..081eb85e4 100644 --- a/tui/src/client/nanobot-client.ts +++ b/tui/src/client/nanobot-client.ts @@ -153,7 +153,6 @@ export class NanobotClient { this.reconnectAttempt = 0 this.retryStartedAt = Date.now() } - if (!this.lastFailure) this.lastFailure = "connection closed" this.reportRetryState() void this.checkHealthAndScheduleReconnect() }) diff --git a/tui/src/views/footer-hints.test.ts b/tui/src/views/footer-hints.test.ts index 625d5b6fe..c8ab7eaa9 100644 --- a/tui/src/views/footer-hints.test.ts +++ b/tui/src/views/footer-hints.test.ts @@ -6,7 +6,6 @@ const theme = { accent: "#EF8E30", danger: "#F87171", muted: "#A1A1AA", - separator: "#71717A", } describe("footerHints", () => { @@ -22,8 +21,8 @@ describe("footerHints", () => { }) test("keeps passive composer modes free of permanent instructions", () => { - const ready = contextualFooterHints("ready", 100, theme, "linux") - const active = contextualFooterHints("active", 100, theme, "darwin") + const ready = contextualFooterHints("ready", 100, theme) + const active = contextualFooterHints("active", 100, theme) expect(ready.chunks).toHaveLength(0) expect(active.chunks).toHaveLength(0) diff --git a/tui/src/views/footer-hints.ts b/tui/src/views/footer-hints.ts index 300177f5e..1522bfdf7 100644 --- a/tui/src/views/footer-hints.ts +++ b/tui/src/views/footer-hints.ts @@ -10,7 +10,6 @@ export interface FooterHintTheme { accent: ColorInput danger: ColorInput muted: ColorInput - separator: ColorInput } export type FooterMode = @@ -30,8 +29,6 @@ export function contextualFooterHints( mode: FooterMode, width: number, theme: FooterHintTheme, - _platform: string = process.platform, - _shiftedEnter = false, ): StyledText { return footerHints(hintsFor(mode, width), theme) } diff --git a/webui/src/App.tsx b/webui/src/App.tsx index 630203458..a5279e4a3 100644 --- a/webui/src/App.tsx +++ b/webui/src/App.tsx @@ -3033,7 +3033,6 @@ function Shell({ !activeKey ? onTemporaryChatEnabledChange : undefined } onToggleSidebar={toggleSidebar} - onNewChat={onNewChat} onCreateChat={ temporaryChatEnabled ? onCreateTemporaryChat : onCreateChat } @@ -3079,7 +3078,6 @@ function Shell({ filePreviewStore={filePreviewStore} draftStore={draftStore} onToggleSidebar={toggleSidebar} - onNewChat={onNewChat} onCreateChat={onCreateChat} pendingFirstMessage={pendingAutomationMessage} onPendingFirstMessageConsumed={onPendingAutomationMessageConsumed} diff --git a/webui/src/components/settings/channels/ChannelQrConnectFlow.tsx b/webui/src/components/settings/channels/ChannelQrConnectFlow.tsx index c01909df0..5162cc3b8 100644 --- a/webui/src/components/settings/channels/ChannelQrConnectFlow.tsx +++ b/webui/src/components/settings/channels/ChannelQrConnectFlow.tsx @@ -41,7 +41,6 @@ export function ChannelQrConnectFlow({ renderActions, renderView, }: { - token: string; channelName: string; startParams?: Readonly>; idleLabel?: string; diff --git a/webui/src/components/settings/useSettingsController.ts b/webui/src/components/settings/useSettingsController.ts index df4a9b846..b70eee357 100644 --- a/webui/src/components/settings/useSettingsController.ts +++ b/webui/src/components/settings/useSettingsController.ts @@ -156,11 +156,6 @@ export function useSettingsController({ const runtimeConfigState = useRuntimeConfigSettings(settings, client, applyPayload); - const markUpdateInstalled = useCallback(() => { - setPendingRestartSections((current) => ({ ...current, runtime: true })); - setSettings((current) => current ? { ...current, requires_restart: true } : current); - }, []); - const closeProviderOAuthFlow = useCallback((cancelPending = true) => { const flow = providerOAuthFlowRef.current; providerOAuthFlowRef.current = null; @@ -479,7 +474,6 @@ export function useSettingsController({ systemState, systemActions, activeSection, - markUpdateInstalled, runtimeConfigState, closeProviderOAuthFlow, error, diff --git a/webui/src/components/thread/ThreadShell.tsx b/webui/src/components/thread/ThreadShell.tsx index 955ee0f74..e86f6a144 100644 --- a/webui/src/components/thread/ThreadShell.tsx +++ b/webui/src/components/thread/ThreadShell.tsx @@ -229,8 +229,6 @@ interface ThreadShellProps { temporaryChatEnabled?: boolean; onTemporaryChatEnabledChange?: (enabled: boolean) => void; onToggleSidebar: () => void; - onGoHome?: () => void; - onNewChat?: () => void; onCreateChat?: ( workspaceScope?: WorkspaceScopePayload | null, initialMessage?: string, diff --git a/webui/src/dev/gallery/gallery.css b/webui/src/dev/gallery/gallery.css index 114d7c9c0..5deba47d9 100644 --- a/webui/src/dev/gallery/gallery.css +++ b/webui/src/dev/gallery/gallery.css @@ -37,11 +37,9 @@ .gallery-code { overflow: auto; border-radius: var(--radius-control); padding: 1rem; background: hsl(var(--muted)); font-size: 12px; line-height: 1.6; tab-size: 2; } .gallery-startup-preview .startup-shell { position: relative; height: 100%; } -.gallery-startup-preview .startup-header { display: flex; justify-content: space-between; padding: 5px 13px; } -.gallery-startup-preview .startup-control-shadow { width: 28px; height: 28px; border-radius: 8px; background: rgba(0, 0, 0, .025); } .gallery-startup-preview .startup-composer { position: absolute; inset-inline: 16px; bottom: max(24px, env(safe-area-inset-bottom)); box-sizing: border-box; max-width: 768px; margin-inline: auto; height: 96px; border-radius: 24px; background: rgba(0, 0, 0, .025); } .gallery-startup-preview .startup-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } -html.dark .gallery-startup-preview :is(.startup-control-shadow, .startup-composer) { background: rgba(255, 255, 255, .035); } +html.dark .gallery-startup-preview .startup-composer { background: rgba(255, 255, 255, .035); } @media (max-width: 700px) { .gallery-header { padding: 0.75rem 1rem; } diff --git a/webui/src/globals.css b/webui/src/globals.css index 80dad3ce0..2e1a26e7a 100644 --- a/webui/src/globals.css +++ b/webui/src/globals.css @@ -608,9 +608,6 @@ animation: none; content: ""; } - .streaming-text-fallback::after { - animation: none; - } } /** @@ -753,18 +750,6 @@ transform: translateY(0) scale(1); } } - @keyframes composer-status-strip-exit { - 0% { - max-height: var(--composer-strip-max-height, 46px); - opacity: 1; - transform: translateY(0) scale(1); - } - 100% { - max-height: 0; - opacity: 0; - transform: translateY(8px) scale(0.99); - } - } .composer-status-strip { transform-origin: bottom center; will-change: max-height, opacity, transform; @@ -772,9 +757,6 @@ .composer-status-strip[data-state="enter"] { animation: composer-status-strip-enter 280ms cubic-bezier(0.16, 1, 0.3, 1) both; } - .composer-status-strip[data-state="exit"] { - animation: composer-status-strip-exit 180ms ease-in both; - } .composer-status-drawer { --composer-status-drawer-duration: 220ms; --composer-status-drawer-easing: ease-out; @@ -847,19 +829,6 @@ transform: translateY(0); } } - @keyframes queued-prompt-row-enter { - 0% { - opacity: 0; - transform: translateY(6px); - } - 100% { - opacity: 1; - transform: translateY(0); - } - } - .queued-prompt-row { - animation: queued-prompt-row-enter 220ms cubic-bezier(0.16, 1, 0.3, 1) both; - } @media (prefers-reduced-motion: reduce) { .composer-status-strip { will-change: auto; @@ -877,9 +846,6 @@ .thread-layout { transition-duration: 0.01ms; } - .queued-prompt-row { - animation: none; - } } .thread-workspace { @@ -1001,13 +967,6 @@ container-type: inline-size; } - @supports (content-visibility: auto) { - .thread-render-unit { - content-visibility: auto; - contain-intrinsic-size: auto 12rem; - } - } - .thread-prompt-rail { display: none; left: 1.75rem; diff --git a/webui/src/i18n/locales/en/common.json b/webui/src/i18n/locales/en/common.json index 869913ca8..ab47271dc 100644 --- a/webui/src/i18n/locales/en/common.json +++ b/webui/src/i18n/locales/en/common.json @@ -814,19 +814,12 @@ "catalogStale": "Cached list may be out of date.", "catalogFallback": "Built-in list may be out of date.", "selectModel": "Select model", - "addConfiguration": "Add configuration", - "newConfiguration": "New model configuration", - "newConfigurationHelp": "Save a provider, model, and generation settings as a reusable preset.", - "configurationName": "Configuration name", - "configurationNameHelp": "Rename this saved model configuration.", - "configurationNamePlaceholder": "Fast writing", "callOrder": "Model order", "primary": "Primary", "addToOrder": "Enable preset", "newPreset": "New preset", "newPresetHelp": "Save a model and settings for reuse.", "presets": "Model presets", - "editPreset": "Edit preset", "presetName": "Preset name", "presetNameHelp": "Names must be unique; also used by /model.", "presetNameDuplicate": "A preset with this name already exists.", @@ -851,25 +844,18 @@ "converting": "Converting...", "convertAction": "Convert to presets", "dragToReorder": "Drag to reorder", - "moveUp": "Move up", - "moveDown": "Move down", "removeFromOrder": "Disable preset", - "inCallOrder": "In call order", "disabled": "Disabled", "noPresets": "No model presets yet", - "noPresetsHelp": "Create a preset, then add it to the call order.", "removeBeforeDelete": "Cannot delete the primary model", "providerSetupRequired": "Provider setup required", - "configureProviderBeforeSaving": "Configure this provider before saving the preset.", "deletePresetTitle": "Delete model preset?", "deletePresetHelp": "Delete “{{name}}” and remove it from the fallback list. Provider credentials will be kept.", "searchModels": "Choose model", "useCustomModel": "Use", "loadingModels": "Loading models...", "searchCatalog": "Search this provider’s model catalog.", - "modelsAvailable": "available", "noModelResults": "No matching models.", - "loadFailed": "Model list unavailable.", "unsupportedModelList": "Type a model ID manually.", "providerNotConfigured": "Configure this provider before loading models.", "autoProviderCustomOnly": "Enter a model ID manually when using automatic provider selection.", @@ -1031,39 +1017,17 @@ "empty": "No matching timezones." }, "cliApps": { - "allCategories": "All categories", - "availableCount": "{{count}} apps", - "installedCount": "{{count}} CLIs installed", - "summary": "{{installed}} of {{total}} CLIs installed", - "filterAll": "All", - "filterInstalled": "Installed CLIs", - "filterNotInstalled": "Not installed", - "searchPlaceholder": "Search CLIs", - "loading": "Loading CLI apps…", - "empty": "No CLI apps match this filter.", "statusInstalled": "App ready", - "statusMissing": "Missing", - "statusAvailable": "Available", - "statusUnsupported": "Unsupported", - "statusNotInstalled": "App not installed", - "requires": "Requires", "test": "Test app", "update": "Update app", "uninstall": "Uninstall app", "install": "Install app", - "readyTitle": "@{{name}} is ready", "readyStatus": "Ready", "readyTry": "Try @{{name}}", "readyCopied": "Copied", "readyPrompt": "Ask nanobot to use @{{name}} for this task.", "openChat": "Open chat", - "unsupported": "Unsupported", - "unavailable": "Unavailable", - "noDescription": "No description available.", - "availableCount_one": "{{count}} app", - "availableCount_other": "{{count}} apps", - "installedCount_one": "{{count}} CLI installed", - "installedCount_other": "{{count}} CLIs installed" + "unavailable": "Unavailable" }, "about": { "updateNotice": "Update available", @@ -1314,20 +1278,12 @@ "workspace": "Working directory" }, "usage": { - "title": "Token usage", "shortTitle": "Token usage", - "last30Days": "Last 30 days", "viewDetails": "View details", - "previousPage": "Previous page", - "nextPage": "Next page", - "dailyAverage": "Daily average", - "inputTokens": "Input tokens", "cacheHitRate": "Cache hit rate", - "requestTrend": "Daily requests", "cacheRateHelp": "Cache hit rate excludes input with unknown cache status.", "dailyTrend": "Daily tokens", "bySource": "Usage by source", - "byModel": "Usage by model", "modelTrend": "Model trends", "modelsUnavailable": "No model breakdown available.", "otherModels": "Other / unattributed", @@ -1339,19 +1295,8 @@ "cacheUnknown": "Unknown status", "outputTokens": "Output", "otherTokens": "Other tokens", - "subtitle": "Provider-reported usage over the last 12 months.", - "empty": "Token activity will appear after new model replies.", "totalTokens": "Total tokens", - "peakTokens": "Peak tokens", - "thirtyDayTokens": "30-day tokens", - "currentStreak": "Current streak", - "longestStreak": "Longest streak", - "daysValue": "{{count}}d", - "last30": "30 days", - "activeDays": "Active days", "requests": "Requests", - "estimated": "estimated", - "includesEstimates": "includes estimates", "cellTitle": "{{date}}: {{tokens}} tokens, {{requests}} requests", "sources": { "user": "Chat", diff --git a/webui/src/i18n/locales/es/common.json b/webui/src/i18n/locales/es/common.json index 523fcbe00..49753cd44 100644 --- a/webui/src/i18n/locales/es/common.json +++ b/webui/src/i18n/locales/es/common.json @@ -878,21 +878,13 @@ "workspace": "Directorio de trabajo" }, "usage": { - "title": "Actividad de tokens", "shortTitle": "Uso de tokens", - "last30Days": "Últimos 30 días", "viewDetails": "Ver detalles", - "previousPage": "Página anterior", - "nextPage": "Página siguiente", - "dailyAverage": "Promedio diario", - "inputTokens": "Tokens de entrada", "cacheHitRate": "Tasa de aciertos de caché", - "requestTrend": "Solicitudes diarias", "cacheRateHelp": "La tasa excluye las entradas cuyo estado de caché se desconoce.", "dailyTrend": "Tokens diarios", "systemHelp": "Incluye tareas internas y llamadas sin origen registrado.", "bySource": "Uso por origen", - "byModel": "Uso por modelo", "modelTrend": "Tendencias por modelo", "modelsUnavailable": "Sin desglose por modelo.", "otherModels": "Otros / sin atribuir", @@ -904,19 +896,8 @@ "cacheUnknown": "Estado desconocido", "outputTokens": "Salida", "otherTokens": "Otros tokens", - "subtitle": "Uso reportado por el proveedor durante los últimos 12 meses.", - "empty": "La actividad de tokens aparecerá después de nuevas respuestas del modelo.", "totalTokens": "Tokens totales", - "peakTokens": "Pico de tokens", - "thirtyDayTokens": "Tokens de 30 días", - "currentStreak": "Racha actual", - "longestStreak": "Racha más larga", - "daysValue": "{{count}} d", - "last30": "30 días", - "activeDays": "Días activos", "requests": "Solicitudes", - "estimated": "estimado", - "includesEstimates": "incluye estimaciones", "cellTitle": "{{date}}: {{tokens}} tokens, {{requests}} solicitudes", "sources": { "user": "Chat", @@ -998,19 +979,12 @@ "catalogStale": "La lista en caché puede estar desactualizada.", "catalogFallback": "La lista integrada puede estar desactualizada.", "selectModel": "Seleccionar modelo", - "addConfiguration": "Agregar configuración", - "newConfiguration": "Nueva configuración de modelo", - "newConfigurationHelp": "Guarda un proveedor y un modelo para seleccionarlos rápidamente.", - "configurationName": "Nombre de configuración", - "configurationNameHelp": "Renombra esta configuración de modelo guardada.", - "configurationNamePlaceholder": "Escritura rápida", "callOrder": "Orden de modelos", "primary": "Principal", "addToOrder": "Activar preajuste", "newPreset": "Nuevo preajuste", "newPresetHelp": "Guarda un modelo y sus ajustes para reutilizarlos.", "presets": "Preajustes de modelo", - "editPreset": "Editar preajuste", "presetName": "Nombre del preajuste", "presetNameHelp": "Los nombres deben ser únicos; también se usan en /model.", "presetNameDuplicate": "Ya existe un preajuste con este nombre.", @@ -1035,16 +1009,11 @@ "converting": "Convirtiendo...", "convertAction": "Convertir en preajustes", "dragToReorder": "Arrastrar para reordenar", - "moveUp": "Subir", - "moveDown": "Bajar", "removeFromOrder": "Desactivar preajuste", - "inCallOrder": "En el orden de llamada", "disabled": "Desactivado", "noPresets": "Aún no hay preajustes de modelo", - "noPresetsHelp": "Crea un preajuste y añádelo al orden de llamada.", "removeBeforeDelete": "No se puede eliminar el modelo principal", "providerSetupRequired": "El proveedor requiere configuración", - "configureProviderBeforeSaving": "Configura este proveedor antes de guardar el preajuste.", "deletePresetTitle": "¿Eliminar el preajuste de modelo?", "deletePresetHelp": "Se eliminará el preajuste «{{name}}» y se quitará del orden de llamada. Las credenciales del proveedor se conservarán.", "searchModels": "Elegir modelo", @@ -1052,9 +1021,7 @@ "loadingModels": "Cargando modelos...", "searchCatalog": "Busca un modelo en el catálogo del proveedor.", "availableCount": "Modelos disponibles: {{count}}", - "modelsAvailable": "disponibles", "noModelResults": "No hay modelos coincidentes.", - "loadFailed": "Lista de modelos no disponible.", "unsupportedModelList": "Escribe un ID de modelo manualmente.", "providerNotConfigured": "Configura este proveedor antes de cargar modelos.", "autoProviderCustomOnly": "Introduce un ID de modelo para usar la selección automática del proveedor." @@ -1065,39 +1032,17 @@ "empty": "No hay zonas horarias coincidentes." }, "cliApps": { - "allCategories": "Todas las categorías", - "availableCount_one": "{{count}} aplicación", - "availableCount_other": "{{count}} aplicaciones", - "availableCount": "{{count}} aplicaciones", - "installedCount_one": "{{count}} herramienta CLI instalada", - "installedCount_other": "{{count}} herramientas CLI instaladas", - "installedCount": "{{count}} instaladas", - "summary": "{{installed}} de {{total}} herramientas CLI instaladas", - "filterAll": "Todas", - "filterInstalled": "Herramientas CLI instaladas", - "filterNotInstalled": "No instaladas", - "searchPlaceholder": "Buscar herramientas CLI", "statusInstalled": "Instalada", - "statusAvailable": "Disponible", - "statusMissing": "Falta dependencia", - "statusUnsupported": "No compatible", - "statusNotInstalled": "No instalada", - "unsupported": "No compatible", - "loading": "Cargando aplicaciones CLI...", - "empty": "Ninguna aplicación CLI coincide con este filtro.", - "readyTitle": "@{{name}} está listo", "readyStatus": "Listo", "readyPrompt": "Usa @{{name}} para descubrir qué puedes hacer con esta herramienta.", "readyTry": "Probar @{{name}}", "readyCopied": "Copiado", "openChat": "Abrir chat", - "requires": "Requiere", "test": "Probar CLI", "update": "Actualizar CLI", "uninstall": "Desinstalar CLI", "install": "Instalar CLI", - "unavailable": "No disponible", - "noDescription": "Sin descripción disponible." + "unavailable": "No disponible" }, "about": { "updateNotice": "Actualización disponible", diff --git a/webui/src/i18n/locales/fr/common.json b/webui/src/i18n/locales/fr/common.json index 53d93468a..4fe9b9afa 100644 --- a/webui/src/i18n/locales/fr/common.json +++ b/webui/src/i18n/locales/fr/common.json @@ -878,21 +878,13 @@ "workspace": "Dossier de travail" }, "usage": { - "title": "Activité des tokens", "shortTitle": "Utilisation des tokens", - "last30Days": "30 derniers jours", "viewDetails": "Voir les détails", - "previousPage": "Page précédente", - "nextPage": "Page suivante", - "dailyAverage": "Moyenne quotidienne", - "inputTokens": "Tokens d’entrée", "cacheHitRate": "Taux de réussite du cache", - "requestTrend": "Requêtes quotidiennes", "cacheRateHelp": "Le taux exclut les entrées dont l’état du cache est inconnu.", "dailyTrend": "Tokens quotidiens", "systemHelp": "Inclut les tâches internes et les appels sans source enregistrée.", "bySource": "Utilisation par source", - "byModel": "Utilisation par modèle", "modelTrend": "Tendances des modèles", "modelsUnavailable": "Aucune ventilation par modèle disponible.", "otherModels": "Autres / non attribués", @@ -904,19 +896,8 @@ "cacheUnknown": "État inconnu", "outputTokens": "Sortie", "otherTokens": "Autres tokens", - "subtitle": "Usage signalé par le fournisseur sur les 12 derniers mois.", - "empty": "L’activité des tokens apparaîtra après les nouvelles réponses du modèle.", "totalTokens": "Tokens cumulés", - "peakTokens": "Pic de tokens", - "thirtyDayTokens": "Tokens sur 30 jours", - "currentStreak": "Série actuelle", - "longestStreak": "Plus longue série", - "daysValue": "{{count}} j", - "last30": "30 jours", - "activeDays": "Jours actifs", "requests": "Requêtes", - "estimated": "estimé", - "includesEstimates": "inclut des estimations", "cellTitle": "{{date}} : {{tokens}} tokens, {{requests}} requêtes", "sources": { "user": "Chat", @@ -998,19 +979,12 @@ "catalogStale": "La liste en cache peut être obsolète.", "catalogFallback": "La liste intégrée peut être obsolète.", "selectModel": "Choisir un modèle", - "addConfiguration": "Ajouter une configuration", - "newConfiguration": "Nouvelle configuration de modèle", - "newConfigurationHelp": "Enregistrez un fournisseur et un modèle pour les sélectionner rapidement.", - "configurationName": "Nom de la configuration", - "configurationNameHelp": "Renomme cette configuration de modèle enregistrée.", - "configurationNamePlaceholder": "Rédaction rapide", "callOrder": "Ordre des modèles", "primary": "Principal", "addToOrder": "Activer le préréglage", "newPreset": "Nouveau préréglage", "newPresetHelp": "Enregistrez un modèle et ses réglages pour les réutiliser.", "presets": "Préréglages de modèle", - "editPreset": "Modifier le préréglage", "presetName": "Nom du préréglage", "presetNameHelp": "Les noms doivent être uniques ; ils servent aussi à /model.", "presetNameDuplicate": "Un préréglage portant ce nom existe déjà.", @@ -1035,16 +1009,11 @@ "converting": "Conversion...", "convertAction": "Convertir en préréglages", "dragToReorder": "Faire glisser pour réorganiser", - "moveUp": "Monter", - "moveDown": "Descendre", "removeFromOrder": "Désactiver le préréglage", - "inCallOrder": "Dans l’ordre d’appel", "disabled": "Désactivé", "noPresets": "Aucun préréglage de modèle", - "noPresetsHelp": "Créez un préréglage, puis ajoutez-le à l’ordre d’appel.", "removeBeforeDelete": "Impossible de supprimer le modèle principal", "providerSetupRequired": "Configuration du fournisseur requise", - "configureProviderBeforeSaving": "Configurez ce fournisseur avant d’enregistrer le préréglage.", "deletePresetTitle": "Supprimer le préréglage de modèle ?", "deletePresetHelp": "Le préréglage « {{name}} » sera supprimé et retiré de l’ordre d’appel. Les identifiants du fournisseur seront conservés.", "searchModels": "Choisir le modèle", @@ -1052,9 +1021,7 @@ "loadingModels": "Chargement des modèles...", "searchCatalog": "Rechercher dans le catalogue du fournisseur pour choisir un modèle.", "availableCount": "Modèles disponibles : {{count}}", - "modelsAvailable": "disponibles", "noModelResults": "Aucun modèle correspondant.", - "loadFailed": "Liste des modèles indisponible.", "unsupportedModelList": "Saisissez manuellement un ID de modèle.", "providerNotConfigured": "Configurez ce fournisseur avant de charger les modèles.", "autoProviderCustomOnly": "Saisissez un ID de modèle pour utiliser la sélection automatique du fournisseur." @@ -1065,39 +1032,17 @@ "empty": "Aucun fuseau horaire correspondant." }, "cliApps": { - "allCategories": "Toutes les catégories", - "availableCount_one": "{{count}} application", - "availableCount_other": "{{count}} applications", - "availableCount": "{{count}} applications", - "installedCount_one": "{{count}} outil CLI installé", - "installedCount_other": "{{count}} outils CLI installés", - "installedCount": "{{count}} installées", - "summary": "{{installed}} outils CLI installés sur {{total}}", - "filterAll": "Tout", - "filterInstalled": "Outils CLI installés", - "filterNotInstalled": "Non installées", - "searchPlaceholder": "Rechercher des outils CLI", "statusInstalled": "Installée", - "statusAvailable": "Disponible", - "statusMissing": "Dépendance manquante", - "statusUnsupported": "Non compatible", - "statusNotInstalled": "Non installée", - "unsupported": "Non compatible", - "loading": "Chargement des applications CLI...", - "empty": "Aucune application CLI ne correspond à ce filtre.", - "readyTitle": "@{{name}} est prêt", "readyStatus": "Prêt", "readyPrompt": "Utilisez @{{name}} pour découvrir les fonctions de cet outil.", "readyTry": "Essayer @{{name}}", "readyCopied": "Copié", "openChat": "Ouvrir le chat", - "requires": "Requiert", "test": "Tester l’outil CLI", "update": "Mettre à jour l’outil CLI", "uninstall": "Désinstaller l’outil CLI", "install": "Installer l’outil CLI", - "unavailable": "Indisponible", - "noDescription": "Aucune description disponible." + "unavailable": "Indisponible" }, "about": { "updateNotice": "Mise à jour disponible", diff --git a/webui/src/i18n/locales/id/common.json b/webui/src/i18n/locales/id/common.json index 60de7f381..6a709fdba 100644 --- a/webui/src/i18n/locales/id/common.json +++ b/webui/src/i18n/locales/id/common.json @@ -878,21 +878,13 @@ "workspace": "Direktori kerja" }, "usage": { - "title": "Aktivitas token", "shortTitle": "Penggunaan token", - "last30Days": "30 hari terakhir", "viewDetails": "Lihat detail", - "previousPage": "Halaman sebelumnya", - "nextPage": "Halaman berikutnya", - "dailyAverage": "Rata-rata harian", - "inputTokens": "Token input", "cacheHitRate": "Rasio cache hit", - "requestTrend": "Permintaan harian", "cacheRateHelp": "Rasio tidak mencakup input dengan status cache yang tidak diketahui.", "dailyTrend": "Token harian", "systemHelp": "Termasuk tugas internal dan panggilan tanpa sumber tercatat.", "bySource": "Penggunaan berdasarkan sumber", - "byModel": "Penggunaan per model", "modelTrend": "Tren model", "modelsUnavailable": "Rincian per model tidak tersedia.", "otherModels": "Lainnya / belum dikategorikan", @@ -904,19 +896,8 @@ "cacheUnknown": "Status tidak diketahui", "outputTokens": "Output", "otherTokens": "Token lainnya", - "subtitle": "Penggunaan yang dilaporkan penyedia selama 12 bulan terakhir.", - "empty": "Aktivitas token akan muncul setelah balasan model baru.", "totalTokens": "Total token", - "peakTokens": "Penggunaan token tertinggi", - "thirtyDayTokens": "Token 30 hari", - "currentStreak": "Rentetan saat ini", - "longestStreak": "Rentetan terpanjang", - "daysValue": "{{count}} hari", - "last30": "30 hari", - "activeDays": "Hari aktif", "requests": "Permintaan", - "estimated": "perkiraan", - "includesEstimates": "termasuk perkiraan", "cellTitle": "{{date}}: {{tokens}} token, {{requests}} permintaan", "sources": { "user": "Chat", @@ -998,19 +979,12 @@ "catalogStale": "Daftar dalam cache mungkin sudah usang.", "catalogFallback": "Daftar bawaan mungkin sudah usang.", "selectModel": "Pilih model", - "addConfiguration": "Tambah konfigurasi", - "newConfiguration": "Konfigurasi model baru", - "newConfigurationHelp": "Simpan penyedia dan model agar mudah dipilih kembali.", - "configurationName": "Nama konfigurasi", - "configurationNameHelp": "Ganti nama konfigurasi model tersimpan ini.", - "configurationNamePlaceholder": "Menulis cepat", "callOrder": "Urutan model", "primary": "Utama", "addToOrder": "Aktifkan prasetel", "newPreset": "Preset baru", "newPresetHelp": "Simpan model dan pengaturan untuk digunakan kembali.", "presets": "Prasetel model", - "editPreset": "Ubah prasetel", "presetName": "Nama prasetel", "presetNameHelp": "Nama harus unik; juga digunakan oleh /model.", "presetNameDuplicate": "Prasetel dengan nama ini sudah ada.", @@ -1035,16 +1009,11 @@ "converting": "Mengonversi...", "convertAction": "Ubah ke preset", "dragToReorder": "Seret untuk mengurutkan ulang", - "moveUp": "Naikkan", - "moveDown": "Turunkan", "removeFromOrder": "Nonaktifkan prasetel", - "inCallOrder": "Dalam urutan pemanggilan", "disabled": "Nonaktif", "noPresets": "Belum ada prasetel model", - "noPresetsHelp": "Buat prasetel, lalu tambahkan ke urutan pemanggilan.", "removeBeforeDelete": "Model utama tidak dapat dihapus", "providerSetupRequired": "Penyedia perlu dikonfigurasi", - "configureProviderBeforeSaving": "Konfigurasikan penyedia ini sebelum menyimpan prasetel.", "deletePresetTitle": "Hapus prasetel model?", "deletePresetHelp": "Prasetel “{{name}}” akan dihapus, termasuk dari urutan pemanggilan. Kredensial penyedia tetap disimpan.", "searchModels": "Pilih model", @@ -1052,9 +1021,7 @@ "loadingModels": "Memuat model...", "searchCatalog": "Cari model di katalog penyedia.", "availableCount": "Model tersedia: {{count}}", - "modelsAvailable": "tersedia", "noModelResults": "Tidak ada model yang cocok.", - "loadFailed": "Daftar model tidak tersedia.", "unsupportedModelList": "Ketik ID model secara manual.", "providerNotConfigured": "Konfigurasikan penyedia ini sebelum memuat model.", "autoProviderCustomOnly": "Masukkan ID model untuk memilih penyedia secara otomatis." @@ -1065,39 +1032,17 @@ "empty": "Tidak ada zona waktu yang cocok." }, "cliApps": { - "allCategories": "Semua kategori", - "availableCount_one": "{{count}} aplikasi", - "availableCount_other": "{{count}} aplikasi", - "availableCount": "{{count}} aplikasi", - "installedCount_one": "{{count}} alat CLI terpasang", - "installedCount_other": "{{count}} alat CLI terpasang", - "installedCount": "{{count}} terpasang", - "summary": "{{installed}} dari {{total}} CLI terpasang", - "filterAll": "Semua", - "filterInstalled": "CLI terpasang", - "filterNotInstalled": "Belum terpasang", - "searchPlaceholder": "Cari CLI", "statusInstalled": "Terpasang", - "statusAvailable": "Tersedia", - "statusMissing": "Dependensi belum terpasang", - "statusUnsupported": "Tidak didukung", - "statusNotInstalled": "Belum terpasang", - "unsupported": "Tidak didukung", - "loading": "Memuat aplikasi CLI...", - "empty": "Tidak ada aplikasi CLI yang cocok dengan filter ini.", - "readyTitle": "@{{name}} siap", "readyStatus": "Siap", "readyPrompt": "Gunakan @{{name}} untuk melihat kemampuan CLI ini.", "readyTry": "Coba @{{name}}", "readyCopied": "Disalin", "openChat": "Buka chat", - "requires": "Membutuhkan", "test": "Uji CLI", "update": "Perbarui CLI", "uninstall": "Copot CLI", "install": "Pasang CLI", - "unavailable": "Tidak tersedia", - "noDescription": "Tidak ada deskripsi." + "unavailable": "Tidak tersedia" }, "about": { "updateNotice": "Pembaruan tersedia", diff --git a/webui/src/i18n/locales/ja/common.json b/webui/src/i18n/locales/ja/common.json index 9772e1980..c8ade1d45 100644 --- a/webui/src/i18n/locales/ja/common.json +++ b/webui/src/i18n/locales/ja/common.json @@ -878,21 +878,13 @@ "workspace": "作業ディレクトリ" }, "usage": { - "title": "トークンアクティビティ", "shortTitle": "トークン使用量", - "last30Days": "過去30日間", "viewDetails": "詳細を見る", - "previousPage": "前のページ", - "nextPage": "次のページ", - "dailyAverage": "1日平均", - "inputTokens": "入力トークン", "cacheHitRate": "キャッシュヒット率", - "requestTrend": "毎日の要求", "cacheRateHelp": "キャッシュ状態が不明な入力はヒット率の計算から除外します。", "dailyTrend": "毎日の Token", "systemHelp": "内部タスクと記録された送信元がない呼び出しを含みます。", "bySource": "利用元別の使用量", - "byModel": "モデル別使用量", "modelTrend": "モデルの推移", "modelsUnavailable": "モデル別の内訳はありません。", "otherModels": "その他 / 未分類", @@ -904,19 +896,8 @@ "cacheUnknown": "状態不明", "outputTokens": "出力", "otherTokens": "その他のトークン", - "subtitle": "直近 12 か月にプロバイダーが報告したトークン使用量。", - "empty": "新しいモデル返信の後にトークンアクティビティが表示されます。", "totalTokens": "累計トークン数", - "peakTokens": "ピークトークン数", - "thirtyDayTokens": "30日間の Token", - "currentStreak": "現在の連続日数", - "longestStreak": "最長の連続日数", - "daysValue": "{{count}} 日", - "last30": "30 日", - "activeDays": "アクティブ日数", "requests": "リクエスト", - "estimated": "推定", - "includesEstimates": "推定を含む", "cellTitle": "{{date}}: {{tokens}} トークン、{{requests}} 件のリクエスト", "sources": { "user": "チャット", @@ -998,19 +979,12 @@ "catalogStale": "キャッシュ済みの一覧は古い可能性があります。", "catalogFallback": "組み込みの一覧は古い可能性があります。", "selectModel": "モデルを選択", - "addConfiguration": "設定を追加", - "newConfiguration": "新しいモデル設定", - "newConfigurationHelp": "プロバイダーとモデルの組み合わせを保存し、すぐに切り替えられるようにします。", - "configurationName": "設定名", - "configurationNameHelp": "保存済みのモデル設定の名前を変更します。", - "configurationNamePlaceholder": "文章作成用", "callOrder": "モデルの順序", "primary": "プライマリ", "addToOrder": "プリセットを有効化", "newPreset": "プリセット作成", "newPresetHelp": "モデルと設定を保存して再利用します。", "presets": "モデルプリセット", - "editPreset": "プリセットを編集", "presetName": "プリセット名", "presetNameHelp": "名前は重複できません。/model でも使用します。", "presetNameDuplicate": "同じ名前のプリセットがすでに存在します。", @@ -1035,16 +1009,11 @@ "converting": "変換中...", "convertAction": "プリセットに変換", "dragToReorder": "ドラッグして並べ替え", - "moveUp": "上へ移動", - "moveDown": "下へ移動", "removeFromOrder": "プリセットを無効化", - "inCallOrder": "呼び出し順序に追加済み", "disabled": "無効", "noPresets": "モデルプリセットはまだありません", - "noPresetsHelp": "プリセットを作成してから呼び出し順序に追加してください。", "removeBeforeDelete": "メインモデルは削除できません", "providerSetupRequired": "プロバイダーの設定が必要です", - "configureProviderBeforeSaving": "プリセットを保存する前に、このプロバイダーを設定してください。", "deletePresetTitle": "モデルプリセットを削除しますか?", "deletePresetHelp": "プリセット「{{name}}」を削除し、呼び出し順序からも除外します。プロバイダーの認証情報は保持されます。", "searchModels": "モデルを選択", @@ -1052,9 +1021,7 @@ "loadingModels": "モデルを読み込んでいます...", "searchCatalog": "プロバイダーのカタログからモデルを選択します。", "availableCount": "利用可能なモデル:{{count}}", - "modelsAvailable": "利用可能", "noModelResults": "一致するモデルはありません。", - "loadFailed": "モデル一覧を利用できません。", "unsupportedModelList": "モデル ID を手動で入力してください。", "providerNotConfigured": "モデルを読み込む前にこのプロバイダーを設定してください。", "autoProviderCustomOnly": "プロバイダーを自動で選ぶ場合は、モデル ID を直接入力してください。" @@ -1065,39 +1032,17 @@ "empty": "一致するタイムゾーンはありません。" }, "cliApps": { - "allCategories": "すべてのカテゴリ", - "availableCount_one": "アプリ {{count}} 件", - "availableCount_other": "アプリ {{count}} 件", - "availableCount": "{{count}} 個のアプリ", - "installedCount_one": "インストール済み CLI:{{count}} 件", - "installedCount_other": "インストール済み CLI:{{count}} 件", - "installedCount": "{{count}} 個インストール済み", - "summary": "{{total}} 個中 {{installed}} 個の CLI がインストール済み", - "filterAll": "すべて", - "filterInstalled": "インストール済み CLI", - "filterNotInstalled": "未インストール", - "searchPlaceholder": "CLI を検索", "statusInstalled": "インストール済み", - "statusAvailable": "利用可能", - "statusMissing": "依存関係が不足", - "statusUnsupported": "未対応", - "statusNotInstalled": "未インストール", - "unsupported": "未対応", - "loading": "CLI アプリを読み込み中...", - "empty": "この条件に一致する CLI アプリはありません。", - "readyTitle": "@{{name}} の準備ができました", "readyStatus": "準備完了", "readyPrompt": "@{{name}} を使って、この CLI でできることを確認します。", "readyTry": "@{{name}} を試す", "readyCopied": "コピーしました", "openChat": "チャットを開く", - "requires": "必要条件", "test": "CLI をテスト", "update": "CLI を更新", "uninstall": "CLI をアンインストール", "install": "CLI をインストール", - "unavailable": "利用不可", - "noDescription": "説明はありません。" + "unavailable": "利用不可" }, "about": { "updateNotice": "アップデートがあります", diff --git a/webui/src/i18n/locales/ko/common.json b/webui/src/i18n/locales/ko/common.json index 0803adae2..317518228 100644 --- a/webui/src/i18n/locales/ko/common.json +++ b/webui/src/i18n/locales/ko/common.json @@ -878,21 +878,13 @@ "workspace": "작업 디렉터리" }, "usage": { - "title": "토큰 활동", "shortTitle": "토큰 사용량", - "last30Days": "최근 30일", "viewDetails": "자세히 보기", - "previousPage": "이전 페이지", - "nextPage": "다음 페이지", - "dailyAverage": "일평균 사용량", - "inputTokens": "입력 토큰", "cacheHitRate": "캐시 적중률", - "requestTrend": "일일 요청", "cacheRateHelp": "캐시 상태가 알려진 입력만 적중률 계산에 포함됩니다.", "dailyTrend": "일일 Token", "systemHelp": "내부 작업과 출처가 기록되지 않은 호출을 포함합니다.", "bySource": "출처별 사용량", - "byModel": "모델별 사용량", "modelTrend": "모델 추이", "modelsUnavailable": "모델별 내역이 없습니다.", "otherModels": "기타 / 미분류", @@ -904,19 +896,8 @@ "cacheUnknown": "상태 알 수 없음", "outputTokens": "출력", "otherTokens": "기타 토큰", - "subtitle": "최근 12개월 동안 제공업체가 보고한 사용량입니다.", - "empty": "새 모델 응답 이후 토큰 활동이 표시됩니다.", "totalTokens": "누적 토큰 수", - "peakTokens": "최고 토큰 수", - "thirtyDayTokens": "30일 Token", - "currentStreak": "현재 연속 일수", - "longestStreak": "최장 연속 일수", - "daysValue": "{{count}}일", - "last30": "30일", - "activeDays": "활성 일수", "requests": "요청", - "estimated": "추정", - "includesEstimates": "추정 포함", "cellTitle": "{{date}}: {{tokens}} 토큰, 요청 {{requests}}회", "sources": { "user": "채팅", @@ -998,19 +979,12 @@ "catalogStale": "캐시된 목록이 최신이 아닐 수 있습니다.", "catalogFallback": "기본 제공 목록이 최신이 아닐 수 있습니다.", "selectModel": "모델 선택", - "addConfiguration": "설정 추가", - "newConfiguration": "새 모델 설정", - "newConfigurationHelp": "제공업체와 모델의 조합을 저장해 빠르게 선택할 수 있습니다.", - "configurationName": "설정 이름", - "configurationNameHelp": "저장된 모델 설정의 이름을 변경합니다.", - "configurationNamePlaceholder": "빠른 작성", "callOrder": "모델 순서", "primary": "기본", "addToOrder": "프리셋 활성화", "newPreset": "프리셋 만들기", "newPresetHelp": "모델과 설정을 저장해 다시 사용하세요.", "presets": "모델 프리셋", - "editPreset": "프리셋 편집", "presetName": "프리셋 이름", "presetNameHelp": "이름은 고유해야 하며 /model에서도 사용됩니다.", "presetNameDuplicate": "같은 이름의 프리셋이 이미 있습니다.", @@ -1035,16 +1009,11 @@ "converting": "변환 중...", "convertAction": "프리셋으로 변환", "dragToReorder": "드래그하여 순서 변경", - "moveUp": "위로 이동", - "moveDown": "아래로 이동", "removeFromOrder": "프리셋 비활성화", - "inCallOrder": "호출 순서에 포함됨", "disabled": "비활성화됨", "noPresets": "아직 모델 프리셋이 없습니다", - "noPresetsHelp": "프리셋을 만든 다음 호출 순서에 추가하세요.", "removeBeforeDelete": "기본 모델은 삭제할 수 없습니다", "providerSetupRequired": "제공업체 설정 필요", - "configureProviderBeforeSaving": "프리셋을 저장하기 전에 이 제공업체를 설정하세요.", "deletePresetTitle": "모델 프리셋을 삭제할까요?", "deletePresetHelp": "프리셋 ‘{{name}}’을 삭제하고 호출 순서에서도 제거합니다. 제공업체 인증 정보는 유지됩니다.", "searchModels": "모델 선택", @@ -1052,9 +1021,7 @@ "loadingModels": "모델 불러오는 중...", "searchCatalog": "제공업체 카탈로그에서 모델을 선택합니다.", "availableCount": "사용 가능한 모델: {{count}}개", - "modelsAvailable": "사용 가능", "noModelResults": "일치하는 모델이 없습니다.", - "loadFailed": "모델 목록을 사용할 수 없습니다.", "unsupportedModelList": "모델 ID를 직접 입력하세요.", "providerNotConfigured": "모델을 불러오기 전에 이 제공업체를 설정하세요.", "autoProviderCustomOnly": "제공업체를 자동으로 선택하려면 모델 ID를 직접 입력하세요." @@ -1065,39 +1032,17 @@ "empty": "일치하는 시간대가 없습니다." }, "cliApps": { - "allCategories": "모든 카테고리", - "availableCount_one": "앱 {{count}}개", - "availableCount_other": "앱 {{count}}개", - "availableCount": "앱 {{count}}개", - "installedCount_one": "설치된 CLI 도구 {{count}}개", - "installedCount_other": "설치된 CLI 도구 {{count}}개", - "installedCount": "{{count}}개 설치됨", - "summary": "CLI {{total}}개 중 {{installed}}개 설치됨", - "filterAll": "전체", - "filterInstalled": "설치된 CLI", - "filterNotInstalled": "미설치", - "searchPlaceholder": "CLI 검색", "statusInstalled": "설치됨", - "statusAvailable": "사용 가능", - "statusMissing": "의존성 필요", - "statusUnsupported": "지원 안 함", - "statusNotInstalled": "미설치", - "unsupported": "지원 안 함", - "loading": "CLI 앱 로드 중...", - "empty": "이 필터와 일치하는 CLI 앱이 없습니다.", - "readyTitle": "@{{name}} 준비됨", "readyStatus": "준비됨", "readyPrompt": "채팅에서 @{{name}} 명령으로 이 도구의 기능을 확인하세요.", "readyTry": "@{{name}} 사용해 보기", "readyCopied": "복사됨", "openChat": "채팅 열기", - "requires": "필요 항목", "test": "CLI 테스트", "update": "CLI 업데이트", "uninstall": "CLI 제거", "install": "CLI 설치", - "unavailable": "사용 불가", - "noDescription": "설명이 없습니다." + "unavailable": "사용 불가" }, "about": { "updateNotice": "업데이트가 있습니다", diff --git a/webui/src/i18n/locales/pt-BR/common.json b/webui/src/i18n/locales/pt-BR/common.json index 33ae4a65b..92a8f444f 100644 --- a/webui/src/i18n/locales/pt-BR/common.json +++ b/webui/src/i18n/locales/pt-BR/common.json @@ -622,19 +622,12 @@ "catalogStale": "A lista em cache pode estar desatualizada.", "catalogFallback": "A lista integrada pode estar desatualizada.", "selectModel": "Selecionar modelo", - "addConfiguration": "Adicionar configuração", - "newConfiguration": "Nova configuração de modelo", - "newConfigurationHelp": "Salve um provedor e um modelo para selecioná-los rapidamente.", - "configurationName": "Nome da configuração", - "configurationNameHelp": "Renomeie esta configuração de modelo.", - "configurationNamePlaceholder": "Escrita rápida", "callOrder": "Ordem dos modelos", "primary": "Principal", "addToOrder": "Ativar predefinição", "newPreset": "Novo preset", "newPresetHelp": "Salve um modelo e seus ajustes para reutilizar.", "presets": "Predefinições de modelo", - "editPreset": "Editar predefinição", "presetName": "Nome da predefinição", "presetNameHelp": "Os nomes devem ser únicos; também são usados por /model.", "presetNameDuplicate": "Já existe uma predefinição com este nome.", @@ -659,16 +652,11 @@ "converting": "Convertendo...", "convertAction": "Converter em presets", "dragToReorder": "Arraste para reordenar", - "moveUp": "Mover para cima", - "moveDown": "Mover para baixo", "removeFromOrder": "Desativar predefinição", - "inCallOrder": "Na ordem de chamada", "disabled": "Desabilitado", "noPresets": "Ainda não há predefinições de modelo", - "noPresetsHelp": "Crie uma predefinição e adicione-a à ordem de chamada.", "removeBeforeDelete": "Não é possível excluir o modelo principal", "providerSetupRequired": "Configuração do provedor necessária", - "configureProviderBeforeSaving": "Configure este provedor antes de salvar a predefinição.", "deletePresetTitle": "Excluir predefinição de modelo?", "deletePresetHelp": "A predefinição “{{name}}” será excluída e removida da ordem de chamada. As credenciais do provedor serão mantidas.", "searchModels": "Escolher modelo", @@ -676,9 +664,7 @@ "loadingModels": "Carregando modelos...", "searchCatalog": "Pesquise o catálogo do provedor para escolher um modelo.", "availableCount": "Modelos disponíveis: {{count}}", - "modelsAvailable": "disponíveis", "noModelResults": "Nenhum modelo correspondente.", - "loadFailed": "Lista de modelos indisponível.", "unsupportedModelList": "Digite o ID do modelo manualmente.", "providerNotConfigured": "Configure este provedor antes de carregar modelos.", "autoProviderCustomOnly": "Digite um ID de modelo para usar a seleção automática de provedor." @@ -839,39 +825,17 @@ "empty": "Nenhum fuso horário correspondente." }, "cliApps": { - "allCategories": "Todas as categorias", - "availableCount_one": "{{count}} aplicativo", - "availableCount_other": "{{count}} aplicativos", - "availableCount": "{{count}} aplicativos", - "installedCount_one": "{{count}} ferramenta CLI instalada", - "installedCount_other": "{{count}} ferramentas CLI instaladas", - "installedCount": "{{count}} ferramentas CLI instaladas", - "summary": "{{installed}} de {{total}} ferramentas CLI instaladas", - "filterAll": "Todos", - "filterInstalled": "Ferramentas CLI instaladas", - "filterNotInstalled": "Não instaladas", - "searchPlaceholder": "Buscar ferramentas CLI", - "loading": "Carregando aplicativos CLI...", - "empty": "Nenhum aplicativo CLI corresponde a este filtro.", "statusInstalled": "Instalado", - "statusMissing": "Dependência ausente", - "statusAvailable": "Disponível", - "statusUnsupported": "Não compatível", - "statusNotInstalled": "Não instalado", - "requires": "Requer", "test": "Testar ferramenta CLI", "update": "Atualizar ferramenta CLI", "uninstall": "Desinstalar ferramenta CLI", "install": "Instalar ferramenta CLI", - "readyTitle": "@{{name}} está pronto", "readyStatus": "Pronto", "readyTry": "Experimentar @{{name}}", "readyCopied": "Copiado", "readyPrompt": "Peça ao nanobot para usar @{{name}} nesta tarefa.", "openChat": "Abrir conversa", - "unsupported": "Não compatível", - "unavailable": "Indisponível", - "noDescription": "Nenhuma descrição disponível." + "unavailable": "Indisponível" }, "about": { "updateNotice": "Atualização disponível", @@ -1122,21 +1086,13 @@ "workspace": "Diretório de trabalho" }, "usage": { - "title": "Atividade de tokens", "shortTitle": "Uso de tokens", - "last30Days": "Últimos 30 dias", "viewDetails": "Ver detalhes", - "previousPage": "Página anterior", - "nextPage": "Próxima página", - "dailyAverage": "Média diária", - "inputTokens": "Tokens de entrada", "cacheHitRate": "Taxa de acertos de cache", - "requestTrend": "Solicitações diárias", "cacheRateHelp": "A taxa exclui entradas com estado de cache desconhecido.", "dailyTrend": "Tokens diários", "systemHelp": "Inclui tarefas internas e chamadas sem origem registrada.", "bySource": "Uso por origem", - "byModel": "Uso por modelo", "modelTrend": "Tendências dos modelos", "modelsUnavailable": "Sem detalhamento por modelo.", "otherModels": "Outros / não atribuídos", @@ -1148,19 +1104,8 @@ "cacheUnknown": "Status desconhecido", "outputTokens": "Saída", "otherTokens": "Outros tokens", - "subtitle": "Uso reportado pelo provedor nos últimos 12 meses.", - "empty": "A atividade de tokens aparecerá após novas respostas do modelo.", "totalTokens": "Total de tokens", - "peakTokens": "Pico de tokens", - "thirtyDayTokens": "Tokens de 30 dias", - "currentStreak": "Sequência atual", - "longestStreak": "Maior sequência", - "daysValue": "{{count}}d", - "last30": "30 dias", - "activeDays": "Dias ativos", "requests": "Requisições", - "estimated": "estimado", - "includesEstimates": "inclui estimativas", "cellTitle": "{{date}}: {{tokens}} tokens, {{requests}} requisições", "sources": { "user": "Chat", diff --git a/webui/src/i18n/locales/vi/common.json b/webui/src/i18n/locales/vi/common.json index acd1281ed..86bcd1761 100644 --- a/webui/src/i18n/locales/vi/common.json +++ b/webui/src/i18n/locales/vi/common.json @@ -878,21 +878,13 @@ "workspace": "Thư mục làm việc" }, "usage": { - "title": "Hoạt động token", "shortTitle": "Mức dùng token", - "last30Days": "30 ngày qua", "viewDetails": "Xem chi tiết", - "previousPage": "Trang trước", - "nextPage": "Trang sau", - "dailyAverage": "Trung bình mỗi ngày", - "inputTokens": "Token đầu vào", "cacheHitRate": "Tỷ lệ trúng bộ nhớ đệm", - "requestTrend": "Yêu cầu mỗi ngày", "cacheRateHelp": "Tỷ lệ không tính đầu vào có trạng thái bộ nhớ đệm không rõ.", "dailyTrend": "Token mỗi ngày", "systemHelp": "Gồm tác vụ nội bộ và lệnh gọi chưa ghi nguồn.", "bySource": "Mức dùng theo nguồn", - "byModel": "Mức dùng theo mô hình", "modelTrend": "Xu hướng mô hình", "modelsUnavailable": "Chưa có chi tiết theo mô hình.", "otherModels": "Khác / chưa phân loại", @@ -904,19 +896,8 @@ "cacheUnknown": "Trạng thái chưa rõ", "outputTokens": "Đầu ra", "otherTokens": "Token khác", - "subtitle": "Mức dùng do nhà cung cấp báo cáo trong 12 tháng gần nhất.", - "empty": "Hoạt động token sẽ xuất hiện sau các phản hồi mô hình mới.", "totalTokens": "Tổng token", - "peakTokens": "Mức dùng token cao nhất", - "thirtyDayTokens": "Token trong 30 ngày", - "currentStreak": "Chuỗi ngày hiện tại", - "longestStreak": "Chuỗi ngày dài nhất", - "daysValue": "{{count}} ngày", - "last30": "30 ngày", - "activeDays": "Ngày hoạt động", "requests": "Yêu cầu", - "estimated": "ước tính", - "includesEstimates": "bao gồm ước tính", "cellTitle": "{{date}}: {{tokens}} tokens, {{requests}} yêu cầu", "sources": { "user": "Trò chuyện", @@ -998,19 +979,12 @@ "catalogStale": "Danh sách đã lưu đệm có thể đã cũ.", "catalogFallback": "Danh sách có sẵn có thể đã cũ.", "selectModel": "Chọn mô hình", - "addConfiguration": "Thêm cấu hình", - "newConfiguration": "Cấu hình mô hình mới", - "newConfigurationHelp": "Lưu nhà cung cấp và mô hình thành một lựa chọn nhanh.", - "configurationName": "Tên cấu hình", - "configurationNameHelp": "Đổi tên cấu hình mô hình đã lưu này.", - "configurationNamePlaceholder": "Viết nhanh", "callOrder": "Thứ tự mô hình", "primary": "Chính", "addToOrder": "Bật cấu hình đặt trước", "newPreset": "Tạo bộ thiết lập", "newPresetHelp": "Lưu mô hình và thiết lập để dùng lại.", "presets": "Cấu hình mô hình đặt trước", - "editPreset": "Sửa cấu hình đặt trước", "presetName": "Tên cấu hình đặt trước", "presetNameHelp": "Tên phải duy nhất; cũng dùng trong /model.", "presetNameDuplicate": "Đã có cấu hình đặt trước mang tên này.", @@ -1035,16 +1009,11 @@ "converting": "Đang chuyển đổi...", "convertAction": "Chuyển thành bộ thiết lập", "dragToReorder": "Kéo để sắp xếp lại", - "moveUp": "Di chuyển lên", - "moveDown": "Di chuyển xuống", "removeFromOrder": "Tắt cấu hình đặt trước", - "inCallOrder": "Trong thứ tự gọi", "disabled": "Đã tắt", "noPresets": "Chưa có cấu hình mô hình đặt trước", - "noPresetsHelp": "Tạo cấu hình đặt trước rồi thêm vào thứ tự gọi.", "removeBeforeDelete": "Không thể xóa mô hình chính", "providerSetupRequired": "Cần cấu hình nhà cung cấp", - "configureProviderBeforeSaving": "Hãy cấu hình nhà cung cấp này trước khi lưu cấu hình đặt trước.", "deletePresetTitle": "Xóa cấu hình mô hình đặt trước?", "deletePresetHelp": "Cấu hình đặt trước “{{name}}” sẽ bị xóa và loại khỏi thứ tự gọi. Thông tin xác thực của nhà cung cấp vẫn được giữ lại.", "searchModels": "Chọn mô hình", @@ -1052,9 +1021,7 @@ "loadingModels": "Đang tải mô hình...", "searchCatalog": "Tìm trong danh mục nhà cung cấp để chọn mô hình.", "availableCount": "Mô hình khả dụng: {{count}}", - "modelsAvailable": "khả dụng", "noModelResults": "Không có mô hình phù hợp.", - "loadFailed": "Không tải được danh sách mô hình.", "unsupportedModelList": "Nhập ID mô hình thủ công.", "providerNotConfigured": "Hãy cấu hình nhà cung cấp này trước khi tải mô hình.", "autoProviderCustomOnly": "Nhập ID mô hình để dùng chế độ tự động chọn nhà cung cấp." @@ -1065,39 +1032,17 @@ "empty": "Không có múi giờ phù hợp." }, "cliApps": { - "allCategories": "Tất cả danh mục", - "availableCount_one": "{{count}} ứng dụng", - "availableCount_other": "{{count}} ứng dụng", - "availableCount": "{{count}} ứng dụng", - "installedCount_one": "Đã cài đặt {{count}} công cụ CLI", - "installedCount_other": "Đã cài đặt {{count}} công cụ CLI", - "installedCount": "Đã cài {{count}}", - "summary": "Đã cài {{installed}} / {{total}} CLI", - "filterAll": "Tất cả", - "filterInstalled": "CLI đã cài", - "filterNotInstalled": "Chưa cài", - "searchPlaceholder": "Tìm CLI", "statusInstalled": "Đã cài", - "statusAvailable": "Có sẵn", - "statusMissing": "Thiếu gói cần thiết", - "statusUnsupported": "Không hỗ trợ", - "statusNotInstalled": "Chưa cài", - "unsupported": "Không hỗ trợ", - "loading": "Đang tải ứng dụng CLI...", - "empty": "Không có ứng dụng CLI nào khớp bộ lọc này.", - "readyTitle": "@{{name}} đã sẵn sàng", "readyStatus": "Sẵn sàng", "readyPrompt": "Dùng @{{name}} để xem CLI này làm được gì.", "readyTry": "Thử @{{name}}", "readyCopied": "Đã sao chép", "openChat": "Mở chat", - "requires": "Yêu cầu", "test": "Kiểm tra CLI", "update": "Cập nhật CLI", "uninstall": "Gỡ CLI", "install": "Cài CLI", - "unavailable": "Không khả dụng", - "noDescription": "Không có mô tả." + "unavailable": "Không khả dụng" }, "about": { "updateNotice": "Có bản cập nhật", diff --git a/webui/src/i18n/locales/zh-CN/common.json b/webui/src/i18n/locales/zh-CN/common.json index 479175eb6..df857a88f 100644 --- a/webui/src/i18n/locales/zh-CN/common.json +++ b/webui/src/i18n/locales/zh-CN/common.json @@ -814,19 +814,12 @@ "catalogStale": "缓存列表可能已过时。", "catalogFallback": "内置列表可能已过时。", "selectModel": "选择模型", - "addConfiguration": "添加配置", - "newConfiguration": "新建模型配置", - "newConfigurationHelp": "将提供商、模型和参数保存为预设,方便下次选用。", - "configurationName": "配置名称", - "configurationNameHelp": "重命名这个已保存的模型配置。", - "configurationNamePlaceholder": "快速写作", "callOrder": "使用顺序", "primary": "主模型", "addToOrder": "启用预设", "newPreset": "新建预设", "newPresetHelp": "保存模型和参数,方便下次选用", "presets": "模型预设", - "editPreset": "编辑预设", "presetName": "预设名称", "presetNameHelp": "名称不可重复,也用于 /model", "presetNameDuplicate": "已存在同名预设。", @@ -851,25 +844,18 @@ "converting": "正在转换...", "convertAction": "转为预设", "dragToReorder": "拖动调整顺序", - "moveUp": "上移", - "moveDown": "下移", "removeFromOrder": "停用预设", - "inCallOrder": "已加入调用顺序", "disabled": "未启用", "noPresets": "还没有模型预设", - "noPresetsHelp": "先创建预设,再将它加入调用顺序。", "removeBeforeDelete": "无法删除主模型", "providerSetupRequired": "请先配置提供商", - "configureProviderBeforeSaving": "请先配置此提供商,再保存预设。", "deletePresetTitle": "删除模型预设?", "deletePresetHelp": "删除预设“{{name}}”,同时将它从备用模型列表中移除。提供商凭据会保留。", "searchModels": "选择模型", "useCustomModel": "使用", "loadingModels": "正在加载模型...", "searchCatalog": "搜索此提供商的模型列表。", - "modelsAvailable": "可用", "noModelResults": "没有匹配的模型。", - "loadFailed": "暂时无法加载模型列表。", "unsupportedModelList": "手动输入模型 ID。", "providerNotConfigured": "加载模型前请先配置此提供商。", "autoProviderCustomOnly": "自动选择提供商时,请手动输入模型 ID。", @@ -1031,39 +1017,17 @@ "empty": "没有匹配的时区。" }, "cliApps": { - "allCategories": "全部分类", - "availableCount_one": "{{count}} 个应用", - "availableCount_other": "{{count}} 个应用", - "availableCount": "{{count}} 个应用", - "installedCount_one": "已安装 {{count}} 个命令行应用", - "installedCount_other": "已安装 {{count}} 个命令行应用", - "installedCount": "已安装 {{count}} 个命令行应用", - "summary": "已安装 {{installed}} / {{total}} 个命令行应用", - "filterAll": "全部", - "filterInstalled": "已安装", - "filterNotInstalled": "未安装", - "searchPlaceholder": "搜索命令行应用", - "loading": "正在加载命令行应用…", - "empty": "没有匹配的命令行应用。", "statusInstalled": "应用已就绪", - "statusMissing": "未安装", - "statusAvailable": "可用", - "statusUnsupported": "暂不支持", - "statusNotInstalled": "应用未安装", - "requires": "依赖", "test": "测试应用", "update": "更新应用", "uninstall": "卸载应用", "install": "安装应用", - "readyTitle": "@{{name}} 已就绪", "readyStatus": "就绪", "readyTry": "试试 @{{name}}", "readyCopied": "已复制", "readyPrompt": "让 nanobot 在这个任务中使用 @{{name}}。", "openChat": "返回聊天", - "unsupported": "暂不支持", - "unavailable": "不可用", - "noDescription": "暂无描述。" + "unavailable": "不可用" }, "about": { "updateNotice": "有可用更新", @@ -1314,20 +1278,12 @@ "workspace": "工作目录" }, "usage": { - "title": "Token 用量", "shortTitle": "Token 用量", - "last30Days": "近 30 天", "viewDetails": "查看详情", - "previousPage": "上一页", - "nextPage": "下一页", - "dailyAverage": "日均用量", - "inputTokens": "输入 Token", "cacheHitRate": "缓存命中率", - "requestTrend": "每日请求", "cacheRateHelp": "缓存命中率仅统计缓存状态已知的输入。", "dailyTrend": "每日 Token", "bySource": "用量来源", - "byModel": "模型用量", "modelTrend": "模型趋势", "modelsUnavailable": "暂无模型用量明细。", "otherModels": "其他模型 / 未分类", @@ -1339,19 +1295,8 @@ "cacheUnknown": "状态未知", "outputTokens": "输出", "otherTokens": "其他 Token", - "subtitle": "最近 12 个月由提供商上报的 Token 用量。", - "empty": "模型产生新的回复后,这里会显示 Token 用量。", "totalTokens": "Token 总数", - "peakTokens": "Token 峰值", - "thirtyDayTokens": "30 天 Token", - "currentStreak": "连续天数", - "longestStreak": "最长连续", - "daysValue": "{{count}} 天", - "last30": "30 天", - "activeDays": "活跃天数", "requests": "请求数", - "estimated": "估算", - "includesEstimates": "包含估算", "cellTitle": "{{date}}:{{tokens}} Token,{{requests}} 次请求", "sources": { "user": "对话", diff --git a/webui/src/i18n/locales/zh-TW/common.json b/webui/src/i18n/locales/zh-TW/common.json index 71d00512e..037f639b9 100644 --- a/webui/src/i18n/locales/zh-TW/common.json +++ b/webui/src/i18n/locales/zh-TW/common.json @@ -878,21 +878,13 @@ "workspace": "工作目錄" }, "usage": { - "title": "Token 用量", "shortTitle": "Token 用量", - "last30Days": "近 30 天", "viewDetails": "查看詳情", - "previousPage": "上一頁", - "nextPage": "下一頁", - "dailyAverage": "日均用量", - "inputTokens": "輸入 Token", "cacheHitRate": "快取命中率", - "requestTrend": "每日請求", "cacheRateHelp": "快取命中率僅統計快取狀態已知的輸入。", "dailyTrend": "每日 Token", "systemHelp": "包括內部任務和未標註來源的呼叫", "bySource": "用量來源", - "byModel": "模型用量", "modelTrend": "模型趨勢", "modelsUnavailable": "暫無模型用量明細。", "otherModels": "其他模型 / 未歸類", @@ -904,19 +896,8 @@ "cacheUnknown": "狀態未知", "outputTokens": "輸出", "otherTokens": "其他 Token", - "subtitle": "最近 12 個月由供應商回報的 Token 用量。", - "empty": "模型產生新回覆後,此處會顯示 Token 用量。", "totalTokens": "Token 總數", - "peakTokens": "Token 峰值", - "thirtyDayTokens": "30 天 Token", - "currentStreak": "連續天數", - "longestStreak": "最長連續", - "daysValue": "{{count}} 天", - "last30": "30 天", - "activeDays": "使用天數", "requests": "請求數", - "estimated": "估算", - "includesEstimates": "包含估算", "cellTitle": "{{date}}:{{tokens}} 個 Token,{{requests}} 次請求", "sources": { "user": "對話", @@ -998,19 +979,12 @@ "catalogStale": "快取清單可能已過時。", "catalogFallback": "內建清單可能已過時。", "selectModel": "選擇模型", - "addConfiguration": "新增設定", - "newConfiguration": "新增模型設定", - "newConfigurationHelp": "將供應商、模型及生成參數儲存為預設,方便下次選用。", - "configurationName": "設定名稱", - "configurationNameHelp": "重新命名這個已儲存的模型設定。", - "configurationNamePlaceholder": "快速寫作", "callOrder": "使用順序", "primary": "主要模型", "addToOrder": "啟用預設", "newPreset": "新建預設", "newPresetHelp": "儲存模型和引數,方便下次選用", "presets": "模型預設", - "editPreset": "編輯預設", "presetName": "預設名稱", "presetNameHelp": "名稱不可重複,也用於 /model", "presetNameDuplicate": "已有同名預設。", @@ -1035,16 +1009,11 @@ "converting": "正在轉換…", "convertAction": "轉為預設", "dragToReorder": "拖曳調整順序", - "moveUp": "上移", - "moveDown": "下移", "removeFromOrder": "停用預設", - "inCallOrder": "已加入呼叫順序", "disabled": "未啟用", "noPresets": "尚無模型預設", - "noPresetsHelp": "先建立預設,再將它加入呼叫順序。", "removeBeforeDelete": "無法刪除主要模型", "providerSetupRequired": "供應商需要設定", - "configureProviderBeforeSaving": "請先設定此供應商,再儲存預設。", "deletePresetTitle": "刪除模型預設?", "deletePresetHelp": "刪除預設「{{name}}」,並將它從備用模型清單移除。供應商憑證會保留。", "searchModels": "選擇模型", @@ -1052,9 +1021,7 @@ "loadingModels": "正在載入模型…", "searchCatalog": "搜尋此供應商的模型清單。", "availableCount": "可用模型:{{count}} 個", - "modelsAvailable": "可用", "noModelResults": "沒有符合的模型。", - "loadFailed": "無法取得模型清單。", "unsupportedModelList": "手動輸入模型 ID。", "providerNotConfigured": "載入模型前請先設定此供應商。", "autoProviderCustomOnly": "自動選擇供應商時,請手動輸入模型 ID。" @@ -1065,39 +1032,17 @@ "empty": "沒有符合的時區。" }, "cliApps": { - "allCategories": "全部分類", - "availableCount_one": "{{count}} 個應用程式", - "availableCount_other": "{{count}} 個應用程式", - "availableCount": "{{count}} 個應用程式", - "installedCount_one": "已安裝 {{count}} 個命令列工具", - "installedCount_other": "已安裝 {{count}} 個命令列工具", - "installedCount": "已安裝 {{count}} 個命令列工具", - "summary": "已安裝 {{installed}} / {{total}} 個命令列工具", - "filterAll": "全部", - "filterInstalled": "已安裝的 CLI", - "filterNotInstalled": "未安裝", - "searchPlaceholder": "搜尋 CLI", "statusInstalled": "應用程式已就緒", - "statusAvailable": "可用", - "statusMissing": "缺少相依項", - "statusUnsupported": "不支援", - "statusNotInstalled": "未安裝", - "unsupported": "不支援", - "loading": "正在載入 CLI 應用程式…", - "empty": "沒有符合此篩選條件的 CLI 應用程式。", - "readyTitle": "@{{name}} 已就緒", "readyStatus": "就緒", "readyPrompt": "請 nanobot 使用 @{{name}} 完成這項任務。", "readyTry": "試用 @{{name}}", "readyCopied": "已複製", "openChat": "開啟聊天", - "requires": "需要", "test": "測試 CLI", "update": "更新 CLI", "uninstall": "解除安裝 CLI", "install": "安裝 CLI", - "unavailable": "不可用", - "noDescription": "目前沒有描述。" + "unavailable": "不可用" }, "about": { "updateNotice": "有可用更新", diff --git a/webui/src/tests/channel-qr-connect.test.tsx b/webui/src/tests/channel-qr-connect.test.tsx index 6f0cbf568..ad792b0f7 100644 --- a/webui/src/tests/channel-qr-connect.test.tsx +++ b/webui/src/tests/channel-qr-connect.test.tsx @@ -92,7 +92,7 @@ describe("channel QR connect parameters", () => { requestMutation.mockResolvedValueOnce({ session_id: "qr-session", status: "pending", qr_url: "https://example.com/connect", }); - render(); fireEvent.click(screen.getByRole("button", { name: "Connect" })); expect(await screen.findByRole("img", { name: "Connection QR code" })).toHaveAttribute("src", "data:image/png;base64,preview"); @@ -104,7 +104,7 @@ describe("channel QR connect parameters", () => { requestMutation .mockResolvedValueOnce({ session_id: "browser-session", status: "pending", qr_url: "https://example.com/authorize" }) .mockResolvedValueOnce({ session_id: "browser-session", status: "cancelled" }); - render(); fireEvent.click(screen.getByRole("button", { name: "Connect" })); @@ -128,7 +128,7 @@ describe("channel QR connect parameters", () => { requestMutation .mockResolvedValueOnce({ session_id: "browser-session", status: "pending", qr_url: "https://example.com/authorize" }) .mockResolvedValueOnce({ session_id: "browser-session", status: "succeeded", nanobot_features: features }); - render(); fireEvent.click(screen.getByRole("button", { name: "Connect" })); expect(await screen.findByText("Connected", {}, { timeout: 2000 })).toBeVisible(); @@ -141,7 +141,6 @@ describe("channel QR connect parameters", () => { it("forwards current channel parameters without restarting on rerender and preserves forced retries", async () => { const props = { - token: "tok", channelName: "plugin-chat", autoStart: true, forceOnRepeat: true, diff --git a/webui/src/tests/thread-composer-attach.test.tsx b/webui/src/tests/thread-composer-attach.test.tsx index 5127ef263..6ee778a81 100644 --- a/webui/src/tests/thread-composer-attach.test.tsx +++ b/webui/src/tests/thread-composer-attach.test.tsx @@ -41,9 +41,7 @@ function resolveReady(file: File): Extract { id: "stub", ok: true, dataUrl: `data:image/png;base64,${btoa(file.name)}`, - mime: "image/png", bytes: file.size, - origBytes: file.size, normalized: false, }; } diff --git a/webui/src/tests/thread-shell.test.tsx b/webui/src/tests/thread-shell.test.tsx index 99378bbba..78945ef39 100644 --- a/webui/src/tests/thread-shell.test.tsx +++ b/webui/src/tests/thread-shell.test.tsx @@ -1221,22 +1221,19 @@ describe("ThreadShell", () => { it("does not navigate away when clicking the chat title", async () => { const client = makeClient(); - const onGoHome = vi.fn(); render(wrap( client, {}} - onGoHome={onGoHome} - onNewChat={() => {}} />, )); await waitFor(() => expect(screen.getByText("Important conversation")).toBeInTheDocument()); fireEvent.click(screen.getByText("Important conversation")); - expect(onGoHome).not.toHaveBeenCalled(); + expect(screen.getByText("Important conversation")).toBeVisible(); }); it.each([true, false])("waits for parent settings and retries only on failure (success: %s)", async (success) => { @@ -1768,7 +1765,6 @@ describe("ThreadShell", () => { it("restores in-memory messages when switching away and back to a session", async () => { const client = makeClient(); - const onNewChat = vi.fn().mockResolvedValue("chat-a"); const { rerender } = render( wrap( @@ -1777,8 +1773,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -1801,8 +1795,6 @@ describe("ThreadShell", () => { session={session("chat-b")} title="Chat chat-b" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -1816,8 +1808,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -1988,7 +1978,6 @@ describe("ThreadShell", () => { it("clears the old thread when the active session is removed", async () => { const client = makeClient(); - const onNewChat = vi.fn().mockResolvedValue("chat-a"); const { rerender } = render( wrap( @@ -1997,8 +1986,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -2021,8 +2008,6 @@ describe("ThreadShell", () => { session={null} title="nanobot" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -2036,7 +2021,6 @@ describe("ThreadShell", () => { it("creates a chat only when the blank landing sends a first message", async () => { const client = makeClient(); - const onNewChat = vi.fn(); const onCreateChat = vi.fn().mockResolvedValue("chat-new"); render( @@ -2046,8 +2030,6 @@ describe("ThreadShell", () => { session={null} title="nanobot" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} onCreateChat={onCreateChat} />, ), @@ -2060,7 +2042,6 @@ describe("ThreadShell", () => { await waitFor(() => expect(onCreateChat).toHaveBeenCalledTimes(1)); expect(onCreateChat).toHaveBeenCalledWith(null, "start for real", null); - expect(onNewChat).not.toHaveBeenCalled(); }); it("applies the selected landing preset before sending the first prompt", async () => { @@ -2377,8 +2358,6 @@ describe("ThreadShell", () => { session={null} title="nanobot" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />, ), ); @@ -2394,7 +2373,6 @@ describe("ThreadShell", () => { it("does not leak the previous thread when opening a brand-new chat", async () => { const client = makeClient(); - const onNewChat = vi.fn().mockResolvedValue("chat-new"); vi.stubGlobal( "fetch", vi.fn(async (input: RequestInfo | URL) => { @@ -2422,8 +2400,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -2438,8 +2414,6 @@ describe("ThreadShell", () => { session={session("chat-new")} title="Chat chat-new" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -2507,7 +2481,6 @@ describe("ThreadShell", () => { it("does not cache optimistic messages under the next chat during a session switch", async () => { const client = makeClient(); - const onNewChat = vi.fn().mockResolvedValue("chat-b"); const { rerender } = render( wrap( @@ -2516,8 +2489,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -2540,8 +2511,6 @@ describe("ThreadShell", () => { session={session("chat-b")} title="Chat chat-b" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -2559,8 +2528,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -2576,8 +2543,6 @@ describe("ThreadShell", () => { session={session("chat-b")} title="Chat chat-b" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -2612,7 +2577,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -2635,7 +2599,6 @@ describe("ThreadShell", () => { session={null} title="nanobot" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -2652,7 +2615,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -2669,7 +2631,6 @@ describe("ThreadShell", () => { session={session(chatId)} title={`Chat ${chatId}`} onToggleSidebar={() => {}} - onNewChat={() => {}} />, ); const { rerender } = render(view("chat-a")); @@ -2731,7 +2692,6 @@ describe("ThreadShell", () => { session={session("chat-fork")} title="Chat chat-fork" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -2808,7 +2768,6 @@ describe("ThreadShell", () => { session={session("resume-chat")} title="Resume chat" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -2861,7 +2820,7 @@ describe("ThreadShell", () => { })); render(wrap(client, {}} onNewChat={() => {}} + onToggleSidebar={() => {}} />)); await screen.findByText("question"); act(() => { @@ -2913,7 +2872,7 @@ describe("ThreadShell", () => { })); render(wrap(client, {}} onNewChat={() => {}} + onToggleSidebar={() => {}} />)); await screen.findByText("question"); act(() => { @@ -2989,7 +2948,6 @@ describe("ThreadShell", () => { session={session("mount-during-reconnect")} title="Mount during reconnect" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -3055,7 +3013,6 @@ describe("ThreadShell", () => { session={session("window-reset-chat")} title="Window reset" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -3119,7 +3076,6 @@ describe("ThreadShell", () => { session={session(chatId)} title={`Chat ${chatId}`} onToggleSidebar={() => {}} - onNewChat={() => {}} />, ); const { rerender } = render(view("lineage-chat-a")); @@ -3175,7 +3131,6 @@ describe("ThreadShell", () => { session={session("reset-tail-race")} title="Reset tail race" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -3237,7 +3192,6 @@ describe("ThreadShell", () => { session={session("empty-reset-chat")} title="Empty reset" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -3316,7 +3270,6 @@ describe("ThreadShell", () => { session={session("strict-canonical")} title="Strict canonical" onToggleSidebar={() => {}} - onNewChat={() => {}} /> , ), @@ -3383,7 +3336,7 @@ describe("ThreadShell", () => { return Promise.resolve(httpJson(completedBody(true))); })); render(wrap(client, {}} onNewChat={() => {}} />)); + onToggleSidebar={() => {}} />)); await screen.findByText("layout question"); act(() => { client._emitChat(chatId, { @@ -3473,7 +3426,6 @@ describe("ThreadShell", () => { session={session(chatId)} title={`Chat ${chatId}`} onToggleSidebar={() => {}} - onNewChat={() => {}} />, ); const { rerender } = render(view("chat-version-a")); @@ -3559,7 +3511,6 @@ describe("ThreadShell", () => { session={session("run-generation-chat")} title="Run generation chat" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -3623,7 +3574,7 @@ describe("ThreadShell", () => { })); render(wrap(client, {}} onNewChat={() => {}} + onToggleSidebar={() => {}} />)); await screen.findByText("guided question"); act(() => { @@ -3752,7 +3703,7 @@ describe("ThreadShell", () => { })); render(wrap(client, {}} onNewChat={() => {}} + onToggleSidebar={() => {}} />)); const completed = await screen.findByText("completed reply"); const older = screen.getByText("older paginated answer"); @@ -3817,7 +3768,7 @@ describe("ThreadShell", () => { })); render(wrap(client, {}} onNewChat={() => {}} + onToggleSidebar={() => {}} />)); await screen.findByText("completed last"); const messages = [ @@ -3859,7 +3810,6 @@ describe("ThreadShell", () => { session={session("initial-completion")} title="Initial completion" onToggleSidebar={() => {}} - onNewChat={() => {}} />)); await screen.findByText("previous question"); act(() => client._emitChat("initial-completion", { @@ -3912,7 +3862,6 @@ describe("ThreadShell", () => { session={session("late-frame-chat")} title="Late frame chat" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4003,7 +3952,6 @@ describe("ThreadShell", () => { session={session(chatId)} title={`Chat ${chatId}`} onToggleSidebar={() => {}} - onNewChat={() => {}} />, ); const { rerender } = render(view("visibility-complete-a")); @@ -4063,7 +4011,6 @@ describe("ThreadShell", () => { session={session("empty-answer")} title="Empty answer" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4123,7 +4070,7 @@ describe("ThreadShell", () => { render(wrap(client, {}} onNewChat={() => {}} + onToggleSidebar={() => {}} />)); await screen.findByText("previous answer"); @@ -4277,7 +4224,7 @@ describe("ThreadShell", () => { })); const { container } = render(wrap(client, {}} onNewChat={() => {}} + onToggleSidebar={() => {}} />)); await screen.findByText("current question"); act(() => client._emitChat(chatId, { @@ -4345,8 +4292,6 @@ describe("ThreadShell", () => { session={session("before-delta-chat")} title="Before delta chat" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />, ), ); @@ -4445,7 +4390,6 @@ describe("ThreadShell", () => { session={session("active-resume-chat")} title="Active resume chat" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4532,7 +4476,6 @@ describe("ThreadShell", () => { session={session("timing-chat")} title="Timing chat" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4618,7 +4561,6 @@ describe("ThreadShell", () => { session={session("visible-chat")} title="Visible chat" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4682,7 +4624,6 @@ describe("ThreadShell", () => { session={session("idle-visible-chat")} title="Idle visible chat" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4739,7 +4680,6 @@ describe("ThreadShell", () => { session={session("retry-visible-chat")} title="Retry visible chat" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4795,7 +4735,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4855,7 +4794,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -4906,7 +4844,6 @@ describe("ThreadShell", () => { session={session("token-media")} title="Token media" onToggleSidebar={() => {}} - onNewChat={() => {}} />, null, token, @@ -4960,7 +4897,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -5023,7 +4959,6 @@ describe("ThreadShell", () => { session={session("chat-follow")} title="Chat follow" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -5119,7 +5054,6 @@ describe("ThreadShell", () => { session={null} title="nanobot" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -5142,7 +5076,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -5188,7 +5121,6 @@ describe("ThreadShell", () => { session={null} title="nanobot" onToggleSidebar={() => {}} - onNewChat={() => {}} />, ), ); @@ -5210,7 +5142,6 @@ describe("ThreadShell", () => { it("surfaces a dismissible banner for an uncorrelated message_too_big error", async () => { const client = makeClient(); - const onNewChat = vi.fn().mockResolvedValue("chat-a"); render( wrap( @@ -5219,8 +5150,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -5256,8 +5185,6 @@ describe("ThreadShell", () => { session={session("chat-model-failure")} title="Chat model failure" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />, ), ); @@ -5347,8 +5274,6 @@ describe("ThreadShell", () => { session={session("chat-inline-error")} title="Chat inline error" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />, ), ); @@ -5385,7 +5310,6 @@ describe("ThreadShell", () => { it("clears the stream error banner when the user switches to another chat", async () => { const client = makeClient(); - const onNewChat = vi.fn().mockResolvedValue("chat-a"); const { rerender } = render( wrap( @@ -5394,8 +5318,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -5416,8 +5338,6 @@ describe("ThreadShell", () => { session={session("chat-b")} title="Chat chat-b" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -5430,7 +5350,6 @@ describe("ThreadShell", () => { it("clears the previous thread immediately while the next session loads", async () => { const client = makeClient(); - const onNewChat = vi.fn().mockResolvedValue("chat-b"); let resolveChatB: | ((value: { ok: boolean; status: number; json: () => Promise }) => void) | null = null; @@ -5465,8 +5384,6 @@ describe("ThreadShell", () => { session={session("chat-a")} title="Chat chat-a" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -5481,8 +5398,6 @@ describe("ThreadShell", () => { session={session("chat-b")} title="Chat chat-b" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={onNewChat} />, ), ); @@ -5556,8 +5471,6 @@ describe("ThreadShell", () => { session={session("lazy-mentions")} title="Lazy mentions" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />)); const input = await screen.findByLabelText("Message input"); const catalogCalls = () => vi.mocked(fetch).mock.calls.filter(([url]) => @@ -5580,8 +5493,6 @@ describe("ThreadShell", () => { session={session("retry-mentions")} title="Retry mentions" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />)); const input = await screen.findByLabelText("Message input"); const catalogCalls = () => vi.mocked(fetch).mock.calls.filter(([url]) => @@ -5605,8 +5516,6 @@ describe("ThreadShell", () => { session={session("chat-cli-apps")} title="Chat chat-cli-apps" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />, )); @@ -5665,8 +5574,6 @@ describe("ThreadShell", () => { session={session("chat-cli-race")} title="Chat chat-cli-race" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />, )); @@ -5745,8 +5652,6 @@ describe("ThreadShell", () => { session={session("chat-cli-refresh")} title="Chat chat-cli-refresh" onToggleSidebar={() => {}} - onGoHome={() => {}} - onNewChat={() => {}} />, )); diff --git a/webui/src/workers/imageEncode.worker.ts b/webui/src/workers/imageEncode.worker.ts index 8e2e1ca11..45c7f6ad9 100644 --- a/webui/src/workers/imageEncode.worker.ts +++ b/webui/src/workers/imageEncode.worker.ts @@ -8,7 +8,7 @@ * full decode/resize/re-encode cycle never blocks the UI thread. * * Output contract: - * ``{ok: true, dataUrl, mime, bytes, origBytes, normalized}`` on success, or + * ``{ok: true, dataUrl, bytes, normalized}`` on success, or * ``{ok: false, reason}`` for every recoverable failure — magic-bytes * mismatch, unsupported MIME, decode error, or a post-normalization payload * that *still* exceeds the budget (extreme aspect ratios). @@ -27,9 +27,7 @@ type EncodeSuccess = { id: string; ok: true; dataUrl: string; - mime: string; bytes: number; - origBytes: number; /** True iff the Worker re-encoded the image to hit the size budget. */ normalized: boolean; }; @@ -151,7 +149,7 @@ function computeScaledDims( async function normalize( file: File, sourceMime: string, -): Promise<{ dataUrl: string; mime: string; bytes: number } | { error: EncodeFailure["reason"] }> { +): Promise<{ dataUrl: string; bytes: number } | { error: EncodeFailure["reason"] }> { // Re-encode paths: JPEG/WebP → WebP q=0.85; PNG/GIF → PNG (keep crisp). const targetMime = NORMALIZE_LOSSY_MIMES.has(sourceMime) ? "image/webp" @@ -181,7 +179,7 @@ async function normalize( } const buf = await blob.arrayBuffer(); const dataUrl = `data:${targetMime};base64,${bufferToBase64(buf)}`; - return { dataUrl, mime: targetMime, bytes: blob.size }; + return { dataUrl, bytes: blob.size }; } catch { try { bitmap.close(); @@ -211,10 +209,6 @@ export async function encodeImageInWorker( if (!SUPPORTED_MIMES.has(sniffed)) { return { id, ok: false, reason: "invalid_mime" }; } - // Defend against MIME spoofing: the declared ``file.type`` can lie. - if (file.type && SUPPORTED_MIMES.has(file.type) && file.type !== sniffed) { - // Trust the magic bytes; proceed with the sniffed MIME. - } if (origBytes <= TARGET_MAX_BYTES) { const dataUrl = `data:${sniffed};base64,${bufferToBase64(buffer)}`; @@ -222,9 +216,7 @@ export async function encodeImageInWorker( id, ok: true, dataUrl, - mime: sniffed, bytes: origBytes, - origBytes, normalized: false, }; } @@ -237,9 +229,7 @@ export async function encodeImageInWorker( id, ok: true, dataUrl: result.dataUrl, - mime: result.mime, bytes: result.bytes, - origBytes, normalized: true, }; }