Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# AGENTS.md

Guidance for coding agents (and humans) working on DreamCoder. Setup, build order and the contribution flow are in [docs/CONTRIBUTING_en.md](docs/CONTRIBUTING_en.md); this file covers what is easy to get wrong.
Guidance for coding agents (and humans) working on DreamCoder. Setup, build order and the contribution flow are in [docs/general/CONTRIBUTING_en.md](docs/general/CONTRIBUTING_en.md); this file covers what is easy to get wrong.

## Project layout

- `desktop/src`: desktop UI, React with zustand stores (`desktop/src/stores`).
- `desktop/electron`: the Electron main process and preload. The page reaches it only through `desktop/src/lib/shell`.
- `src/server`: the Bun server that runs as the app's sidecar. It starts one CLI process per session.
- `src`: the CLI, derived from Claude Code. The app drives it in `--print` stream-json mode.
- Session state lives on the server. The desktop app and the H5 page mirror it. New session state belongs in the server state store, not only in a client store. See [docs/session-state-tech-design.md](docs/session-state-tech-design.md).
- `docs`: project-wide documents in `docs/general`, and one folder per feature in `docs/features/<feature>` for its technical design and related documents. A new feature's design goes in its own folder there. See [docs/README.md](docs/README.md).
- Session state lives on the server. The desktop app and the H5 page mirror it. New session state belongs in the server state store, not only in a client store. See [docs/features/session-state/tech-design.md](docs/features/session-state/tech-design.md).

## Checks

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@ All notable changes to DreamCoder will be documented in this file.

## [Unreleased]

### Added

