Skip to content

Conversation

@cc-yafei
Copy link
Collaborator

@cc-yafei cc-yafei commented Nov 24, 2025

Summary

  • Add prompt field to status.subTasks in the GET /users/{user_id}/kinds/{kinds}/{name} API response
  • The prompt field from the Subtask model is now included in the returned subtasks data

Changes

  • Modified TaskKindService._format_resource() method in backend/app/services/kind_impl.py
  • Added 'prompt': subtask.prompt to the subtask dictionary returned in the API response

Test plan

  • Verify the API response includes the prompt field for each subtask
  • Check that existing functionality remains unaffected
  • Test with tasks that have multiple subtasks

Summary by CodeRabbit

  • New Features
    • Subtask API responses now include a new "prompt" field, giving each subtask explicit instructions and context alongside existing metadata (title, role, executors, status, progress, results, errors, and timestamps).

✏️ Tip: You can customize this high-level summary in your review settings.

Update the TaskKindService to include the prompt field when returning
subtasks in the GET /users/{user_id}/kinds/{kinds}/{name} endpoint response.
@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Walkthrough

A new prompt field is added to each Task subtask dictionary in the API response formatting, included alongside existing attributes (title, role, bot_ids, executor details, status, progress, result, errorMessage, messageId, parentId, createdAt, updatedAt, completedAt).

Changes

Cohort / File(s) Summary
Task Subtask Response Enhancement
backend/app/services/kind_impl.py
Added prompt field to the subtask dictionary emitted in Task API response formatting

Sequence Diagram(s)

(No sequence diagram generated — change is a data-structure/serialization update.)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to: kind_impl.py subtask serialization location and any callers/consumers expecting exact subtask keys (tests or clients may need updates).

Poem

🐰 A prompt hops into each subtask's light,
Quietly tucked between title and plight,
One small field to guide the chat,
A tiny change — imagine that! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding a prompt field to subtasks in the API response, which matches the primary objective of the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch weagent/add-prompt-field-to-subtasks

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a881f1 and 9dcbb88.

📒 Files selected for processing (1)
  • backend/app/services/kind_impl.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • backend/app/services/kind_impl.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Adjust the order of fields in the subtasks dictionary to place
the prompt field immediately after the role field for better
readability and logical grouping.
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 participants