Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
830714c
[docs] web: propose Agent and canvas workspace modes
congw729 Nov 17, 2026
af82227
[feat] workspace: persist the selected workspace mode
congw729 Nov 17, 2026
f3349c1
[feat] workspace: add Agent mode and a left-chat canvas layout
congw729 Nov 17, 2026
b30f15a
[test] workspace: cover mode switching and canvas interactions
congw729 Nov 17, 2026
cdadcfb
[test] canvas: use canvas bounds for interaction coordinates
congw729 Nov 17, 2026
3cfed8f
[fix] assistant: preserve active controls when chat loads
congw729 Nov 17, 2026
23c07d7
Merge remote-tracking branch 'origin/main' into codex/issue-373-works…
congw729 Nov 22, 2026
05d32e1
[feat] web: rename chat and canvas creation modes
congw729 Nov 22, 2026
b6a4c62
[test] web: scope model category choices to settings navigation
congw729 Nov 22, 2026
3475c11
[feat] web: add movable chat and simplify canvas creation tools
congw729 Nov 22, 2026
016148a
[chore] Merge main into the workspace modes branch
congw729 Nov 22, 2026
30ce51e
[test] canvas: reconnect through the source node's visible port
congw729 Nov 22, 2026
18e168c
[test] assistant: resize suggested replies from the left dock
congw729 Nov 22, 2026
bf16c17
[feat] assistant: show project results in chat creation
congw729 Nov 22, 2026
ff1b8e7
[feat] workspace: edit project media and timelines from chat
congw729 Nov 23, 2026
c401082
[test] workspace: pin the performance fixture locale
congw729 Nov 23, 2026
829feec
[chore] workspace: merge media model defaults from main
congw729 Nov 23, 2026
1ccb478
[test] assistant: wait for chat readiness after workspace reload
congw729 Nov 23, 2026
9a96419
[feat] web: guide first canvas setup and simplify chat docking
congw729 Nov 23, 2026
30085b7
Merge remote-tracking branch 'origin/main' into codex/issue-373-works…
congw729 Nov 23, 2026
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
37 changes: 33 additions & 4 deletions apps/api/src/opendirector_api/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ def path(self, project_id: UUID, session: str | None = None) -> Path:

