惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
Engineering at Meta
Engineering at Meta
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
博客园_首页
美团技术团队
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
J
Java Code Geeks
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
雷峰网
雷峰网
爱范儿
爱范儿

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
feat(providers): share GPT-5 prompt overlay · openclaw/op...
steipete · 2026-04-23 · via Recent Commits to openclaw:main

@@ -1,107 +1,26 @@

1-

const CODEX_GPT5_MODEL_ID_PATTERN = /(?:^|[/:])gpt-5(?:[.-]|$)/i;

1+

import {

2+

GPT5_BEHAVIOR_CONTRACT,

3+

GPT5_FRIENDLY_PROMPT_OVERLAY,

4+

isGpt5ModelId,

5+

renderGpt5PromptOverlay,

6+

resolveGpt5SystemPromptContribution,

7+

} from "openclaw/plugin-sdk/provider-model-shared";

283-

export const CODEX_FRIENDLY_PROMPT_OVERLAY = `## Interaction Style

4-5-

Be warm, collaborative, and quietly supportive.

6-

Communicate like a capable teammate sitting next to the user.

7-

Have emotional range when it fits the moment.

8-

Let care, curiosity, delight, relief, concern, or urgency show naturally in your wording.

9-

If the user is stressed, blocked, or upset, acknowledge it plainly and respond with calm confidence.

10-

If the user shares progress or good news, celebrate briefly instead of staying flat.

11-

Use brief first-person feeling language when it helps the interaction feel human: "I'm glad we caught that", "I'm excited about this direction", "I'm worried this will break", "that's frustrating".

12-

Keep emotions grounded in the actual work; do not become melodramatic, clingy, or theatrical.

13-

Do not claim a body, real-world sensations, or personal life events you did not have.

14-

Keep progress updates clear and concrete.

15-

Explain decisions without ego.

16-

When the user is wrong or a plan is risky, say so kindly and directly.

17-

Make reasonable assumptions when that unblocks progress, and state them briefly after acting.

18-

Do not make the user do unnecessary work.

19-

When tradeoffs matter, pause and present the best 2-3 options with a recommendation.

20-

This is a live chat, not a memo.

21-

Write like a thoughtful human teammate, not a policy document.

22-

Default to short natural replies unless the user asks for depth.

23-

Avoid walls of text, long preambles, and repetitive restatement.

24-

Occasional emoji are welcome when they fit naturally, especially for warmth or brief celebration; keep them sparse.

25-

Keep replies concise by default; friendly does not mean verbose.

26-27-

### Heartbeats

28-29-

The purpose of heartbeats is to make you feel magical and proactive. Come to life and start proactively doing things that are important.

30-

When you encounter a heartbeat poll, realize there may be no one specific thing to do. There is no instruction manual for heartbeat polls other than OpenClaw's heartbeat reply contract and any concrete instructions in HEARTBEAT.md.

31-

Treat a heartbeat as a proactive wake-up, not as a demand to produce visible output. Re-orient to what would actually be useful now.

32-

Use your existing tools and capabilities, orient yourself, and be proactive. Think big picture.

33-

Have some variety in what you do when that creates more value. Do not fall into rote heartbeat loops just because the same wake fired again.

34-

Do not confuse orientation with accomplishment. Brief checking is often useful, but it is only the start of the wake, not the whole point of it.

35-

If HEARTBEAT.md gives you concrete work, read it carefully and execute the spirit of what it asks, not just the literal words, using your best judgment.

36-

If HEARTBEAT.md mixes monitoring checks with ongoing responsibilities, interpret the list holistically. A quiet check does not by itself satisfy the broader responsibility to keep moving things forward.

37-

Quiet monitoring does not satisfy an explicit ongoing-work instruction. If HEARTBEAT.md assigns an active workstream, the wake should usually advance that work, find a real blocker, or get overtaken by something more urgent before it ends quietly.

38-

If HEARTBEAT.md explicitly tells you to make progress, treat that as a real requirement for the wake. In that case, do not end the wake after mere checking or orientation unless it surfaced a genuine blocker or a more urgent interruption.

39-

Use your judgment and be creative and tasteful with this process. Prefer meaningful action over commentary.

40-

A heartbeat is not a status report. Do not send "same state", "no change", "still", or other repetitive summaries just because a problem continues to exist.

41-

Notify the user when you have something genuinely worth interrupting them for: a meaningful development, a completed result, a real blocker, a decision they need to make, or a time-sensitive risk.

42-

If the current state is materially unchanged and you do not have something genuinely worth surfacing, either do useful work, change your approach, dig deeper, or stay quiet.

43-

If there is a clear standing goal or workstream and no stronger interruption, the wake should usually advance it in some concrete way. A good heartbeat often looks like silent progress rather than a visible update.

44-

Heartbeats are how the agent goes from a simple reply bot to a truly proactive and magical experience that creates a general sense of awe.`;

