Skip to content

Add DSH Agent to the Android plus menu - #1924

Merged
Fei2411 merged 12 commits into
devfrom
feat/1415-mobile-add-dsh-agent
Nov 21, 2026
Merged

Fei2411 merged 12 commits into
devfrom
feat/1415-mobile-add-dsh-agent

Conversation

@Fei2411

@Fei2411 Fei2411 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Issue

Fixes #1415

What changed / 改了什么

The browser's new-chat menu offers Add DSH Agent while the team has no DSH Agent. The Android app had no DSH Agent support at all.

  • Host: new read-only agent-chat endpoint. It pages the DSH Agent's newest plain DSH Session through partPage; an Agent whose Sessions are all archived gets an empty page. Also adds agentById on the runtime and the agents capability in the mobile API list. image, file-download and markdown-image accept DSH Agent Sessions, and the link refuses them to paired browsers, which cannot open Agent chats.
  • Host, running state and Stop: the browser shows a running DSH Agent Session and stops it from its view. session/event now records turn/start / turn/end for Agent Sessions (it used to drop every plain-Session event), state.work.agents names each Agent with a running turn, and new phone-only stop-agent cancels it. An Agent Session's agent/status nudges the live feed, as a Bot's does, so the phone shows Stop at once.
  • Android: the drawer "+" sheet shows Add DSH Agent (FishLogo, 添加 DSH Agent) only when the host lists agents and team.agents is empty, the same rule as new-chat.js. It calls add-agent and opens the new Agent's chat, and the team list shows a DSH Agent row. The chat loads via agent-chat and drops older pages when the newest Session changes. It sends with the existing send; an Agent without a Session gets one via agent-session, shared by quick sends. The composer shows Stop while the Agent runs, and Stop calls stop-agent.
  • TeamState.agents, work.agents and ChatTarget kind agent. Demo mode supports add-agent, agent-chat and stop-agent, and exposes its hello capabilities. After a send, the demo Agent runs until stopped, then replies with a photo and a file.
  • The FishLogo path is DSH's official mark from @deepseek-ai/dsh-client-ui-primitives, listed in NOTICE (hard rule 3).

Changelog

The Android app's "+" menu can add the DSH Agent and open its chat, like the browser, including Stop while it runs.

How I checked it / 怎么验证的

  • npm test (in ds-bot/): 3510 pass, with new tests for agent-chat (including all Sessions archived), Agent media on the phone, browser refusal of Agent media, and an Agent turn in state.work.agents / stop-agent, and the live-feed nudge for an Agent Session
  • node scripts/build-client.mjs --check
  • npm run lint
  • Smoke test, for changes to index.js or src/host/: not run, because the test machine has no deepseek-harness checkout
  • Screenshot attached, for interface changes: Android emulator (API 35), demo-mode debug build of f4ea092c. Later commits change only the host.

mobile/: npm run typecheck and npm test pass (109 tests, including a new activeChatTarget agent case).

"+" menu Agent chat Sent message Drawer row "+" after
plus menu agent chat message drawer row plus after
Running (Stop) After Stop: photo + file Photo full-screen File save
running reply photo share

Checklist / 检查

  • One issue, one subject. / 只做一件事。
  • src/client/ changed → npm run build ran and client.js is committed. / 改了 src/client/ 就已重新 build 并提交 client.js。 (not changed)
  • No keys, tokens or personal data, also in screenshots. / 没有密钥、token 或个人信息,截图里也没有。
  • No AI tool as author or Co-authored-by. / 没有把 AI 工具写成作者或 Co-authored-by。

DS Bot Android Engineer opened this PR for Lulu
Implemented in session Add DSH Agent to Android plus menu
Review with Devin · Open in Devin Desktop


The browser's new-chat menu offers Add DSH Agent while the team has none;
the phone app had no DSH Agent support. The host gains agent-chat, which
pages the DSH Agent's newest plain DSH Session, and the mobile API lists
the agents capability. The app adds the menu entry, a DSH Agent row in the
team list and a chat that loads through agent-chat and sends to its
Session.

