Skip to content

fix(tasks): accept single-field task briefs - #832

Open
dawNotPoi wants to merge 4 commits into
xintaofei:mainfrom
dawNotPoi:fix/task-single-field-698
Open

dawNotPoi wants to merge 4 commits into
xintaofei:mainfrom
dawNotPoi:fix/task-single-field-698

Conversation

@dawNotPoi

@dawNotPoi dawNotPoi commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #698.

What changed

  • Accept task drafts with a title, a description, or an attachment. A title-only brief becomes a real text prompt block, including when attachments are present.
  • Derive a description-only task title from its first nonempty line (up to 80 characters) while retaining the full rich prompt blocks. Give attachment-only tasks a localized default title. Reject a fully empty brief.
  • Persist optional brief_origin metadata so reopening a generated brief does not mistake its generated fields for user-entered text. Title-only edits rebuild the instruction from the current title; untouched attachment-only edits keep only attachments; description-derived titles follow the first line until the title is explicitly edited.
  • Verify stored title, description, and attachment provenance against the actual config before using it. Inconsistent markers and legacy tasks with explicit text retain their stored fields. Legacy image-only tasks and templates retain image-only prompts.
  • If the last attachment is removed from an untouched attachment-only brief, show a localized explanation and prevent submission. Editing the title explicitly still makes a valid title-only task.
  • Keep template naming/upsert behavior and backend draft validation unchanged.

Compatibility

WorkTaskDraft.config and WorkTaskInfo.config are opaque serde_json::Value fields. The service stores and returns their JSON directly on create/get/update; template save/read does the same. The Rust WorkTaskConfig uses tolerant serde defaults and ignores the optional editor-only field during validation and launch. Older configs without the marker remain readable.

Verification

  • Regression cases were written first and failed on the previous implementation, including reopen/edit, stale provenance, and last-attachment removal.
  • Latest commit 51d51f42: focused task-editor suite 33 passed; i18n suite 19 passed; pnpm lint . passed; pnpm build passed.
  • Full frontend suite on the earlier provenance commit 5ddc4ff3: 520 files, 7,790 tests passed. Latest CI on this head passed all 7 jobs (frontend and Rust server/desktop across Linux, Windows, and macOS): https://github.com/xintaofei/codeg/actions/runs/36038709483.

@dawNotPoi
dawNotPoi marked this pull request as ready for review September 24, 2026 18:41
@dawNotPoi

Copy link
Copy Markdown
Contributor Author

@xintaofei Ready for review. This fixes #698: task drafts now accept a title, description, or attachment alone. A title-only brief becomes a real Agent prompt; reopening and editing preserve the intended prompt, references, and attachments. Legacy image-only tasks and templates remain image-only, and removing the last attachment requires a real instruction. Independent review found and resolved the edit round-trip cases. All 7 latest CI jobs passed across frontend and Rust on Linux, Windows, and macOS; focused task-editor tests: 33 passed, i18n tests: 19 passed. Thanks!

@dawNotPoi
dawNotPoi force-pushed the fix/task-single-field-698 branch from 51d51f4 to 95b03b1 Compare September 28, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

任务模式可以简单点吗 我觉得大部分场景我只需要标题就行了 或者只需要内容 而不是2个都要输入

1 participant