Commit Graph

127 Commits

Author SHA1 Message Date
JeffJiang 14d1e01149
Refactor hooks and improve error handling in chat functionality (#962)
* refactor: update useThreadChat and useThreadStream hooks for improved state management

* fix: improve error handling in agent configuration loading and enhance chat page functionality

* fix: enhance error handling in agent configuration loading

* Update frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-04 09:50:45 +08:00
JeffJiang 7de94394d4
feat(agent):Supports custom agent and chat experience with refactoring (#957)
* feat: add agent management functionality with creation, editing, and deletion

* feat: enhance agent creation and chat experience

- Added AgentWelcome component to display agent description on new thread creation.
- Improved agent name validation with availability check during agent creation.
- Updated NewAgentPage to handle agent creation flow more effectively, including enhanced error handling and user feedback.
- Refactored chat components to streamline message handling and improve user experience.
- Introduced new bootstrap skill for personalized onboarding conversations, including detailed conversation phases and a structured SOUL.md template.
- Updated localization files to reflect new features and error messages.
- General code cleanup and optimizations across various components and hooks.

* Refactor workspace layout and agent management components

- Updated WorkspaceLayout to use useLayoutEffect for sidebar state initialization.
- Removed unused AgentFormDialog and related edit functionality from AgentCard.
- Introduced ArtifactTrigger component to manage artifact visibility.
- Enhanced ChatBox to handle artifact selection and display.
- Improved message list rendering logic to avoid loading states.
- Updated localization files to remove deprecated keys and add new translations.
- Refined hooks for local settings and thread management to improve performance and clarity.
- Added temporal awareness guidelines to deep research skill documentation.

* feat: refactor chat components and introduce thread management hooks

* feat: improve artifact file detail preview logic and clean up console logs

* feat: refactor lead agent creation logic and improve logging details

* feat: validate agent name format and enhance error handling in agent setup

* feat: simplify thread search query by removing unnecessary metadata

* feat: update query key in useDeleteThread and useRenameThread for consistency

* feat: add isMock parameter to thread and artifact handling for improved testing

* fix: reorder import of setup_agent for consistency in builtins module

* feat: append mock parameter to thread links in CaseStudySection for testing purposes

* fix: update load_agent_soul calls to use cfg.name for improved clarity

* fix: update date format in apply_prompt_template for consistency

* feat: integrate isMock parameter into artifact content loading for enhanced testing

* docs: add license section to SKILL.md for clarity and attribution

* feat(agent): enhance model resolution and agent configuration handling

* chore: remove unused import of _resolve_model_name from agents

* feat(agent): remove unused field

* fix(agent): set default value for requested_model_name in _resolve_model_name function

* feat(agent): update get_available_tools call to handle optional agent_config and improve middleware function signature

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-03-03 21:32:01 +08:00
Zhiyunyao a138d5388a
feat: add reasoning_effort configuration support for Doubao/GPT-5 models (#947)
* feat: Add reasoning effort configuration support

* Add `reasoning_effort` parameter to model config and agent initialization
* Support reasoning effort levels (minimal/low/medium/high) for Doubao/GPT-5 models
* Add UI controls in input box for reasoning effort selection
* Update doubao-seed-1.8 example config with reasoning effort support

Fixes & Cleanup:
* Ensure UTF-8 encoding for file operations
* Remove unused imports

* fix: set reasoning_effort to None for unsupported models

* fix: unit test error

* Update frontend/src/components/workspace/input-box.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-03-02 20:49:41 +08:00
Zhiyunyao 72df234636
refactor(frontend): optimize network queries and improve code readability (#919)
* refactor(frontend): optimize network queries and improve code readability
- useThreadStream: Add useStream with fetchStateHistory: {limit: 1}
- useThreads: Add select fields and disable refetchOnWindowFocus
- useModels: Disable refetchOnWindowFocus
- ChatPage and titleOfThread: Improve thread title logic
- loadModels: Refactor code for better readability

* fix: address the review comments of Copilot

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-02 20:35:46 +08:00
LofiSu b3a1f018ab fix: 修复新建技能后输入框无法编辑的问题
问题:点击新建技能按钮后,对话框中预设的文字无法删除或修改
原因:useEffect 依赖项包含 promptInputController.textInput,该对象在每次输入时都会重新创建,导致 useEffect 重复执行并覆盖用户输入
解决:使用 useRef 保存 setInput 方法,并跟踪已设置的初始值,确保 useEffect 只在初始值变化时执行一次

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-10 12:39:44 +08:00
Henry Li df3668ecd5 fix: eslint 2026-02-09 23:28:36 +08:00
LofiSu 2f50e5d969 feat(citations): inline citation links with [citation:Title](URL)
- Backend: add citation format to lead_agent and general_purpose prompts
- Add CitationLink component (Badge + HoverCard) for citation cards
- MarkdownContent: detect citation: prefix in link text, render CitationLink
- Message/artifact/subtask: use MarkdownContent or Streamdown with CitationLink
- message-list-item: pass img via components prop (remove isHuman/img)
- message-group, subtask-card: drop unused imports; fix import order (lint)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 21:40:20 +08:00
LofiSu d9a86c10e8 fix(frontend): no half-finished citations, correct state when SSE ends
Citations:
- In shouldShowCitationLoading, treat any unreplaced [cite-N] in cleanContent
  as show-loading (no body). Fixes Ultra and other modes when refs arrive
  before the <citations> block in the stream.
- Single rule: hasUnreplacedCitationRefs(cleanContent) => true forces loading;
  then isLoading && hasCitationsBlock(rawContent) for streaming indicator.

SSE end state:
- When stream finishes, SDK may set isLoading=false before client state has
  the final message content, so UI stayed wrong until refresh.
- Store onFinish(state) as finalState in chat page; clear when stream starts.
- Pass messagesOverride={finalState.messages} to MessageList when not loading
  so the list uses server-complete messages right after SSE ends (no refresh).

Chore:
- Stop tracking .githooks/pre-commit; add .githooks/ to .gitignore (local only).

Co-authored-by: Cursor <cursoragent@cursor.com>

---
fix(前端): 杜绝半成品引用,SSE 结束时展示正确状态

引用:
- shouldShowCitationLoading 中只要 cleanContent 仍含未替换的 [cite-N] 就
  只显示加载、不渲染正文,解决流式时引用块未到就出现 [cite-1] 的问题。
- 规则:hasUnreplacedCitationRefs(cleanContent) 为真则一律显示加载;
  此外 isLoading && hasCitationsBlock 用于流式时显示「正在整理引用」。

SSE 结束状态:
- 流结束时 SDK 可能先置 isLoading=false,客户端 messages 尚未包含
  最终内容,导致需刷新才显示正确。
- 在对话页保存 onFinish(state) 为 finalState,流开始时清空。
- 非加载时向 MessageList 传入 messagesOverride={finalState.messages},
  列表在 SSE 结束后立即用服务端完整消息渲染,无需刷新。

杂项:
- 取消跟踪 .githooks/pre-commit,.gitignore 增加 .githooks/(仅本地)。
2026-02-09 15:15:20 +08:00
Henry Li cebf2599c9 feat: add mode in welcome 2026-02-09 00:41:25 +08:00
Henry Li 3e2883e2a3 feat: support subtasks 2026-02-07 16:14:48 +08:00
hetao 449ffbad75 feat: add ultra mode 2026-02-06 17:48:14 +08:00
Henry Li f391060573 feat: adjust position 2026-02-06 09:39:20 +08:00
hetao b773bae407 fix: fix frontend rendering issue 2026-02-03 19:38:10 +08:00
Henry Li e84715831f fix: fix position 2026-02-02 16:40:43 +08:00
Henry Li 018241c203 fix: set default state for todo list collapse to true 2026-02-02 14:46:26 +08:00
Henry Li 6f6d799051 fix: set default state for todo list collapse to false 2026-02-02 14:46:10 +08:00
Henry Li b7c9bf557b feat: update button styling for artifacts tooltip 2026-02-02 11:43:02 +08:00
Henry Li 6c0e5fffd0 feat: integrate PromptInputProvider into ChatLayout and utilize prompt input controller in ChatPage 2026-02-02 10:18:02 +08:00
Henry Li 867749d7a3 feat: add file icons 2026-02-02 10:02:31 +08:00
Henry Li a0a3a3fc02 feat: dynamic title 2026-02-02 09:05:24 +08:00
Henry Li 9b77070406 feat: update skills 2026-02-01 11:12:08 +08:00
Henry Li bdd2e25e14 feat: implement create skill 2026-01-31 22:31:25 +08:00
Henry Li cf961328a9 feat: preview the message if possible 2026-01-31 20:22:15 +08:00
Henry Li 5295f5b5b9 feat: add notification 2026-01-31 11:08:27 +08:00
Henry Li c07c0228f6 fix: fix condition of displaying artifacts 2026-01-30 21:51:18 +08:00
Henry Li 62ac3b6b03 feat: use "mode" instead of "thinking_enabled" and "is_plan_mode" 2026-01-29 15:48:50 +08:00
hetao 75801d9817 fix: fix frontend bug 2026-01-29 13:55:30 +08:00
Henry Li 28361ca03c feat: add scroll indicator 2026-01-27 13:15:49 +08:00
Henry Li 598fed797f fix: many minor fixes 2026-01-25 21:57:57 +08:00
Henry Li c82f705541 fix: fix artifacts in demo mode 2026-01-25 11:42:25 +08:00
Henry Li 03b380cb8b fix: fix auto select first artifact 2026-01-24 23:59:41 +08:00
Henry Li a83e5e238d feat: auto expand in demo mode 2026-01-24 23:51:11 +08:00
Henry Li cae7e67a1f feat: remove over-scroll 2026-01-24 21:14:33 +08:00
Henry Li 930e6bd46f feat: remove background 2026-01-24 18:48:35 +08:00
Henry Li cd63f41b4c feat: support static website 2026-01-24 18:01:27 +08:00
Henry Li 3f4bcd9433 feat: implement the first version of landing page 2026-01-23 13:24:03 +08:00
Henry Li 307972f93e feat: implement the first section of landing page 2026-01-23 00:15:21 +08:00
Henry Li e9ab427326 feat: adjust styles 2026-01-22 14:28:10 +08:00
Henry Li 80b07bcac0 feat: update opacities 2026-01-22 13:50:09 +08:00
Henry Li 7d4d706738 feat: put all options into '+' 2026-01-22 13:43:45 +08:00
Henry Li 93842e81a4 feat: adjust styles 2026-01-22 11:42:25 +08:00
Henry Li e8e522c2fe feat: add animations 2026-01-22 09:41:01 +08:00
Henry Li 1e4e51a80c feat: add Todos 2026-01-22 00:26:11 +08:00
Henry Li fbe4d27ddd feat: use `resolvedTheme` instead of `systemTheme` 2026-01-21 10:48:29 +08:00
Henry Li e3d5b4960f feat: adjust colors 2026-01-21 10:35:50 +08:00
Henry Li 26587ee970 feat: bring back the deer 2026-01-21 10:31:54 +08:00
Henry Li d77b9922a6 feat: make artifact "floating" 2026-01-21 08:50:15 +08:00
Henry Li faba2784e1 feat: save locale in cookies 2026-01-20 16:00:39 +08:00
Henry Li 32a45eb043 feat: implement i18n 2026-01-20 14:06:47 +08:00
Henry Li dd80348b76 feat: support SSE write_file(0 2026-01-18 17:13:15 +08:00
Henry Li 7ea7a7864e feat: use default sidebar width 2026-01-17 22:01:08 +08:00
Henry Li caf761be59 fix: fix z index 2026-01-17 21:34:32 +08:00
Henry Li 094553ea42 feat: change light theme 2026-01-17 20:32:27 +08:00
Henry Li 2bc5f30c4d feat: welcome, again 2026-01-17 19:46:02 +08:00
Henry Li b705a44f3c feat: pull up the input box when creating new thread 2026-01-17 18:02:01 +08:00
Henry Li d8f0f91238 feat: extract ThreadTitle component 2026-01-17 17:37:12 +08:00
Henry Li f1c6991194 feat: integrated with artifacts in states 2026-01-17 17:21:37 +08:00
Henry Li 584eed0166 fix: do not display 'Untitled' 2026-01-17 15:48:43 +08:00
Henry Li 56da1c990a feat: implement '/chats' 2026-01-17 15:44:49 +08:00
Henry Li 962d8f04ec feat: support artifact preview 2026-01-17 15:09:44 +08:00
Henry Li ec5bbf6b51 feat: set artifacts layout 2026-01-17 11:02:33 +08:00
Henry Li 4613d6e16e refactor: rename 2026-01-17 00:05:19 +08:00
Henry Li 9d64c7e076 feat: integrated with artifacts 2026-01-17 00:02:03 +08:00
Henry Li 6464a67230 feat: remember sidebar state 2026-01-16 23:03:39 +08:00
Henry Li 93a231cfb1 feat: integrated with artifact resizable 2026-01-16 21:55:31 +08:00
Henry Li 03f0e3f0c7 refactor: move biz logic to core 2026-01-16 19:51:39 +08:00
Henry Li 6bd49ab411 chore: remove 2026-01-16 19:50:17 +08:00
Henry Li 2105170d39 Merge remote-tracking branch 'refs/remotes/origin/experimental' into experimental 2026-01-16 14:04:21 +08:00
Henry Li faf80bb429 feat: rename 'model' to 'model_name' 2026-01-16 14:03:34 +08:00
DanielWalnut 7284eb15f1 feat: add gateway module with FastAPI server (#5)
* chore: add .claude/ to .gitignore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add gateway module with FastAPI server

- Add new gateway module with FastAPI app for API routing
- Add gateway and serve commands to Makefile
- Add fastapi, httpx, uvicorn, sse-starlette dependencies
- Fix model config retrieval in lead_agent (support both model_name and model)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 13:22:26 +08:00
Henry Li 028f402ff5 feat: store the local settings 2026-01-16 09:55:02 +08:00
Henry Li 3f2bfded41 feat: enable edit context options 2026-01-16 09:37:04 +08:00
Henry Li 956f8f0cfb refactor: rename 2026-01-16 09:15:04 +08:00
Henry Li 08e0a1da16 chore: remove 2026-01-16 09:14:25 +08:00
Henry Li e9846c1dda refactor: refine folder structure and rename 2026-01-16 09:13:02 +08:00
Henry Li 9f2b94ed52 feat: implement basic web app 2026-01-15 23:40:21 +08:00
Henry Li c628c7f8db chore: create frontend project from boilerplate 2026-01-14 09:50:26 +08:00