cotabby
cotabby copied to clipboard
Build Compose Mode request and prompt construction
Problem
Autocomplete prompts are optimized for short continuations. Compose Mode needs a different request contract that can ask for a full draft while still respecting local context, user instructions, output limits, and insertion safety.
Goal
Create the generation request and prompt foundation for longer Compose outputs without weakening the existing autocomplete prompt path.
Proposed Scope
- Add a Compose-specific request shape or prompt mode.
- Define how prefix, selected text, app metadata, custom instructions, and future context sources are included.
- Set length, stop, and formatting constraints appropriate for whole comments/emails.
- Decide how Compose Mode should handle empty prefixes and ambiguous context.
- Add normalization rules for full drafts that differ from inline continuations.
- Keep prompt construction testable as pure logic where possible.
Acceptance Criteria
- Compose requests are distinct from autocomplete requests.
- Prompt construction has unit coverage for comments, email replies, empty prefix, and selected text cases.
- Output limits are explicit and bounded.
- Existing autocomplete prompts continue to produce the same shape as before.
- The design can support both Open Source and Apple Intelligence engines where available.
Open Questions
- Should Compose Mode require selected text or enough surrounding context?
- Should the model produce only the inserted draft or include explanatory text that gets stripped?
- Should custom instructions always apply in Compose Mode?
Parent: #66
Closing for OSS launch cleanup. Part of speculative Compose Mode epic (#66).