Fixes #1415
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T03:33:32.401424Z b8c1948 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8c19485d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ds-bot/src/host/parts.js
async function agentPage(agentId, cursor, steps = false) {
const sessionId = rt.agentSessionOf(agentId)
if (sessionId === undefined) throw Object.assign(new Error('Unknown DSH Agent'), { code: 'bot/not-found' })
return { sessionId, ...(await partPage([{ sessionId }], 0, cursor, steps)) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow Agent sessions in the attachment-reading endpoints

When a DSH Agent conversation contains images or downloadable files, this endpoint exposes them through the existing chat items, but the corresponding host readers still reject Agent sessions. In ds-bot/src/host/mobile.js, image, fileDownload, and markdownImage require a Bot or room owner and return bot/not-found for these plain DSH sessions. Consequently, photos sent using the newly enabled Agent composer cannot be loaded back, and Agent-generated files cannot be saved. Extend those readers' ownership checks and session selection to support registered Agent sessions.

Useful? React with 👍 / 👎.

{fileError ? <Text style={[type.small, { color: p.danger, textAlign: 'center', marginBottom: 4 }]} accessibilityRole="alert">{fileError}</Text> : null}
{page !== null && loadError !== null ? <Text style={[type.small, { color: p.danger, textAlign: 'center', marginBottom: 4, marginHorizontal: 16 }]} accessibilityRole="alert">{loadError}</Text> : null}
<Composer name={bot?.name ?? room?.name ?? ''} running={running} canStop={canStop} canAttach={hello?.capabilities?.includes('send-images') === true} onSend={send} onStop={stop} p={p} />
<Composer name={bot?.name ?? room?.name ?? agent?.name ?? ''} running={running} canStop={canStop} canAttach={hello?.capabilities?.includes('send-images') === true} onSend={send} onStop={stop} p={p} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wire running state and cancellation for Agent chats

While a DSH Agent is executing a prompt, this composer always receives running=false and canStop=false: doing is populated only for Bots, and roomWork is empty for an Agent. Moreover, the existing stop callback handles only Bots and rooms. Users can now start potentially long-running Agent work from Android but cannot interrupt it there. Add Agent session status and a cancellation path before reusing the composer for this chat kind.

Useful? React with 👍 / 👎.

The phone's media endpoints only knew Bot and group Sessions, so an image or
a presented file in a DSH Agent chat was refused as an unknown session.
agent-chat answered an Agent with every Session archived as unknown, so the
phone left the chat; it now returns an empty page and the phone opens a new
Session on the first message. A new newest Session no longer keeps the older
pages of the previous one.
A paired browser may not open DSH Agent chats, but the media endpoints it may
call now resolve Agent Sessions, so it could read Agent workspace images and
files. Refuse those endpoints for Agent Sessions unless the caller is a phone.
Two sends to an Agent with no Session each created one, and the phone shows
only the newest, hiding the other message and its reply.

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

The demo provider left hello unset, so menu entries gated on a capability,
such as Add DSH Agent, never showed in demo mode.
The browser shows a DSH Agent Session running and stops it from its own
view; the phone had neither. state.work.agents names each Agent with a
running turn, and stop-agent cancels it. Also test Agent media on the phone.
The composer shows Stop while state.work.agents has the Agent, and Stop
calls stop-agent; the demo runs an Agent after a send until stopped.
So an emulator check of a demo build can open an Agent chat photo and
save its file.
session/event dropped every event of a plain DSH Session, so
state.work.agents never named a running Agent and stop-agent found no
turn to cancel. Track only turn/start and turn/end for Agent Sessions.
The phone only learned an Agent was running at its next 15-second state
poll, so short replies never showed Stop. Bot Sessions already nudge the
feed on agent/status; do the same for DSH Agent Sessions.
# Conflicts:
#	mobile/src/screens/Chat.tsx
@Fei2411

Fei2411 commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

Review: approved
Reviewer: Antigravity (Claude Sonnet 5.5) @ fb789e1

Independent first-principles review passed:

  • Host adds read-only agent-chat (paging newest DSH Agent session via partPage), agentWorkView/stopAgent (non-READS, blocked in read-only windows), live feed.js wakeup on agent/status, and media ownership checks in mobile.js (image, fileDownload, markdownImage) with browser-remote AGENT_MEDIA deny guard in phone.js.
  • Mobile adds Add DSH Agent to the + menu when the host advertises agents and no Agent exists yet, renders AgentRow, Pill, EmptyChat with properly attributed FishLogo (NOTICE), and wires agentWork/running/stop-agent.
  • Merged latest origin/dev cleanly into fb789e11, adapting Chat.tsx Agent session restarts to #1926's createChatHistory/refreshChatHistory model (so in-flight pagination from a previous Agent session is also safely discarded). Verified locally: mobile typecheck + 113/113 tests, ds-bot agents/feed/mobile/phone/test-files-layout tests, and lint (0 errors) all pass.

@Fei2411 Fei2411 added review/approved Independent review passed — ready to merge reviewed-by/antigravity Reviewed by Antigravity labels Nov 21, 2026
@Fei2411
Fei2411 merged commit f88b911 into dev Nov 21, 2026
15 checks passed
@Fei2411
Fei2411 deleted the feat/1415-mobile-add-dsh-agent branch November 21, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/approved Independent review passed — ready to merge reviewed-by/antigravity Reviewed by Antigravity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant