Skip to content

Commit d1b4dee

Browse files
committed
Auto-merge upstream openclaw/openclaw
2 parents f5420a2 + 38135ff commit d1b4dee

35 files changed

Lines changed: 837 additions & 373 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ Docs: https://docs.openclaw.ai
1818

1919
### Fixes
2020

21+
- Gateway/pairing: treat any forwarded-header evidence (`Forwarded`, `X-Forwarded-*`, or `X-Real-IP`) as proxied WebSocket traffic before pairing locality checks, so reverse-proxy topologies cannot use the loopback shared-secret helper auto-pairing path.
2122
- Gateway/pairing webchat: render `/pair qr` replies as structured media instead of raw markdown text, preserve inline reply threading and silent-control handling on media replies, avoid persisting sensitive QR images into transcript history, and keep local webchat media embedding behind internal-only trust markers. (#70047) Thanks @BunsDev.
2223
- Codex harness: default app-server runs to unchained local execution, so OpenAI heartbeats can use network and shell tools without stalling behind native Codex approvals or the workspace-write sandbox.
24+
- Codex harness: apply the GPT-5 behavior and heartbeat prompt overlay to native Codex app-server runs, so `codex/gpt-5.x` sessions get the same follow-through, tool-use, and proactive heartbeat guidance as OpenAI GPT-5 runs.
2325
- OpenAI/Responses: keep embedded OpenAI Responses runs on HTTP when `models.providers.openai.baseUrl` points at a local mock or other non-public endpoint, so mocked/custom endpoints no longer drift onto the hardcoded public websocket transport. (#69815) Thanks @vincentkoc.
2426
- Channels/config: require resolved runtime config on channel send/action/client helpers and block runtime helper `loadConfig()` calls, so SecretRefs are resolved at startup/boundaries instead of being re-read during sends.
2527
- CLI/channels: preserve bundled setup promotion metadata when a loaded partial channel plugin omits it, so adding a non-default account still moves legacy single-account fields such as Telegram `streaming` into `accounts.default`.
2628
- Telegram: keep the sent-message ownership cache isolated per configured session store, so own-message reaction filtering remains correct with custom `session.store` paths.
29+
- Security/update: fail closed when exact pinned npm plugin or hook-pack updates detect integrity drift, and expose aborted plugin drift details in `openclaw update --json`.
2730
- Ollama: forward OpenClaw thinking control to native `/api/chat` requests as top-level `think`, so `/think off` and `openclaw agent --thinking off` suppress thinking on models such as qwen3 instead of idling until the watchdog fires. Fixes #69902. (#69967) Thanks @WZH8898.
2831
- Memory-core/dreaming: suppress the startup-only managed dreaming cron unavailable warning when the cron service is still attaching, while preserving the runtime warning if cron genuinely remains unavailable. Fixes #69939. (#69941) Thanks @Sanjays2402.
2932
- Mattermost: suppress reasoning-only payloads even when they arrive as blockquoted `> Reasoning:` text, preventing `/reasoning on` from leaking thinking into channel posts. (#69927) Thanks @lawrence3699.

docs/ci.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ GitHub may mark superseded jobs as `cancelled` when a newer push lands on the sa
5757

5858
## Runners
5959

60-
| Runner | Jobs |
61-
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
62-
| `ubuntu-24.04` | `preflight`; install-smoke preflight also uses GitHub-hosted Ubuntu so the Blacksmith matrix can queue earlier |
63-
| `blacksmith-16vcpu-ubuntu-2404` | `security-scm-fast`, `security-dependency-audit`, `security-fast`, `build-artifacts`, Linux checks, docs checks, Python skills, `android` |
64-
| `blacksmith-32vcpu-windows-2025` | `checks-windows` |
65-
| `blacksmith-12vcpu-macos-latest` | `macos-node`, `macos-swift` on `openclaw/openclaw`; forks fall back to `macos-latest` |
60+
| Runner | Jobs |
61+
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
62+
| `ubuntu-24.04` | `preflight`, short aggregate verifier jobs (`security-fast`, `check`, `check-additional`, `checks-fast-contracts-channels`); install-smoke preflight also uses GitHub-hosted Ubuntu so the Blacksmith matrix can queue earlier |
63+
| `blacksmith-8vcpu-ubuntu-2404` | `security-scm-fast`, `security-dependency-audit`, `build-artifacts`, Linux checks except `check-lint`, long-matrix aggregate verifiers, docs checks, Python skills, `android` |
64+
| `blacksmith-16vcpu-ubuntu-2404` | `check-lint`, which remains CPU-sensitive enough that 8 vCPU cost more than it saved |
65+
| `blacksmith-16vcpu-windows-2025` | `checks-windows` |
66+
| `blacksmith-6vcpu-macos-latest` | `macos-node` on `openclaw/openclaw`; forks fall back to `macos-latest` |
67+
| `blacksmith-12vcpu-macos-latest` | `macos-swift` on `openclaw/openclaw`; forks fall back to `macos-latest` |
6668

6769
## Local Equivalents
6870

docs/cli/plugins.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,10 @@ record, updates that installed plugin, and records the new npm spec for future
244244
id-based updates.
245245

246246
When a stored integrity hash exists and the fetched artifact hash changes,
247-
OpenClaw prints a warning and asks for confirmation before proceeding. Use
248-
global `--yes` to bypass prompts in CI/non-interactive runs.
247+
OpenClaw treats that as npm artifact drift. The interactive
248+
`openclaw plugins update` command prints the expected and actual hashes and asks
249+
for confirmation before proceeding. Non-interactive update helpers fail closed
250+
unless the caller supplies an explicit continuation policy.
249251

250252
`--dangerously-force-unsafe-install` is also available on `plugins update` as a
251253
break-glass override for built-in dangerous-code scan false positives during

docs/cli/update.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ openclaw --update
3636
- `--channel <stable|beta|dev>`: set the update channel (git + npm; persisted in config).
3737
- `--tag <dist-tag|version|spec>`: override the package target for this update only. For package installs, `main` maps to `github:openclaw/openclaw#main`.
3838
- `--dry-run`: preview planned update actions (channel/tag/target/restart flow) without writing config, installing, syncing plugins, or restarting.
39-
- `--json`: print machine-readable `UpdateRunResult` JSON.
39+
- `--json`: print machine-readable `UpdateRunResult` JSON, including
40+
`postUpdate.plugins.integrityDrifts` when npm plugin artifact drift is
41+
detected during post-update plugin sync.
4042
- `--timeout <seconds>`: per-step timeout (default is 1200s).
4143
- `--yes`: skip confirmation prompts (for example downgrade confirmation)
4244

@@ -101,6 +103,11 @@ High-level:
101103
8. Runs `openclaw doctor` as the final “safe update” check.
102104
9. Syncs plugins to the active channel (dev uses bundled extensions; stable/beta uses npm) and updates npm-installed plugins.
103105

106+
If an exact pinned npm plugin update resolves to an artifact whose integrity
107+
differs from the stored install record, `openclaw update` aborts that plugin
108+
artifact update instead of installing it. Reinstall or update the plugin
109+
explicitly only after verifying that you trust the new artifact.
110+
104111
If pnpm bootstrap still fails, the updater now stops early with a package-manager-specific error instead of trying `npm run build` inside the checkout.
105112

106113
## `--update` shorthand

docs/providers/openai.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ See [Video Generation](/tools/video-generation) for shared tool parameters, prov
224224

225225
OpenClaw adds an OpenAI-specific GPT-5 prompt contribution for `openai/*` and `openai-codex/*` GPT-5-family runs. It lives in the bundled OpenAI plugin, applies to model ids such as `gpt-5`, `gpt-5.2`, `gpt-5.4`, and `gpt-5.4-mini`, and does not apply to older GPT-4.x models.
226226

227+
The bundled native Codex harness provider (`codex/*`) applies the same GPT-5 behavior and heartbeat overlay through Codex app-server developer instructions, so `codex/gpt-5.x` sessions keep the same follow-through and proactive heartbeat guidance even though Codex owns the rest of the harness prompt.
228+
227229
The GPT-5 contribution adds a tagged behavior contract for persona persistence, execution safety, tool discipline, output shape, completion checks, and verification. Channel-specific reply and silent-message behavior stays in the shared OpenClaw system prompt and outbound delivery policy. The GPT-5 guidance is always enabled for matching models. The friendly interaction-style layer is separate and configurable.
228230

229231
| Value | Effect |

extensions/codex/prompt-overlay.ts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
const CODEX_GPT5_MODEL_ID_PATTERN = /(?:^|[/:])gpt-5(?:[.-]|$)/i;
2+
3+
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>`;
82+
83+
export function shouldApplyCodexPromptOverlay(params: { modelId?: string }): boolean {
84+
return CODEX_GPT5_MODEL_ID_PATTERN.test(params.modelId?.trim().toLowerCase() ?? "");
85+
}
86+
87+
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+
};
95+
}
96+
97+
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");
107+
}

extensions/codex/provider.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { afterEach, describe, expect, it, vi } from "vitest";
2+
import { CODEX_GPT5_BEHAVIOR_CONTRACT } from "./prompt-overlay.js";
23
import { buildCodexProvider, buildCodexProviderCatalog } from "./provider.js";
34
import { CodexAppServerClient } from "./src/app-server/client.js";
45
import {
@@ -176,4 +177,33 @@ describe("codex provider", () => {
176177
mode: "token",
177178
});
178179
});
180+
181+
it("adds the GPT-5 prompt overlay to Codex provider runs", () => {
182+
const provider = buildCodexProvider();
183+
184+
expect(
185+
provider.resolveSystemPromptContribution?.({
186+
provider: "codex",
187+
modelId: "gpt-5.4",
188+
} as never),
189+
).toEqual({
190+
stablePrefix: CODEX_GPT5_BEHAVIOR_CONTRACT,
191+
sectionOverrides: {
192+
interaction_style: expect.stringContaining(
193+
"Quiet monitoring does not satisfy an explicit ongoing-work instruction.",
194+
),
195+
},
196+
});
197+
});
198+
199+
it("does not add the GPT-5 prompt overlay to non-GPT-5 Codex provider runs", () => {
200+
const provider = buildCodexProvider();
201+
202+
expect(
203+
provider.resolveSystemPromptContribution?.({
204+
provider: "codex",
205+
modelId: "o4-mini",
206+
} as never),
207+
).toBeUndefined();
208+
});
179209
});

extensions/codex/provider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
type CodexAppServerModel,
1111
type CodexAppServerModelListResult,
1212
} from "./harness.js";
13+
import { resolveCodexSystemPromptContribution } from "./prompt-overlay.js";
1314
import {
1415
type CodexAppServerStartOptions,
1516
readCodexPluginConfig,
@@ -99,6 +100,8 @@ export function buildCodexProvider(options: BuildCodexProviderOptions = {}): Pro
99100
...(isKnownXHighCodexModel(modelId) ? [{ id: "xhigh" as const }] : []),
100101
],
101102
}),
103+
resolveSystemPromptContribution: ({ modelId }) =>
104+
resolveCodexSystemPromptContribution({ modelId }),
102105
isModernModelRef: ({ modelId }) => isModernCodexModel(modelId),
103106
};
104107
}

extensions/codex/src/app-server/protocol.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export type CodexThreadResumeParams = {
7474
approvalsReviewer?: "user" | "guardian_subagent";
7575
sandbox?: "read-only" | "workspace-write" | "danger-full-access";
7676
serviceTier?: string | null;
77+
baseInstructions?: string | null;
78+
developerInstructions?: string | null;
7779
persistExtendedHistory?: boolean;
7880
};
7981

0 commit comments

Comments
 (0)