- **Sessions can start other sessions and message each other.** The agent can start a new session with `StartSession`, either fresh with a brief or as a fork of its own conversation, optionally in a new git worktree; you approve every new session, whatever the permission mode. Any session can message any other with `SendMessage`, across projects: a message wakes the receiver, and a progress report from a child to its parent waits for the parent's next turn instead of interrupting it (a parent that is already working sees it right away). Reports waiting for the parent are listed above its message box. The server stamps who sent each message, so a session cannot pass itself off as you or as another session. `ListSessions` lists sessions, and `RenameSession` lets the agent rename its own session (#239).
- **Sessions are nested in the sidebar.** Sessions the agent started, and conversations you forked, appear under the session they came from, with an icon for each kind and a count that collapses or expands them. Messages from another session appear in the conversation as a one-line row with the sender, which expands to the full text (#239).

### Changed

- **A message you send while the agent is working waits for the next turn.** It used to be slipped into the running turn. Queued messages are listed above the message box, where you can withdraw one or send the queue now, which stops the current turn and starts the next one; Stop does the same while messages are queued. Queued messages survive a model or permission change that restarts the agent at the end of the turn (#239).

### Fixed

- Confirmation dialogs keep long workspace paths inside their bounds, so Cancel and Enable remain visible when enabling bypass permissions (#226). Thanks @imshah-id.
- Images attached from uploads, paste or the built-in browser are kept unchanged within the client limits and resized or compressed when they exceed 2000×2000 pixels or 3.75 MB; a re-encoded image is named after its new type. An image the app cannot decode is attached as it is when it is within 3.75 MB. A file that cannot be attached is named in a message, and the other files picked or dropped with it are still attached. Sent images now use compact thumbnails that still open in the gallery (#218). Thanks @henricop.
- Messages that reach a session in the middle of a turn are saved with the conversation. They used to disappear when the history was reloaded, and the agent forgot them when the session was resumed (#239).
- A lead session that is resumed after a restart keeps using its team's task list (#216). The lead looked for tasks in a list named after its session, so `TaskList` returned nothing and new tasks went to a different list than the one the teammates read. The lead now goes back to the team it created when the session is resumed. Thanks @WhitePepperLambSoup.

## [0.8.0] — 2026-11-01
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Also hosted on AtomGit: [atomgit.com/GoDiao/DreamCoder](https://atomgit.com/GoDi

> 🎉 **500 stars!** Thank you to everyone who starred, tried, reported issues, and contributed. DreamCoder is only five months old, and it has grown step by step because of you. Next, we'll keep pace with the best practices of frontier coding agents and try everything that can make the experience better, along with brand-new features. Our goal will always be to **reach for the stars**.

> 🌱 **Contributions welcome!** Browse [good first issues](https://github.com/GoDiao/dreamcoder/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and [help wanted](https://github.com/GoDiao/dreamcoder/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22), and read the [contributing guide](docs/CONTRIBUTING_en.md) before starting.
> 🌱 **Contributions welcome!** Browse [good first issues](https://github.com/GoDiao/dreamcoder/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and [help wanted](https://github.com/GoDiao/dreamcoder/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22), and read the [contributing guide](docs/general/CONTRIBUTING_en.md) before starting.

---

Expand Down Expand Up @@ -185,7 +185,7 @@ To learn how a coding agent works under the hood, read the [Coding Agent Impleme
> The maintainer now develops primarily on **macOS (Apple Silicon)**, running from source (`bun run electron:dev`); it ships as a `.dmg` from v0.5.0.
> **Windows x64** was the main platform before and has been tested extensively, but the maintainer no longer develops on it day to day, so feedback on how new changes behave on Windows is especially welcome.
> **Linux** is not built or packaged; running the desktop app from source may work but is not part of the maintainer's day-to-day workflow, so Linux support is still best-effort.
> For the validated Ubuntu browser workflow, exFAT installation workaround, and local Ollama results, see the [Linux validation report](docs/LINUX_BROWSER_VALIDATION.md). For startup, shutdown, and termination by PID, see the [browser usage guide](docs/WEB_USAGE.md).
> For the validated Ubuntu browser workflow, exFAT installation workaround, and local Ollama results, see the [Linux validation report](docs/general/LINUX_BROWSER_VALIDATION.md). For startup, shutdown, and termination by PID, see the [browser usage guide](docs/general/WEB_USAGE.md).
> If you're running DreamCoder on Windows or Linux, issues and PRs are especially valuable;
> for the current Linux memory investigation, see [#25](https://github.com/GoDiao/dreamcoder/issues/25).
> Check [GitHub Releases](https://github.com/GoDiao/dreamcoder/releases) for the actual assets available with each release.
Expand All @@ -201,7 +201,7 @@ To learn how a coding agent works under the hood, read the [Coding Agent Impleme
- [ ] **Phase 4**: Release Automation + Auto-update
- [ ] **Phase 5**: Remote Agent Backend (run the agent on a remote host over SSH / WebSocket)

See [ROADMAP](docs/ROADMAP_en.md)
See [ROADMAP](docs/general/ROADMAP_en.md)

---

Expand Down Expand Up @@ -255,11 +255,11 @@ On first launch, DreamCoder detects your system locale: Chinese systems (`zh-*`)

## 💝 Sponsorship

DreamCoder is maintained by one person in their spare time. Companies and individuals are welcome to sponsor its development. See the [sponsorship policy](docs/SPONSORS_en.md) for tiers and rules, and email diaoshengjia@gmail.com to get in touch.
DreamCoder is maintained by one person in their spare time. Companies and individuals are welcome to sponsor its development. See the [sponsorship policy](docs/general/SPONSORS_en.md) for tiers and rules, and email diaoshengjia@gmail.com to get in touch.

## 🤝 Contributing

Issues and pull requests are welcome. If you'd like to improve DreamCoder, start with the [Contributing Guide](docs/CONTRIBUTING_en.md) to get familiar with the workflow and collaboration style.
Issues and pull requests are welcome. If you'd like to improve DreamCoder, start with the [Contributing Guide](docs/general/CONTRIBUTING_en.md) to get familiar with the workflow and collaboration style.

## 📝 Changelog

Expand Down
10 changes: 5 additions & 5 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

> 🎉 **500 Star 了!** 感谢每一位点 Star、试用、提 issue 和贡献代码的朋友。DreamCoder 才五个月大,是你们让它一点点长起来的。我们接下来会更进一步跟进前沿 coding agent 的最佳实践,完成一切可以提升用户体验的尝试和崭新的功能,我们的目标一直会是**星辰大海**。

> 🌱 **欢迎贡献!** 可以从 [good first issue](https://github.com/GoDiao/dreamcoder/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) 和 [help wanted](https://github.com/GoDiao/dreamcoder/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) 开始;动手前请阅读 [贡献指南](docs/CONTRIBUTING_zh.md)。
> 🌱 **欢迎贡献!** 可以从 [good first issue](https://github.com/GoDiao/dreamcoder/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) 和 [help wanted](https://github.com/GoDiao/dreamcoder/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) 开始;动手前请阅读 [贡献指南](docs/general/CONTRIBUTING_zh.md)。

---

Expand Down Expand Up @@ -188,7 +188,7 @@ Provider 配置和 API Key 保存在本机文件中。使用云端模型时,
> 维护者目前主要在 **macOS(Apple Silicon)** 上开发,从源码运行(`bun run electron:dev`),自 v0.5.0 起提供 `.dmg` 安装包。
> **Windows x64** 是此前的主力平台,经过长期实测;维护者现在不在 Windows 上日常开发,新改动在 Windows 上的表现尤其欢迎反馈。
> **Linux** 暂不构建安装包;从源码运行桌面端或许可行,但维护者并不日常使用,仍属于尽力支持的状态。
> Ubuntu 浏览器版的验证范围、exFAT 依赖安装问题及本地 Ollama 调用结果见[Linux 验证报告](docs/LINUX_BROWSER_VALIDATION_zh.md);启动、关闭和按 PID 终止进程的方法见[浏览器版使用指南](docs/WEB_USAGE_zh.md)。
> Ubuntu 浏览器版的验证范围、exFAT 依赖安装问题及本地 Ollama 调用结果见[Linux 验证报告](docs/general/LINUX_BROWSER_VALIDATION_zh.md);启动、关闭和按 PID 终止进程的方法见[浏览器版使用指南](docs/general/WEB_USAGE_zh.md)。
> 如果你正在使用 Windows 或 Linux,欢迎通过 issue 或 PR 一起把这部分体验补完整;
> Linux 内存问题可关注 [#25](https://github.com/GoDiao/dreamcoder/issues/25)。
> 安装包供应情况以 [GitHub Releases](https://github.com/GoDiao/dreamcoder/releases) 页面中的实际附件为准。
Expand All @@ -204,7 +204,7 @@ Provider 配置和 API Key 保存在本机文件中。使用云端模型时,
- [ ] **Phase 4**: Release 自动化 + 自动更新
- [ ] **Phase 5**: 远程 Agent 后端 (通过 SSH / WebSocket 在远程主机运行 Agent)

详见 [ROADMAP](docs/ROADMAP_zh.md)
详见 [ROADMAP](docs/general/ROADMAP_zh.md)

---

Expand Down Expand Up @@ -258,11 +258,11 @@ bun run electron:dev

## 💝 赞助与合作

DreamCoder 由个人利用业余时间维护。欢迎企业和个人赞助,支持项目持续开发。档位和规则见 [赞助政策](docs/SPONSORS_zh.md),合作请发邮件到 diaoshengjia@gmail.com。
DreamCoder 由个人利用业余时间维护。欢迎企业和个人赞助,支持项目持续开发。档位和规则见 [赞助政策](docs/general/SPONSORS_zh.md),合作请发邮件到 diaoshengjia@gmail.com。

## 🤝 贡献指南

欢迎提交 Issue 和 PR。若你准备参与改进 DreamCoder,建议先阅读 [贡献指南](docs/CONTRIBUTING_zh.md),可以更快熟悉开发流程与协作方式。
欢迎提交 Issue 和 PR。若你准备参与改进 DreamCoder,建议先阅读 [贡献指南](docs/general/CONTRIBUTING_zh.md),可以更快熟悉开发流程与协作方式。

## 📝 更新日志

Expand Down
2 changes: 1 addition & 1 deletion desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bun run electron:pack

## 许可证

[MIT License](LICENSE)
[MIT License](../LICENSE)

## 致谢

Expand Down
2 changes: 2 additions & 0 deletions desktop/src/__tests__/pages.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ function runtimeMirror(selection: RuntimeSelection): SessionState {
activeGoal: null,
backgroundTasks: [],
uiPages: [],
pendingReports: [],
queuedMessages: [],
team: null,
clientCount: 1,
} satisfies SessionState
Expand Down
6 changes: 2 additions & 4 deletions desktop/src/components/CommandPalette/CommandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useRef, useState } from 'react'
import { useTranslation } from '../../i18n'
import { useUIStore } from '../../stores/uiStore'
import { useSessionStore } from '../../stores/sessionStore'
import { useTabStore } from '../../stores/tabStore'
import { useChatStore } from '../../stores/chatStore'
import { openSessionTab } from '../../lib/sessionNavigation'
import type { SessionListItem } from '../../types/session'
import { useOverlayReturnFocus } from '../../hooks/useOverlayReturnFocus'
import { Dialog, DialogContent, DialogTitle } from '../shared/ui/dialog'
Expand Down Expand Up @@ -32,8 +31,7 @@ function CommandPaletteContent() {
? state.sessions.map((item) => item.id === session.id ? { ...item, ...session } : item)
: [...state.sessions, session],
}))
useTabStore.getState().openTab(session.id, session.title)
useChatStore.getState().connectToSession(session.id)
openSessionTab(session.id, session.title)
close()
}

Expand Down
2 changes: 1 addition & 1 deletion desktop/src/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Generate through the CLI, then review imports, icons, dependencies, tokens and
accessibility against the local adaptations above. Do not overwrite local
behavior with unreviewed registry output.

See [CONTRIBUTING](../../../docs/CONTRIBUTING_en.md#development-environment) for
See [CONTRIBUTING](../../../docs/general/CONTRIBUTING_en.md#development-environment) for
setup. Run `bun run lint` and `bun run test -- --run`
from `desktop/`, plus `bun test` from the repository root before a PR. Automated
checks do not replace seven-theme/bilingual desktop and H5 visual acceptance,
Expand Down
2 changes: 2 additions & 0 deletions desktop/src/components/chat/BrowserGrantRequests.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ function setGrants(grants: PendingBrowserGrant[], sessionId = SESSION_ID) {
activeGoal: null,
backgroundTasks: [],
uiPages: [],
pendingReports: [],
queuedMessages: [],
team: null,
clientCount: 1,
}
Expand Down
10 changes: 10 additions & 0 deletions desktop/src/components/chat/ChatTraceBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { ReactNode } from 'react'
import { Trace } from '../shared/ui/trace'

export function ChatTraceBar({ children }: { children: ReactNode }) {
return (
<div className="shrink-0 px-8">
<Trace className="mx-auto mb-2 max-w-[860px] rounded-lg border border-ui-border p-3">{children}</Trace>
</div>
)
}
8 changes: 6 additions & 2 deletions desktop/src/components/chat/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import { useChatStore, useSessionField } from '../../stores/chatStore'
import { useSessionStore } from '../../stores/sessionStore'
import { useWorkspaceChatContextStore } from '../../stores/workspaceChatContextStore'
import { useTabStore } from '../../stores/tabStore'
import { openSessionTab } from '../../lib/sessionNavigation'
import { useTeamStore } from '../../stores/teamStore'
import { useUIStore } from '../../stores/uiStore'
import { useTranslation } from '../../i18n'
import type { TranslationKey } from '../../i18n/locales/en'
import { UserMessage } from './UserMessage'
import { SessionMessageCard } from './SessionMessageCard'
import { AssistantMessage } from './AssistantMessage'
import { StreamingReply } from './StreamingReply'
import { ThinkingBlock } from './ThinkingBlock'
Expand Down Expand Up @@ -1833,8 +1835,7 @@ export function MessageList({ sessionId, compact = false }: MessageListProps = {
try {
const result = await branchSession(resolvedSessionId, target.transcriptMessageId)
const title = result.title.trim() || t('sidebar.newSession')
useTabStore.getState().openTab(result.sessionId, title)
useChatStore.getState().connectToSession(result.sessionId)
openSessionTab(result.sessionId, title)
addToast({
type: 'success',
message: t('chat.branchSuccess', { title }),
Expand Down Expand Up @@ -2044,6 +2045,9 @@ export const MessageBlock = memo(function MessageBlock({

switch (message.type) {
case 'user_text':
if (message.origin?.kind === 'session') {
return <SessionMessageCard content={message.content} origin={message.origin} timestamp={message.timestamp} />
}
return (
<SelectableChatMessage
sessionId={sessionId}
Expand Down
Loading
Loading