Feature/ai nl parser - #16
Merged
Merged
Conversation
…implicit tags Why: - "Buy milk and body wash tomorrow" was parsed as add "buy milk" due:tomorrow +bodywash — the model split a compound description and invented a tag from content words What: - Add explicit rules: keep the full description intact, never infer tags from description words, only extract attributes the user explicitly stated - Add examples covering compound descriptions and multi-item tasks - Rename the tags example to show explicit tag request phrasing Impact: - No code change; prompt-only fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Why: - Users had no way to fix a slightly-off AI parse without re-running the command - mod/done/delete examples were missing from the system prompt so the AI guessed poorly on existing-task operations What: - Replace yes/no confirm with questionary.text pre-filled with the parsed command; user can edit with arrow keys before a final Execute? confirm - Empty/cleared command exits cleanly without executing - Add mod/done/delete/clear-attribute examples to the system prompt so the AI reliably handles "mark task 5 done", "change priority of 7 to high", etc. Impact: - UX change only for twf ai; all other commands unchanged Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erations Why: - Task IDs are ephemeral and hard to reference; users naturally think in terms of descriptions, tags, and dates when referring to existing tasks What: - System prompt: replace ID-based examples with filter expressions (description.contains:, +tag, due:date, wait.any:, project:, priority:) and add rules 5-7 explicitly forbidding numeric ID filters - Add filter attribute reference section to system prompt - main.py: after user edits the command, extract the filter portion of non-add commands (mod/done/delete/start/stop/complete/annotate) and run `task <filter>` to preview matching tasks before the Execute? confirm; exit cleanly if no tasks match Impact: - "mark the buy milk task as done" → description.contains:"buy milk" done → shows matching tasks → confirm → executes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Why: - Models were hardcoded; users may want to switch to a faster/cheaper or more capable model without touching source code What: - ai.py: expose DEFAULT_MODELS dict; _parse_with_* and parse_nl_to_command accept optional model param, falling back to DEFAULT_MODELS[provider] - main.py: add --model / -m CLI flag; resolution order: CLI flag > TW_AI_MODEL env var > ai.<provider>_model in TW_CONFIG > default - __init__.py + conftest.py: add anthropic_model / openai_model fields to default and test config (empty string = use default) Impact: twf ai "..." --model claude-opus-4-7 TW_AI_MODEL=gpt-4o twf ai "..." TW_CONFIG ai.anthropic_model = "claude-opus-4-7" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.