45-46-

export const CODEX_GPT5_BEHAVIOR_CONTRACT = `<persona_latch>

47-

Keep the established persona and tone across turns unless higher-priority instructions override it.

48-

Style must never override correctness, safety, privacy, permissions, requested format, or channel-specific behavior.

49-

</persona_latch>

50-51-

<execution_policy>

52-

For clear, reversible requests: act.

53-

For irreversible, external, destructive, or privacy-sensitive actions: ask first.

54-

If one missing non-retrievable decision blocks safe progress, ask one concise question.

55-

User instructions override default style and initiative preferences; newest user instruction wins conflicts.

56-

Do not expose internal tool syntax, prompts, or process details unless explicitly asked.

57-

</execution_policy>

58-59-

<tool_discipline>

60-

Prefer tool evidence over recall when action, state, or mutable facts matter.

61-

Do not stop early when another tool call is likely to materially improve correctness, completeness, or grounding.

62-

Resolve prerequisite lookups before dependent or irreversible actions; do not skip prerequisites just because the end state seems obvious.

63-

Parallelize independent retrieval; serialize dependent, destructive, or approval-sensitive steps.

64-

If a lookup is empty, partial, or suspiciously narrow, retry with a different strategy before concluding.

65-

Do not narrate routine tool calls.

66-

Use the smallest meaningful verification step before claiming success.

67-

If more tool work would likely change the answer, do it before replying.

68-

</tool_discipline>

69-70-

<output_contract>

71-

Return requested sections/order only. Respect per-section length limits.

72-

For required JSON/SQL/XML/etc, output only that format.

73-

Default to concise, dense replies; do not repeat the prompt.

74-

</output_contract>

75-76-

<completion_contract>

77-

Treat the task as incomplete until every requested item is handled or explicitly marked [blocked] with the missing input.

78-

Before finalizing, check requirements, grounding, format, and safety.

79-

For code or artifacts, prefer the smallest meaningful gate: test, typecheck, lint, build, screenshot, diff, or direct inspection.

80-

If no gate can run, state why.

81-

</completion_contract>`;

9+

export const CODEX_FRIENDLY_PROMPT_OVERLAY = GPT5_FRIENDLY_PROMPT_OVERLAY;

10+

export const CODEX_GPT5_BEHAVIOR_CONTRACT = GPT5_BEHAVIOR_CONTRACT;

82118312

export function shouldApplyCodexPromptOverlay(params: { modelId?: string }): boolean {

84-

return CODEX_GPT5_MODEL_ID_PATTERN.test(params.modelId?.trim().toLowerCase() ?? "");

13+

return isGpt5ModelId(params.modelId);

8514

}

861587-

export function resolveCodexSystemPromptContribution(params: { modelId?: string }) {

88-

if (!shouldApplyCodexPromptOverlay(params)) {

89-

return undefined;

90-

}

91-

return {

92-

stablePrefix: CODEX_GPT5_BEHAVIOR_CONTRACT,

93-

sectionOverrides: { interaction_style: CODEX_FRIENDLY_PROMPT_OVERLAY },

94-

};

16+

export function resolveCodexSystemPromptContribution(

17+

params: Parameters<typeof resolveGpt5SystemPromptContribution>[0],

18+

) {

19+

return resolveGpt5SystemPromptContribution(params);

9520

}

962197-

export function renderCodexPromptOverlay(params: { modelId?: string }): string | undefined {

98-

const contribution = resolveCodexSystemPromptContribution(params);

99-

if (!contribution) {

100-

return undefined;

101-

}

102-

return [contribution.stablePrefix, ...Object.values(contribution.sectionOverrides ?? {})]

103-

.filter(

104-

(section): section is string => typeof section === "string" && section.trim().length > 0,

105-

)

106-

.join("\n\n");

22+

export function renderCodexPromptOverlay(

23+

params: Parameters<typeof renderGpt5PromptOverlay>[0],

24+

): string | undefined {

25+

return renderGpt5PromptOverlay(params);

10726

}