Skip to content

Compaction: Structured BUILD-mode handoff summary prompt #49

@riatzukiza

Description

@riatzukiza

Epic: #46

Summary

Replace the “concise summary” with a structured BUILD‑mode handoff that reliably carries context needed to continue work.

Problem

  • Current prompt is too light; compaction leads to context loss and poor continuation.

Proposal

Adopt a compact, structured handoff format with sections:

  1. Primary Request and Intent
  2. Key Technical Concepts
  3. Files and Code Sections (include snippets when essential)
  4. Errors and Fixes
  5. Problem Solving
  6. All user messages (non‑tool) recap
  7. Pending Tasks
  8. Current Work (last active step)
  9. Rules & Constraints (tie‑in with rules preservation)
  10. Optional Next Step (strictly aligned with the latest user request)

Code Refs

  • packages/opencode/src/session/compaction.ts:169 (user content for summary message)
  • packages/opencode/src/session/system.ts (SystemPrompt.summarize)

Tasks

  • Implement new summary content (token‑aware; keep concise but structured)
  • Ensure compatibility with smaller context windows
  • Add config guard to toggle “verbose handoff” vs “lite” modes if necessary

Acceptance Criteria

  • After compaction, model resumes work accurately in BUILD mode without re‑asking for context.
  • Summary includes “Current Work” and “Rules & Constraints” reliably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions