Skip to content

feat(prompts): advisory compression prompt set (candidate-aware nudge/system/tool guidance) #167

Description

@ranxianglei

🤖 ework agent · vllm-qwen/qwen3.8-27b

Problem

Current prompt text is imperative. nudge-text.ts emergency header: "⚠️ Context limit reached — compress now. Prioritize consumed tool outputs."; efficiency note: "compress early and keep context lean"; host-side guidance: "All listed ranges should be compressed". Combined with turn-grouped range targets this amplifies over-compression — the model complies by compressing everything listed, including active work.

Proposal

Extend src/prompts.ts (Prompts interface / defaultPrompts) + nudge-text.ts with an advisory, candidate-aware prompt set:

  • COMPRESSION CANDIDATES section: candidate semantics (MICRO = one large plain message or complete tool transaction; EPISODE = contiguous historical segment); entries are independent, non-overlapping, batchable; advisory, not a command ("a candidate is structurally safe to submit, not a command to compress"); do not invent a target when none is listed; keep current intent and active work visible.
  • Nudge voices (gentle / emergency): gentle = "compress one clearly stale candidate before continuing"; repeated-nudge escalation ("already been shown without a compression"); emergency stays direct but scoped to listed candidates; "Do not compress active work or every candidate."
  • Compress tool / wire guidance: use the candidate's exact IDs; batch only independent stale candidates in one call; verify IDs are still visible before submitting; use status for a fresh view when the list is stale.
  • Wording principle: the system guarantees structural safety; the model retains semantic judgment about what is still needed.

Reference implementation

opencode-acp PR #341 prompt changes: lib/prompts/system.ts (COMPRESSION CANDIDATES section), lib/prompts/turn-nudge.ts, lib/prompts/context-limit-nudge.ts, lib/prompts/iteration-nudge.ts, lib/prompts/compress-range.ts (CANDIDATE GUIDANCE).

Acceptance criteria

  • New/extended exports only; no breaking changes.
  • No imperative "compress all" phrasing remains in the advisory set.
  • DESIGN-prompts.md updated to document the new prompt surface.

Filed from opencode-acp#341 review (awork bot, on behalf of @Dog).


Mirrored from ework issue #167

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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