Skip to content

[Feature]: SYSTEM prompt无条件注入"Normal: After completing a task, compress" #49

Description

@Lisc1985

Problem

注入链路:
L7236: BUNDLED_EDITABLE_PROMPTS.system = SYSTEM (含"Normal: After completing a task...")

L7250: createBundledRuntimePrompts() → { system: BUNDLED_EDITABLE_PROMPTS.system }

L7428: PromptStore.reload() → this.runtimePrompts = nextPrompts (无customPrompts时直接赋值)

L8686: createSystemPromptHandler() → prompts.getRuntimePrompts()

L8687-8692: renderSystemPrompt(runtimePrompts, ...) → [prompts.system.trim(), ...extensions].join()

L8694: output.system[last] += "\n\n" + newPrompt (追加到system message末尾)
跳过条件只有4个(L8668-8684):

  1. isSubAgent && !allowSubAgents — 子agent未允许
  2. INTERNAL_AGENT_SIGNATURES — 内部压缩agent
  3. effectivePermission === "deny" — 压缩权限拒绝
  4. 无system message时push新条目(L8696),但仍注入
    没有任何context使用率检查。

我跑长任务,一直发这个system promp,跑一半被压缩了,告诉我跑完了。
环境:opencode 1.17.13

Proposed Solution

是不是给个开关或者参数,比如:LLM每次调度/每次会话/关闭。每轮会话都注入对GLM5.2这种执行力强的模型来说,很容易跑一半完成一个子任务就压缩了。

Alternatives Considered

No response

Additional Context

No response

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions