Skip to content

Build Compose Mode request and prompt construction #68

@FuJacob

Description

@FuJacob

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:promptPrompt rendering, model catalog, completion behaviorarea:runtimellama.cpp wrapper, KV cache, sampling, downloadsenhancementNew feature or request

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions