Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

release: v1.4.8

Bingxi Zhao (Frank)88c2565389dd
diff --git a/README.md b/README.md
index 01ce8301c..05e8517c4 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,8 @@
### 📦 Releases
+> **[2026.6.18]** [v1.4.8](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.8) — Connect your own **Partners** under **My Agents** and consult them live in chat (their persona, library and skills answer through their own loop), and every Partner gains a private memory via `partner_read` / `partner_memorize` / `partner_search`.
+
> **[2026.6.18]** [v1.4.7](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.7) — Connect your local **Claude Code / Codex** and consult it live mid-turn, **My Agents** graduates to a top-level `/agents`, and Partner conversations gain branch / resume / delete with a replayable trace.
> **[2026.6.17]** [v1.4.6](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.6) — Four-surface consolidation: a **Knowledge Center** with GraphRAG / PageIndex / LightRAG engines and linked-KB / Obsidian mounts, a Space learning dashboard with **My Agents** and top-level Memory, plus document parsing / voice / media settings.
diff --git a/assets/releases/ver1-4-8.md b/assets/releases/ver1-4-8.md
new file mode 100644
index 000000000..5b3bbc3c6
--- /dev/null
+++ b/assets/releases/ver1-4-8.md
@@ -0,0 +1,58 @@
+# DeepTutor v1.4.8 Release Notes
+
+**Release Date:** 2026.06.18
+
+A focused follow-up to [v1.4.7](ver1-4-7.md): the agents you connect under
+**My Agents** now include your own **Partners**, and every Partner gains a
+private memory of its own. Connect a partner beside your local Claude Code /
+Codex, select it in chat, and DeepTutor consults it live — its persona, library
+and skills answering through the partner's own loop. Drop-in — no migrations.
+
+> **A partner's memory now lives with the partner.** Previously a partner read
+> and wrote the *owner's* shared memory; now each partner keeps its **own**
+> long-term memory in its workspace, while still reading the owner's shared
+> memory as context. This is non-destructive — the owner's memory is untouched
+> and stays readable — it only changes where a partner's *new* memories land.
+> Nothing to do on upgrade.
+
+## What's New
+
+### Consult a Partner as a Connected Agent
+
+**My Agents** now lists your **Partners** next to a local Claude Code / Codex.
+Connect one and select it in the composer, and the turn runs on a single
+`consult_subagent` tool against that partner's own chat loop — its soul, library
+and skills — streaming its trace live in the sidebar. Every consult within one
+DeepTutor chat threads into a single partner session, archived in that partner's
+history and titled from your first question, and the connection wears the
+partner's own avatar.
+
+### Partners Get Their Own Memory
+
+A partner now has a **split** memory model, exposed through three always-on
+tools that replace chat's `read_memory` / `write_memory` on every partner turn:
+
+- `partner_read` — reads the owner's shared memory **and** the partner's own,
+ concatenated.
+- `partner_memorize` — writes only to the partner's own workspace; a partner can
+ never touch the owner's memory.
+- `partner_search` — keyword search over the partner's own conversation history.
+
+Because these are mandatory, the per-Partner `read_memory` / `write_memory`
+toggles are gone from Partner tool settings.
+
+### Reference a Partner Conversation as Context
+
+A partner conversation can now be pulled into a DeepTutor chat as a referenced
+transcript (admin-only), framed as a third party under the partner's own name —
+the same way imported agent histories are.
+
+## Upgrade Notes
+
+- Drop-in from v1.4.7: `pip install -U deeptutor`; Docker users pull
+ `ghcr.io/hkuds/deeptutor:latest`. No migrations.
+- The partner-memory change above is automatic and non-destructive: existing
+ partners keep reading the owner's shared memory and simply gain their own
+ writable store.
+
+**Full Changelog**: https://github.com/HKUDS/DeepTutor/compare/v1.4.7...v1.4.8
diff --git a/deeptutor/__version__.py b/deeptutor/__version__.py
index df94bee9c..49dc89b28 100644
--- a/deeptutor/__version__.py
+++ b/deeptutor/__version__.py
@@ -6,6 +6,6 @@ before publishing to PyPI; the web sidebar badge and CLI banner read from this
file directly.
"""
-__version__ = "1.4.7"
+__version__ = "1.4.8"
__all__ = ("__version__",)
diff --git a/deeptutor/agents/_shared/tool_composition.py b/deeptutor/agents/_shared/tool_composition.py
index 6f91f7230..ab863dc3c 100644
--- a/deeptutor/agents/_shared/tool_composition.py
+++ b/deeptutor/agents/_shared/tool_composition.py
@@ -170,9 +170,7 @@ def compose_enabled_tools(
return _finalize(composed, forced, suppressed)
-def _finalize(
- names: Iterable[str], forced: Iterable[str], suppressed: Iterable[str]
-) -> list[str]:
+def _finalize(names: Iterable[str], forced: Iterable[str], suppressed: Iterable[str]) -> list[str]:
"""Append ``forced`` (bypassing all gates), dedupe, then drop ``suppressed``."""
out = list(names)
out.extend(str(name) for name in forced if str(name).strip())
diff --git a/deeptutor/api/routers/subagents.py b/deeptutor/api/routers/subagents.py
index 23dbf5952..9f00377fb 100644
--- a/deeptutor/api/routers/subagents.py
+++ b/deeptutor/api/routers/subagents.py
@@ -141,7 +141,9 @@ async def create_connection(payload: ConnectSubagentRequest, auth=Depends(requir
await require_admin(auth)
partner_id = (payload.partner_id or "").strip()
if not partner_id:
- raise HTTPException(status_code=400, detail="A partner_id is required to connect a partner.")
+ raise HTTPException(
+ status_code=400, detail="A partner_id is required to connect a partner."
+ )
from deeptutor.services.partners import get_partner_manager
if not get_partner_manager().partner_exists(partner_id):
diff --git a/deeptutor/capabilities/subagent/tools.py b/deeptutor/capabilities/subagent/tools.py
index 9370f1c96..930a2a146 100644
--- a/deeptutor/capabilities/subagent/tools.py
+++ b/deeptutor/capabilities/subagent/tools.py
@@ -81,7 +81,9 @@ class ConsultSubagentTool(BaseTool):
)
question = str(kwargs.get("question") or "").strip()
if not question:
- return ToolResult(content="consult_subagent needs a non-empty 'question'.", success=False)
+ return ToolResult(
+ content="consult_subagent needs a non-empty 'question'.", success=False
+ )
state = spec["state"]
budget = int(spec["budget"])
@@ -100,15 +102,15 @@ class ConsultSubagentTool(BaseTool):
backend = get_backend(str(spec.get("kind") or ""))
if backend is None:
- return ToolResult(content=f"Unknown subagent backend: {spec.get('kind')!r}", success=False)
+ return ToolResult(
+ content=f"Unknown subagent backend: {spec.get('kind')!r}", success=False
+ )
state["count"] = int(state.get("count", 0)) + 1
consult_index = state["count"]
event_sink = kwargs.get("event_sink")
- async def _stream(
- channel: str, text: str, extra: dict[str, object] | None = None
- ) -> None:
+ async def _stream(channel: str, text: str, extra: dict[str, object] | None = None) -> None:
if event_sink is None or not text:
return
metadata: dict[str, object] = {
diff --git a/deeptutor/services/session/source_inventory.py b/deeptutor/services/session/source_inventory.py
index ae437e288..039a2ac69 100644
--- a/deeptutor/services/session/source_inventory.py
+++ b/deeptutor/services/session/source_inventory.py
@@ -730,7 +730,7 @@ def _load_partner_session(ref: str, *, language: str = "en") -> tuple[str, str]:
turn, so a non-admin must not be able to pull a partner's transcript by
hand-crafting a reference id. Returns ``("", "")`` on any miss.
"""
- rest = ref[len(_PARTNER_REF_PREFIX):]
+ rest = ref[len(_PARTNER_REF_PREFIX) :]
pid, _, session_key = rest.partition(":")
pid, session_key = pid.strip(), session_key.strip()
if not pid or not session_key:
diff --git a/deeptutor/services/subagent/claude_code.py b/deeptutor/services/subagent/claude_code.py
index d779ad3ce..c794533a6 100644
--- a/deeptutor/services/subagent/claude_code.py
+++ b/deeptutor/services/subagent/claude_code.py
@@ -131,9 +131,7 @@ class ClaudeCodeBackend(SubagentBackend):
partner_id: str | None = None, # noqa: ARG002 — partner-only; ignored here
) -> ConsultResult:
config = config or BackendConfig()
- cmd = self._build_command(
- question, session_id=session_id, config=config, images=images
- )
+ cmd = self._build_command(question, session_id=session_id, config=config, images=images)
result = ConsultResult(session_id=session_id)
assistant_text: list[str] = []
# Token-streaming accumulator: per content-block running text, keyed by the
@@ -245,9 +243,7 @@ class ClaudeCodeBackend(SubagentBackend):
# Unknown event type — keep it visible as a log rather than dropping it.
await emit(EVENT_LOG, _compact(event), event)
- async def _handle_stream_event(
- self, inner: Any, stream: dict[str, Any], emit: Any
- ) -> None:
+ async def _handle_stream_event(self, inner: Any, stream: dict[str, Any], emit: Any) -> None:
"""Accumulate a partial Anthropic streaming event into a growing row.
``stream_event`` wraps a raw Messages-API event. We track the message id
@@ -282,7 +278,9 @@ class ClaudeCodeBackend(SubagentBackend):
elif dtype == "thinking_delta":
acc = stream["blocks"].get(idx, "") + str(delta.get("thinking") or "")
stream["blocks"][idx] = acc
- await emit(EVENT_REASONING, acc.strip(), inner, _merge("rsn", stream.get("msg_id"), idx))
+ await emit(
+ EVENT_REASONING, acc.strip(), inner, _merge("rsn", stream.get("msg_id"), idx)
+ )
def _message_id(obj: dict[str, Any]) -> str:
diff --git a/deeptutor/services/subagent/claude_models.py b/deeptutor/services/subagent/claude_models.py
index 111b55e16..6a10eca79 100644
--- a/deeptutor/services/subagent/claude_models.py
+++ b/deeptutor/services/subagent/claude_models.py
@@ -164,7 +164,7 @@ def _capture_model_screen() -> str | None:
os.environ["LINES"] = str(_ROWS)
try:
os.chdir(workdir)
- os.execvp("claude", ["claude"])
+ os.execvp("claude", ["claude"]) # nosec B606 B607 — PATH-resolved CLI in a forked PTY child, no shell
except Exception:
os._exit(127)
@@ -191,8 +191,10 @@ def _capture_model_screen() -> str | None:
time.sleep(1.3)
continue
# 2) Once the composer is ready, open the model picker.
- if trusted and not opened and (
- "forshortcuts" in packed or "tryedit" in packed or 'try"' in packed
+ if (
+ trusted
+ and not opened
+ and ("forshortcuts" in packed or "tryedit" in packed or 'try"' in packed)
):
os.write(fd, b"/model")
time.sleep(0.5)
diff --git a/deeptutor/services/subagent/codex.py b/deeptutor/services/subagent/codex.py
index dd6c64875..086e65021 100644
--- a/deeptutor/services/subagent/codex.py
+++ b/deeptutor/services/subagent/codex.py
@@ -125,9 +125,7 @@ class CodexBackend(SubagentBackend):
partner_id: str | None = None, # noqa: ARG002 — partner-only; ignored here
) -> ConsultResult:
config = config or BackendConfig()
- cmd = self._build_command(
- question, session_id=session_id, config=config, images=images
- )
+ cmd = self._build_command(question, session_id=session_id, config=config, images=images)
result = ConsultResult(session_id=session_id)
async def emit(
@@ -219,7 +217,10 @@ class CodexBackend(SubagentBackend):
await emit(EVENT_LOG, _compact(event), event)
def _handle_item(self, item: dict[str, Any], etype: str, result: ConsultResult) -> None:
- if etype.endswith(".completed") and _item_type(item) in ("agent_message", "assistant_message"):
+ if etype.endswith(".completed") and _item_type(item) in (
+ "agent_message",
+ "assistant_message",
+ ):
text = _item_text(item)
if text:
result.final_text = text
@@ -275,7 +276,9 @@ def _render_item(item: dict[str, Any], etype: str) -> tuple[str, str]:
return EVENT_TOOL, _truncate(f"file change · {_compact(changes)}")
if itype in ("mcp_tool_call", "tool_call"):
name = str(item.get("name") or item.get("tool") or "tool")
- return EVENT_TOOL, _truncate(f"{name} · {_compact(item.get('arguments') or item.get('input') or {})}")
+ return EVENT_TOOL, _truncate(
+ f"{name} · {_compact(item.get('arguments') or item.get('input') or {})}"
+ )
if itype == "web_search":
query = str(item.get("query") or item.get("action") or "").strip()
# Start (or no query yet) → placeholder; completion → fill in the query.
diff --git a/deeptutor/services/subagent/models.py b/deeptutor/services/subagent/models.py
index f311af438..4f2b23b89 100644
--- a/deeptutor/services/subagent/models.py
+++ b/deeptutor/services/subagent/models.py
@@ -135,7 +135,9 @@ async def _claude_options() -> BackendOptions:
async def _codex_options() -> BackendOptions:
backend = get_backend("codex")
- ok, version = await probe_version([backend.cli_command, "--version"]) if backend else (False, "")
+ ok, version = (
+ await probe_version([backend.cli_command, "--version"]) if backend else (False, "")
+ )
models: list[ModelOption] = []
synced_at = ""
cache = _codex_home() / "models_cache.json"
diff --git a/deeptutor/services/subagent/partner.py b/deeptutor/services/subagent/partner.py
index c3d906443..3c0aa5bd1 100644
--- a/deeptutor/services/subagent/partner.py
+++ b/deeptutor/services/subagent/partner.py
@@ -113,10 +113,10 @@ class PartnerBackend(SubagentBackend):
# adjacent. We hold each call (keyed by its call_id, shared with its
# result) and emit it back-to-back with its result, so the trace reads
# as call → result pairs.
- state = {
- "text": {}, # type: dict[str, str]
- "reason": {}, # type: dict[str, str]
- "pending_tools": {}, # type: dict[str, str]
+ state: dict[str, dict[str, str]] = {
+ "text": {},
+ "reason": {},
+ "pending_tools": {},
}
async def relay(event: "StreamEvent") -> None:
diff --git a/deeptutor/services/subagent/registry.py b/deeptutor/services/subagent/registry.py
index d00786662..3640c7ea0 100644
--- a/deeptutor/services/subagent/registry.py
+++ b/deeptutor/services/subagent/registry.py
@@ -18,8 +18,7 @@ from deeptutor.services.subagent.partner import PartnerBackend
from deeptutor.services.subagent.types import DetectResult
_BACKENDS: dict[str, SubagentBackend] = {
- backend.kind: backend
- for backend in (ClaudeCodeBackend(), CodexBackend(), PartnerBackend())
+ backend.kind: backend for backend in (ClaudeCodeBackend(), CodexBackend(), PartnerBackend())
}
diff --git a/deeptutor/tools/partner_memory.py b/deeptutor/tools/partner_memory.py
index 18a37d6c5..3a52f18f6 100644
--- a/deeptutor/tools/partner_memory.py
+++ b/deeptutor/tools/partner_memory.py
@@ -114,8 +114,7 @@ class PartnerReadTool(BaseTool):
own = _concat_l3()
sections = [
- "## Shared memory (the owner's — read-only)\n\n"
- + (shared or "(none yet)"),
+ "## Shared memory (the owner's — read-only)\n\n" + (shared or "(none yet)"),
"## Your own memory\n\n" + (own or "(none yet — use partner_memorize to add)"),
]
text = "\n\n".join(sections)
diff --git a/tests/api/test_subagents_router.py b/tests/api/test_subagents_router.py
index 4fdf8e5c3..b41b5a266 100644
--- a/tests/api/test_subagents_router.py
+++ b/tests/api/test_subagents_router.py
@@ -237,9 +237,7 @@ def test_message_connection_streams_and_persists(client, monkeypatch, tmp_path):
await on_event(SubagentEvent(kind="text", text="hi", meta={"merge_id": "txt:m:0"}))
return ConsultResult(final_text="hi", session_id="sess-9", success=True, event_count=1)
- monkeypatch.setattr(
- "deeptutor.services.subagent.get_backend", lambda kind: _FakeBackend()
- )
+ monkeypatch.setattr("deeptutor.services.subagent.get_backend", lambda kind: _FakeBackend())
res = client.post(
"/api/v1/subagents/connections/MyClaude/message",
diff --git a/tests/capabilities/test_subagent_capability.py b/tests/capabilities/test_subagent_capability.py
index eb353fbd1..cfb5c202e 100644
--- a/tests/capabilities/test_subagent_capability.py
+++ b/tests/capabilities/test_subagent_capability.py
@@ -81,7 +81,9 @@ def test_consult_budget_override_from_config(monkeypatch) -> None:
knowledge_bases=["myagent"],
config_overrides={"subagent_consult_budget": 3},
)
- assert cap.augment_kwargs("consult_subagent", {"question": "q"}, ctx)["_subagent"]["budget"] == 3
+ assert (
+ cap.augment_kwargs("consult_subagent", {"question": "q"}, ctx)["_subagent"]["budget"] == 3
+ )
# Out-of-range values are clamped, not trusted.
ctx_hi = UnifiedContext(
user_message="hi",
diff --git a/tests/services/partners/test_partner_memory_tools.py b/tests/services/partners/test_partner_memory_tools.py
index 90c3962e9..47b20fb1b 100644
--- a/tests/services/partners/test_partner_memory_tools.py
+++ b/tests/services/partners/test_partner_memory_tools.py
@@ -47,9 +47,7 @@ def _write_owner_preference(text: str) -> None:
def test_memorize_writes_own_not_owner(partners_root: Path) -> None:
with user_context(partner_user(PID, name="Alice")):
- result = _run(
- PartnerMemorizeTool().execute(op="add", text="prefers terse answers")
- )
+ result = _run(PartnerMemorizeTool().execute(op="add", text="prefers terse answers"))
assert result.success, result.content
own_pref = get_partner_workspace(PID) / "memory" / "L3" / "preferences.md"
diff --git a/tests/services/test_subagent_backends.py b/tests/services/test_subagent_backends.py
index 1604b016e..8d5b1ae0d 100644
--- a/tests/services/test_subagent_backends.py
+++ b/tests/services/test_subagent_backends.py
@@ -208,20 +208,32 @@ async def test_claude_partial_messages_stream_cumulative_text() -> None:
{"type": "stream_event", "event": {"type": "message_start", "message": {"id": "msg_1"}}},
{
"type": "stream_event",
- "event": {"type": "content_block_start", "index": 0,
- "content_block": {"type": "text", "text": ""}},
+ "event": {
+ "type": "content_block_start",
+ "index": 0,
+ "content_block": {"type": "text", "text": ""},
+ },
},
{
"type": "stream_event",
- "event": {"type": "content_block_delta", "index": 0,
- "delta": {"type": "text_delta", "text": "Hel"}},
+ "event": {
+ "type": "content_block_delta",
+ "index": 0,
+ "delta": {"type": "text_delta", "text": "Hel"},
+ },
},
{
"type": "stream_event",
- "event": {"type": "content_block_delta", "index": 0,
- "delta": {"type": "text_delta", "text": "lo"}},
+ "event": {
+ "type": "content_block_delta",
+ "index": 0,
+ "delta": {"type": "text_delta", "text": "lo"},
+ },
+ },
+ {
+ "type": "assistant",
+ "message": {"id": "msg_1", "content": [{"type": "text", "text": "Hello"}]},
},
- {"type": "assistant", "message": {"id": "msg_1", "content": [{"type": "text", "text": "Hello"}]}},
]
for ev in events:
await backend._handle_event(ev, result, assistant_text, stream, emit)
@@ -258,7 +270,12 @@ async def test_codex_event_parsing_thread_items_and_final() -> None:
{"type": "item.started", "item": {"type": "command_execution", "command": "ls"}},
{
"type": "item.completed",
- "item": {"type": "command_execution", "command": "ls", "exit_code": 0, "output": "a\nb"},
+ "item": {
+ "type": "command_execution",
+ "command": "ls",
+ "exit_code": 0,
+ "output": "a\nb",
+ },
},
{"type": "item.completed", "item": {"type": "agent_message", "text": "All done."}},
{"type": "turn.completed", "usage": {}},
@@ -323,8 +340,14 @@ async def test_codex_item_updated_streams_cumulative_answer() -> None:
events = [
{"type": "item.started", "item": {"id": "m1", "type": "agent_message", "text": ""}},
{"type": "item.updated", "item": {"id": "m1", "type": "agent_message", "text": "The ans"}},
- {"type": "item.updated", "item": {"id": "m1", "type": "agent_message", "text": "The answer"}},
- {"type": "item.completed", "item": {"id": "m1", "type": "agent_message", "text": "The answer is 42"}},
+ {
+ "type": "item.updated",
+ "item": {"id": "m1", "type": "agent_message", "text": "The answer"},
+ },
+ {
+ "type": "item.completed",
+ "item": {"id": "m1", "type": "agent_message", "text": "The answer is 42"},
+ },
]
for ev in events:
await backend._handle_event(ev, result, emit)
@@ -341,9 +364,7 @@ async def test_codex_item_updated_streams_cumulative_answer() -> None:
@pytest.mark.asyncio
async def test_codex_turn_failed_marks_error() -> None:
backend = CodexBackend()
- result, emitted = await _drive(
- backend, [{"type": "turn.failed", "message": "boom"}]
- )
+ result, emitted = await _drive(backend, [{"type": "turn.failed", "message": "boom"}])
assert result.success is False and result.error == "boom"
assert ("error", "boom") in emitted
@@ -405,7 +426,9 @@ def test_materialize_images_writes_only_resolvable_images(tmp_path) -> None:
from deeptutor.services.subagent.images import materialize_images
atts = [
- Attachment(type="image", base64=_b64.b64encode(b"\x89PNGdata").decode(), mime_type="image/png"),
+ Attachment(
+ type="image", base64=_b64.b64encode(b"\x89PNGdata").decode(), mime_type="image/png"
+ ),
Attachment(
type="image",
base64="data:image/jpeg;base64," + _b64.b64encode(b"JPEGdata").decode(),
@@ -627,7 +650,9 @@ class _FakePartnerInstance:
class _FakePartnerManager:
"""Stands in for the partner manager: records calls, scripts a reply/trace."""
- def __init__(self, *, exists: bool = True, running: bool = True, reply: str = "Hi from partner.") -> None:
+ def __init__(
+ self, *, exists: bool = True, running: bool = True, reply: str = "Hi from partner."
+ ) -> None:
self._exists = exists
self._running = running
self._reply = reply
@@ -674,8 +699,14 @@ async def test_partner_consult_mints_session_key_and_returns_reply(monkeypatch)
manager.script_trace(
[
StreamEvent(type=StreamEventType.THINKING, content="thinking…"),
- StreamEvent(type=StreamEventType.TOOL_CALL, content="web_search", metadata={"call_id": "c1", "args": {"q": "x"}}),
- StreamEvent(type=StreamEventType.CONTENT, content="The answer.", metadata={"call_id": "c2"}),
+ StreamEvent(
+ type=StreamEventType.TOOL_CALL,
+ content="web_search",
+ metadata={"call_id": "c1", "args": {"q": "x"}},
+ ),
+ StreamEvent(
+ type=StreamEventType.CONTENT, content="The answer.", metadata={"call_id": "c2"}
+ ),
StreamEvent(type=StreamEventType.DONE), # bookkeeping → dropped
]
)
diff --git a/web/components/agents/ConnectedAgents.tsx b/web/components/agents/ConnectedAgents.tsx
index 332998c3d..bdbe40850 100644
--- a/web/components/agents/ConnectedAgents.tsx
+++ b/web/components/agents/ConnectedAgents.tsx
@@ -156,54 +156,58 @@ export default function ConnectedAgents() {
? partners.find((p) => p.partner_id === conn.partner_id)
: undefined;
return (
- <div
- key={conn.name}
- className="group flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--card)] px-4 py-3"
- >
- {partner ? (
- <PartnerAvatar
- name={partner.name}
- emoji={partner.emoji}
- color={partner.color}
- image={partner.avatar}
- size={40}
- className="shrink-0"
- />
- ) : (
- <span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-[var(--border)]/60 bg-[var(--background)] text-[var(--foreground)]">
- {Glyph ? <Glyph size={20} /> : <Cpu size={18} strokeWidth={1.6} />}
- </span>
- )}
- <div className="min-w-0 flex-1">
- <div className="truncate text-[13.5px] font-semibold tracking-tight text-[var(--foreground)]">
- {conn.name}
- </div>
- <div className="mt-0.5 truncate text-[11.5px] text-[var(--muted-foreground)]">
- {backendLabel(conn.agent_kind, tr)}
- {conn.agent_kind === PARTNER_KIND
- ? conn.partner_id
- ? ` · ${partnerName(conn.partner_id)}`
- : ""
- : conn.cwd
- ? ` · ${conn.cwd}`
- : ""}
- </div>
- </div>
- <button
- type="button"
- onClick={() => void handleDisconnect(conn.name)}
- disabled={busyName === conn.name}
- title={tr({ zh: "断开", en: "Disconnect" })}
- aria-label={tr({ zh: "断开", en: "Disconnect" })}
- className="rounded-lg border border-[var(--border)]/50 p-2 text-[var(--muted-foreground)] transition-colors hover:border-red-300 hover:text-red-600 disabled:opacity-50 dark:hover:border-red-900 dark:hover:text-red-400"
+ <div
+ key={conn.name}
+ className="group flex items-center gap-3 rounded-2xl border border-[var(--border)] bg-[var(--card)] px-4 py-3"
>
- {busyName === conn.name ? (
- <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ {partner ? (
+ <PartnerAvatar
+ name={partner.name}
+ emoji={partner.emoji}
+ color={partner.color}
+ image={partner.avatar}
+ size={40}
+ className="shrink-0"
+ />
) : (
- <Trash2 className="h-3.5 w-3.5" />
+ <span className="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border border-[var(--border)]/60 bg-[var(--background)] text-[var(--foreground)]">
+ {Glyph ? (
+ <Glyph size={20} />
+ ) : (
+ <Cpu size={18} strokeWidth={1.6} />
+ )}
+ </span>
)}
- </button>
- </div>
+ <div className="min-w-0 flex-1">
+ <div className="truncate text-[13.5px] font-semibold tracking-tight text-[var(--foreground)]">
+ {conn.name}
+ </div>
+ <div className="mt-0.5 truncate text-[11.5px] text-[var(--muted-foreground)]">
+ {backendLabel(conn.agent_kind, tr)}
+ {conn.agent_kind === PARTNER_KIND
+ ? conn.partner_id
+ ? ` · ${partnerName(conn.partner_id)}`
+ : ""
+ : conn.cwd
+ ? ` · ${conn.cwd}`
+ : ""}
+ </div>
+ </div>
+ <button
+ type="button"
+ onClick={() => void handleDisconnect(conn.name)}
+ disabled={busyName === conn.name}
+ title={tr({ zh: "断开", en: "Disconnect" })}
+ aria-label={tr({ zh: "断开", en: "Disconnect" })}
+ className="rounded-lg border border-[var(--border)]/50 p-2 text-[var(--muted-foreground)] transition-colors hover:border-red-300 hover:text-red-600 disabled:opacity-50 dark:hover:border-red-900 dark:hover:text-red-400"
+ >
+ {busyName === conn.name ? (
+ <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ ) : (
+ <Trash2 className="h-3.5 w-3.5" />
+ )}
+ </button>
+ </div>
);
})}
</div>
@@ -277,7 +281,12 @@ function ConnectModal({
return;
}
if (existingNames.includes(trimmed)) {
- setError(tr({ zh: "已存在同名连接。", en: "A connection with this name already exists." }));
+ setError(
+ tr({
+ zh: "已存在同名连接。",
+ en: "A connection with this name already exists.",
+ }),
+ );
return;
}
if (isPartner && !partnerId) {
@@ -382,7 +391,10 @@ function ConnectModal({
setName(e.target.value);
setNameTouched(true);
}}
- placeholder={tr({ zh: "例如:我的代码助手", en: "e.g. My coding agent" })}
+ placeholder={tr({
+ zh: "例如:我的代码助手",
+ en: "e.g. My coding agent",
+ })}
className="w-full rounded-lg border border-[var(--border)] bg-[var(--background)] px-3 py-2 text-[13px] text-[var(--foreground)] outline-none focus:border-[var(--ring)]"
/>
</div>
@@ -390,7 +402,10 @@ function ConnectModal({
{!isPartner && (
<div>
<label className="mb-1.5 block text-[12px] font-medium text-[var(--foreground)]">
- {tr({ zh: "工作目录(可选)", en: "Working directory (optional)" })}
+ {tr({
+ zh: "工作目录(可选)",
+ en: "Working directory (optional)",
+ })}
</label>
<input
value={cwd}
@@ -414,7 +429,9 @@ function ConnectModal({
)}
{error && (
- <p className="text-[12px] text-red-600 dark:text-red-400">{error}</p>
+ <p className="text-[12px] text-red-600 dark:text-red-400">
+ {error}
+ </p>
)}
</div>
diff --git a/web/components/agents/agent-icons.tsx b/web/components/agents/agent-icons.tsx
index d3819e428..82b45f523 100644
--- a/web/components/agents/agent-icons.tsx
+++ b/web/components/agents/agent-icons.tsx
@@ -11,7 +11,10 @@ import { type ComponentType, type SVGProps, useId } from "react";
* and callers fall back to a generic icon.
*/
-type GlyphProps = { size?: number } & Omit<SVGProps<SVGSVGElement>, "width" | "height">;
+type GlyphProps = { size?: number } & Omit<
+ SVGProps<SVGSVGElement>,
+ "width" | "height"
+>;
// Claude / Anthropic sunburst, in the brand clay.
export function ClaudeGlyph({ size = 16, ...props }: GlyphProps) {
diff --git a/web/components/chat/MyAgentsPicker.tsx b/web/components/chat/MyAgentsPicker.tsx
index 7dbddf5f8..c340a2fa5 100644
--- a/web/components/chat/MyAgentsPicker.tsx
+++ b/web/components/chat/MyAgentsPicker.tsx
@@ -285,7 +285,8 @@ export default function MyAgentsPicker({
// source buckets.
const chips = useMemo(() => {
const counts = new Map<string, number>();
- for (const row of rows) counts.set(row.ownerKey, (counts.get(row.ownerKey) ?? 0) + 1);
+ for (const row of rows)
+ counts.set(row.ownerKey, (counts.get(row.ownerKey) ?? 0) + 1);
const importAgents = [...agents]
.sort(
(a, b) => (b.lastSyncAt || b.createdAt) - (a.lastSyncAt || a.createdAt),
@@ -386,7 +387,9 @@ export default function MyAgentsPicker({
content: String(m.content || ""),
}));
setPreview((cur) =>
- cur && cur.row.id === row.id ? { ...cur, messages, loading: false } : cur,
+ cur && cur.row.id === row.id
+ ? { ...cur, messages, loading: false }
+ : cur,
);
} catch {
setPreview((cur) =>
@@ -572,7 +575,9 @@ export default function MyAgentsPicker({
{row.lastMessage ? (
<p className="mt-1 line-clamp-2 text-[12px] leading-5 text-[var(--muted-foreground)]">
{truncateText(
- normalizeMessageContent(row.lastMessage),
+ normalizeMessageContent(
+ row.lastMessage,
+ ),
200,
)}
</p>
diff --git a/web/components/chat/home/AgentSelector.tsx b/web/components/chat/home/AgentSelector.tsx
index bcd885a40..5164dbe46 100644
--- a/web/components/chat/home/AgentSelector.tsx
+++ b/web/components/chat/home/AgentSelector.tsx
@@ -87,7 +87,9 @@ export default function AgentSelector({
)}
<span
className={`flex min-w-0 items-center gap-1 overflow-hidden whitespace-nowrap transition-[max-width,opacity,margin-left] duration-300 ease-out ${
- expanded ? "ml-1.5 max-w-[160px] opacity-100" : "ml-0 max-w-0 opacity-0"
+ expanded
+ ? "ml-1.5 max-w-[160px] opacity-100"
+ : "ml-0 max-w-0 opacity-0"
}`}
>
<span className="min-w-0 truncate">{label}</span>
@@ -115,7 +117,9 @@ export default function AgentSelector({
setOpen(false);
}}
className={`flex w-full items-center gap-2.5 px-3 py-1.5 text-left transition-colors active:bg-[var(--muted)]/70 ${
- active ? "bg-[var(--primary)]/[0.06]" : "hover:bg-[var(--muted)]/45"
+ active
+ ? "bg-[var(--primary)]/[0.06]"
+ : "hover:bg-[var(--muted)]/45"
}`}
>
<RowGlyph size={15} className="shrink-0" />
@@ -123,7 +127,11 @@ export default function AgentSelector({
{agent.name}
</span>
{active && (
- <Check size={14} strokeWidth={2} className="shrink-0 text-[var(--primary)]" />
+ <Check
+ size={14}
+ strokeWidth={2}
+ className="shrink-0 text-[var(--primary)]"
+ />
)}
</button>
);
@@ -141,7 +149,9 @@ export default function AgentSelector({
aria-label={t("Fewer rounds")}
disabled={(budget ?? BUDGET_MIN) <= BUDGET_MIN}
onClick={() =>
- onBudgetChange(Math.max(BUDGET_MIN, (budget ?? BUDGET_MIN) - 1))
+ onBudgetChange(
+ Math.max(BUDGET_MIN, (budget ?? BUDGET_MIN) - 1),
+ )
}
className="flex h-5 w-5 items-center justify-center rounded-md text-[var(--muted-foreground)] transition-colors hover:bg-[var(--muted)]/60 hover:text-[var(--foreground)] disabled:opacity-40"
>
@@ -155,7 +165,9 @@ export default function AgentSelector({
aria-label={t("More rounds")}
disabled={(budget ?? BUDGET_MAX) >= BUDGET_MAX}
onClick={() =>
- onBudgetChange(Math.min(BUDGET_MAX, (budget ?? BUDGET_MIN) + 1))
+ onBudgetChange(
+ Math.min(BUDGET_MAX, (budget ?? BUDGET_MIN) + 1),
+ )
}
className="flex h-5 w-5 items-center justify-center rounded-md text-[var(--muted-foreground)] transition-colors hover:bg-[var(--muted)]/60 hover:text-[var(--foreground)] disabled:opacity-40"
>
diff --git a/web/components/chat/home/SubagentRunTranscript.tsx b/web/components/chat/home/SubagentRunTranscript.tsx
index f7a7f32f5..9088b861c 100644
--- a/web/components/chat/home/SubagentRunTranscript.tsx
+++ b/web/components/chat/home/SubagentRunTranscript.tsx
@@ -84,7 +84,9 @@ function BulletLine({
}) {
return (
<div className="flex gap-2 leading-[1.65] text-[var(--foreground)]">
- <span className={`mt-[3px] shrink-0 text-[10px] leading-[1.5] ${bulletClass}`}>
+ <span
+ className={`mt-[3px] shrink-0 text-[10px] leading-[1.5] ${bulletClass}`}
+ >
●
</span>
<span className="min-w-0 flex-1 whitespace-pre-wrap break-words">
@@ -113,7 +115,11 @@ function SubagentLine({ channel, text }: { channel: string; text: string }) {
);
case "text":
case "result":
- return <BulletLine bulletClass="text-[var(--foreground)]/70">{text}</BulletLine>;
+ return (
+ <BulletLine bulletClass="text-[var(--foreground)]/70">
+ {text}
+ </BulletLine>
+ );
case "tool":
return (
<BulletLine bulletClass="text-amber-500">
@@ -149,7 +155,8 @@ function ToolResultBlock({ text }: { text: string }) {
const [open, setOpen] = useState(false);
const lines = text.split("\n");
const overflow = lines.length > RESULT_PREVIEW_LINES;
- const shown = open || !overflow ? lines : lines.slice(0, RESULT_PREVIEW_LINES);
+ const shown =
+ open || !overflow ? lines : lines.slice(0, RESULT_PREVIEW_LINES);
const hidden = lines.length - RESULT_PREVIEW_LINES;
return (
<div className="ml-4 rounded-md border border-[var(--border)]/60 bg-[var(--muted)]/50 px-2.5 py-1.5">
diff --git a/web/components/settings/SubagentSettingsEditor.tsx b/web/components/settings/SubagentSettingsEditor.tsx
index 928503812..17d934edc 100644
--- a/web/components/settings/SubagentSettingsEditor.tsx
+++ b/web/components/settings/SubagentSettingsEditor.tsx
@@ -57,24 +57,51 @@ const DEFAULTS: Required<
};
const PERMISSION_MODES: { value: string; label: Lang }[] = [
- { value: "bypassPermissions", label: { zh: "绕过权限 · 全自主(推荐)", en: "Bypass permissions · autonomous (recommended)" } },
- { value: "acceptEdits", label: { zh: "自动接受编辑", en: "Accept edits automatically" } },
- { value: "default", label: { zh: "默认 · 可能等待确认", en: "Default · may wait for prompts" } },
- { value: "plan", label: { zh: "计划模式 · 只读", en: "Plan mode · read-only" } },
+ {
+ value: "bypassPermissions",
+ label: {
+ zh: "绕过权限 · 全自主(推荐)",
+ en: "Bypass permissions · autonomous (recommended)",
+ },
+ },
+ {
+ value: "acceptEdits",
+ label: { zh: "自动接受编辑", en: "Accept edits automatically" },
+ },
+ {
+ value: "default",
+ label: { zh: "默认 · 可能等待确认", en: "Default · may wait for prompts" },
+ },
+ {
+ value: "plan",
+ label: { zh: "计划模式 · 只读", en: "Plan mode · read-only" },
+ },
];
const SANDBOXES: { value: string; label: Lang }[] = [
{ value: "read-only", label: { zh: "只读", en: "Read-only" } },
- { value: "workspace-write", label: { zh: "工作目录可写(推荐)", en: "Workspace write (recommended)" } },
+ {
+ value: "workspace-write",
+ label: { zh: "工作目录可写(推荐)", en: "Workspace write (recommended)" },
+ },
{ value: "danger-full-access", label: { zh: "完全访问", en: "Full access" } },
- { value: "bypass", label: { zh: "绕过沙箱与审批", en: "Bypass sandbox & approvals" } },
+ {
+ value: "bypass",
+ label: { zh: "绕过沙箱与审批", en: "Bypass sandbox & approvals" },
+ },
];
const APPROVALS: { value: string; label: Lang }[] = [
- { value: "never", label: { zh: "从不询问(推荐)", en: "Never ask (recommended)" } },
+ {
+ value: "never",
+ label: { zh: "从不询问(推荐)", en: "Never ask (recommended)" },
+ },
{ value: "on-failure", label: { zh: "失败时询问", en: "On failure" } },
{ value: "on-request", label: { zh: "按需询问", en: "On request" } },
- { value: "untrusted", label: { zh: "不可信命令时询问", en: "Untrusted commands" } },
+ {
+ value: "untrusted",
+ label: { zh: "不可信命令时询问", en: "Untrusted commands" },
+ },
];
export function SubagentSettingsEditor({ kind }: { kind: string }) {
@@ -191,7 +218,8 @@ export function SubagentSettingsEditor({ kind }: { kind: string }) {
[options, isCodex, config.effort, save],
);
- const displayName = options?.display_name ?? (isCodex ? "Codex" : "Claude Code");
+ const displayName =
+ options?.display_name ?? (isCodex ? "Codex" : "Claude Code");
return (
<div>
@@ -233,7 +261,10 @@ export function SubagentSettingsEditor({ kind }: { kind: string }) {
options.available
? options.version
: options.detail ||
- tr({ zh: "未在 PATH 上找到该 CLI。", en: "CLI not found on PATH." })
+ tr({
+ zh: "未在 PATH 上找到该 CLI。",
+ en: "CLI not found on PATH.",
+ })
}
control={
<span
@@ -341,7 +372,9 @@ export function SubagentSettingsEditor({ kind }: { kind: string }) {
onChange={(e) =>
setConfig((p) => ({ ...p, model: e.target.value }))
}
- onBlur={(e) => void save({ model: e.target.value.trim() })}
+ onBlur={(e) =>
+ void save({ model: e.target.value.trim() })
+ }
/>
)}
</div>