AI features: OpenRouter client, task breakdown and task why - #9
Merged
Merged
Conversation
… Ctrl-C The plan's sequential flag sets the target task's own type, which also governs pre-existing subtasks. The prompt now states that, the preview warns when the type would change and how many existing subtasks are affected, and the breakdown request aborts cleanly on Ctrl-C like why. Claude-Session: https://claude.ai/code/session_01L2voqEC2eEwLsiTxoSnCGD
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.
Summary
src/core/ai/: anAIClientinterface (chat, stream, structured) injected next to the OmniFocus client into every verb viabuildProgram(client, ai). The OpenRouter SDK (pinned 1.2.100) lives in one adapter file and is imported lazily; a static-scan test enforces that non-AI runs never load it.--model>$OF_AI_MODEL>~/.config/omnifocus-cli/config.json> defaultgoogle/gemini-3.8-flash; key from$OPENROUTER_API_KEYor the config file, with an actionable error when missing.src/prompts/, embedded in the binary and overridable per user in~/.config/omnifocus-cli/prompts/.of task breakdown <ref>(of t b): structured-output plan (flat list with parent keys, validated, one repair retry) built from a newtask.contextbridge op; preview → revise with feedback → apply as onetask.createTreebridge call.--jsonprints the plan and changes nothing;--json --applyapplies. The preview warns when the target's sequential/parallel type would change.of task why [ref](of t w): streamed five-whys coaching session, one question per turn, ends only on Esc, Ctrl-C, Ctrl-D or/quit. Terminal-only.ui/prompt.ts(Esc/Ctrl-C/Ctrl-D//quithandling) andwithSpinner.Test plan
bun run check,bun run typecheck,bun test(427 tests; no OmniFocus or network needed — OpenRouter adapter tested with the real SDK against a local fake endpoint)task.contextverified against the live OmniFocus databaseof task breakdown … --jsonagainst OpenRouter with a valid key