Skip to content

add todowrite tool result formatter#957

Draft
LasmarKhalifa wants to merge 1 commit into
06-16/tool-result-format-skillfrom
06-16/tool-result-format-todowrite
Draft

add todowrite tool result formatter#957
LasmarKhalifa wants to merge 1 commit into
06-16/tool-result-format-skillfrom
06-16/tool-result-format-todowrite

Conversation

@LasmarKhalifa

Copy link
Copy Markdown
Contributor

No description provided.

done = todos.count { |todo| todo[:status] == "completed" }
active = todos.find { |todo| todo[:status] == "in_progress" }
progress = "#{done}/#{todos.length} done" if todos.any?
active_label = truncate(active[:activeForm] || active[:content]) if active

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a todo has status: "in_progress" but neither :activeForm nor :content, the || chain returns nil and truncate(nil) would raise. For consistency with the .to_s pattern used elsewhere:

active_label = truncate((active[:activeForm] || active[:content]).to_s) if active

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