def update(self, project_id: UUID, session: str | None = None, *, draft: Draft | None = None,
begin: dict | None = None, finish: dict | None = None, conversation_id: UUID | None = None,
before_begin=None) -> dict:
finish_turn_id: UUID | None = None, edited_documents: dict[str, int] | None = None, before_begin=None) -> dict:
with self.projects.local.transaction() as db:
self.projects._recover()
directory, _, _ = self.projects._load(db, project_id)
directory, _, records = self.projects._load(db, project_id)
if session:
self.projects._lease(db, project_id, directory, session)
folder = child(directory, 'agent-runs')
Expand All @@ -143,7 +143,10 @@ def update(self, project_id: UUID, session: str | None = None, *, draft: Draft |
value.update(draft.model_dump(mode="json", exclude={"conversationId"}))
changed = True
if begin is not None:
if any(message['id'] == begin['id'] for message in value['messages']):
# Tool commands and completed jobs use project + turn as their origin.
if any(message['id'] == begin['id']
for conversation in [value, *value.get('archivedConversations', [])]
for message in conversation['messages']):
raise ProjectError('这条消息已接受,请读取对话,不要重复发送。', 409)
if before_begin is not None:
before_begin()
Expand All @@ -154,6 +157,29 @@ def update(self, project_id: UUID, session: str | None = None, *, draft: Draft |
value.update(draft='', draftContent=None, assets=[], skills=[])
changed = True
if finish is not None:
# Unlike job results, directly published files can later be deleted.
# Keep just their immutable identity with the reply that delivered them.
if finish_turn_id is not None:
snapshot = records[0].snapshot
outputs = [{'id': str(asset.id), 'name': asset.name, 'fingerprint': asset.fingerprint}
for asset in snapshot.assets if asset.provenance.source == 'agent_written'
and asset.provenance.agentRunId == finish_turn_id]
if outputs:
finish = {**finish, 'publishedAssets': {'projectId': str(project_id),
'eventCursor': snapshot.eventCursor, 'assets': outputs}}
if edited_documents:
owners = {str(item.binding.objectRef.id): item for item in snapshot.canvasItems
if item.kind == 'timeline'}
timelines = []
for doc in snapshot.editorDocuments:
revision = edited_documents.get(str(doc.id))
if doc.kind == 'timeline' and revision is not None:
owner = owners.get(str(doc.id))
timelines.append({'editorId': str(doc.id), 'revision': revision,
'itemId': str(owner.id) if owner else None, 'title': owner.title if owner else ''})
if timelines:
finish = {**finish, 'publishedTimelines': {'projectId': str(project_id),
'eventCursor': snapshot.eventCursor, 'timelines': timelines}}
value['messages'] = [finish if message['id'] == finish['id'] else message for message in value['messages']]
changed = True
if changed:
Expand Down Expand Up @@ -473,6 +499,7 @@ def validate_connection():
async def produce() -> None:
text, status, error, accepted = '', 'complete', None, False
activities = []
edited_documents = {}
sources = {}
previous_sources = {}
plan = None
Expand Down Expand Up @@ -510,6 +537,7 @@ async def produce() -> None:
run = RunContext(runtime=value.runtime, project_id=project_id, turn_id=value.id,
session=session, directory=directory, config=config, messages=context,
selected_skills=value.skills, thinking=value.thinking, model_selections=model_selections,
edited_documents=edited_documents,
runtime_model=value.runtimeModel, skills=available, conversation_id=UUID(saved['conversationId']))
async with aclosing(runtimes.stream(run)) as stream:
async for event in stream:
Expand Down Expand Up @@ -562,7 +590,8 @@ async def produce() -> None:
'model': model, 'modelIsCliDefault': model_is_cli_default,
'runtime': value.runtime, 'thinking': value.thinking, 'tools': activities,
'sources': list(sources.values()),
**({'plan': plan} if plan is not None else {})}, conversation_id=value.conversationId)
**({'plan': plan} if plan is not None else {})}, conversation_id=value.conversationId,
finish_turn_id=value.id, edited_documents=edited_documents)
else:
saved = None
events.put({'type': 'end', 'conversation': saved, 'error': error})
Expand Down
17 changes: 14 additions & 3 deletions apps/desktop/scripts/smoke-window.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,20 @@ async function smokeTraceWindows(window, projectId) {
.then(response => response.json()).then(({projects}) => projects.find(project => project.id === '${projectId}').path)`);
const folder = join(projectPath, 'agent-runs');
mkdirSync(folder, { recursive: true });
await evaluate("document.querySelector('.cw-chat-button').click()");
const openedChat = await evaluate(`(() => {
const toggle = document.querySelector('.cw-chat-button');
if (toggle.getAttribute('aria-expanded') === 'true') return false;
toggle.click();
return true;
})()`);
const editor = ".cw-assistant-composer [contenteditable=true]";
await waitFor(() => evaluate(`!!document.querySelector(${JSON.stringify(editor)})`), 'Assistant composer did not open');
await waitFor(() => evaluate(`document.querySelector(${JSON.stringify(editor)})?.checkVisibility()`), 'Assistant composer did not open');
await waitFor(() => evaluate(`(() => {
const chat = document.querySelector('#canvas-assistant').getBoundingClientRect();
const canvas = document.querySelector('.cw-canvas-region').getBoundingClientRect();
const sidebar = document.querySelector('.cw-workspace[data-desktop-sidebar=open] .od-project-sidebar');
return chat.left >= (sidebar?.getBoundingClientRect().right ?? 0) && chat.right <= canvas.left;
})()`), 'The project sidebar, conversation and canvas overlap');
await evaluate(`document.querySelector(${JSON.stringify(editor)}).focus()`);
await window.webContents.insertText('Draft before opening trace');
const draft = () => evaluate(`document.querySelector(${JSON.stringify(editor)})?.textContent`);
Expand Down Expand Up @@ -401,7 +412,7 @@ async function smokeTraceWindows(window, projectId) {
await evaluate(`document.querySelector(${JSON.stringify(editor)}).focus()`);
await window.webContents.insertText(' and continued afterward');
await waitFor(async () => (await draft())?.includes('continued afterward'), 'Assistant composer stopped accepting input');
await evaluate("document.querySelector('.cw-chat-button').click()");
if (openedChat) await evaluate("document.querySelector('.cw-chat-button').click()");
}

async function waitFor(check, message, attempts = 150) {
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This directory is the entry point for the repository's shared documentation. The
| [Development guidance](../AGENTS.md) | Product direction and enduring principles | Architecture principles or product boundaries change |
| [Contributing](../CONTRIBUTING.md) | Label taxonomy, how to pick labels, and what a PR must satisfy | Process, labels, or submission requirements change |
| [Unified project architecture](architecture/unified-project.md) | Business objects, shared entry points, and interaction rules | Object responsibilities, commands, persistence, or interaction rules change |
| [Workspace modes RFC (中文)](architecture/workspace-modes-rfc.zh-CN.md) | Chat and canvas creation, first-run selection, docked and floating chat, result editing, and acceptance criteria | The mode design or its acceptance criteria change |
| [Desktop architecture](architecture/desktop.md) ([中文](architecture/desktop.zh-CN.md)) | Electron, the Python Host, project storage, and shutdown behavior | Process, request, storage, or lifecycle boundaries change |
| [Test contracts](architecture/test-contracts.md) | Test/production boundaries, how to avoid stale assertions and environment-dependent red runs | Test infrastructure, capability gates, or contract ownership change |
| [Capability mapping contract](architecture/capability-contract.md) | Evidenced upstream vocabulary, the `(operation, profile) → capability` table, the untranslatable declarations, and how it feeds discovery | Upstream vocabulary, capability ids, or discovery matching change |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading