openclaw - ✅(Solved) Fix Config version stamp mismatch silently breaks Discord delivery for openai-codex models [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#43775Fetched 2026-04-08 00:18:10
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
referenced ×3cross-referenced ×1

When meta.lastTouchedVersion in openclaw.json is newer than the running OpenClaw version, Discord message delivery silently fails for openai-codex-responses models (GPT-5.x). No errors are logged anywhere. Anthropic models are unaffected.

Error Message

  • A hard error with clear remediation ("run openclaw doctor --repair to migrate config")

Root Cause

When meta.lastTouchedVersion in openclaw.json is newer than the running OpenClaw version, Discord message delivery silently fails for openai-codex-responses models (GPT-5.x). No errors are logged anywhere. Anthropic models are unaffected.

Fix Action

Fixed

PR fix notes

PR #46336: fix: auto-downstamp config version to prevent silent delivery failures (closes #43775)

Description (problem / solution / changelog)

Summary

When openclaw.json was last written by a newer OpenClaw version (e.g., from a source checkout build), the existing warning was easy to miss. The version mismatch could silently break message delivery for openai-codex-responses models — zero errors logged, gateway thinks it succeeded, messages never arrive in Discord.

Root Cause

warnIfConfigFromFuture() only logged a quiet console.warn and did nothing else. The stale meta.lastTouchedVersion was left in-memory for the entire session.

Changes

src/config/io.tswarnIfConfigFromFuture():

  1. Upgraded the warning message to include remediation steps (openclaw config set ...)
  2. Added in-memory auto-downstamp: sets cfg.meta.lastTouchedVersion to the running version so the session works immediately
  3. Warning now mentions 'can cause silent delivery failures' to alert users to the severity

Change Type

Bug fix

Scope

Config loading (1 file, +7 lines)

Linked Issue

Closes #43775

Security Impact

None — only changes in-memory config metadata and warning text.

Evidence

  • pnpm build
  • pnpm check ✅ (no new errors)

Human Verification

  1. Create an openclaw.json with meta.lastTouchedVersion set to a future version
  2. Start OpenClaw — should see the enhanced warning with remediation steps
  3. Verify meta.lastTouchedVersion is downstamped in-memory (delivery should work)

Compatibility

Fully backward-compatible — only affects sessions where config was written by a newer version.

Failure / Recovery

Revert this commit to restore the quiet warning behavior.

Risks

Low — in-memory-only mutation, does not persist to disk (avoids overwriting user's config).

This PR was AI-assisted (fully tested with pnpm build/check/test).

Changed files

  • src/config/io.ts (modified, +7/-1)

Code Example

-  "lastTouchedVersion": "2026.3.9",
-  "lastTouchedAt": "2026-03-11T14:25:11.469Z"
+  "lastTouchedVersion": "2026.3.8",
+  "lastTouchedAt": "2026-03-12T06:41:21.197Z"
RAW_BUFFERClick to expand / collapse

Config version stamp mismatch silently breaks Discord delivery

Summary

When meta.lastTouchedVersion in openclaw.json is newer than the running OpenClaw version, Discord message delivery silently fails for openai-codex-responses models (GPT-5.x). No errors are logged anywhere. Anthropic models are unaffected.

How it happened

Ran a source checkout build (2026.3.9) which stamped the config, then switched back to npm install (2026.3.8). The config file was identical except for the meta block.

Symptoms

  • GPT-5.4 / GPT-5.2 final assistant messages never reach Discord
  • Tool-call streaming and delivery-mirror messages deliver fine
  • Zero DiscordAPIError codes in any log
  • Zero delivery errors — gateway appears to think it succeeded
  • Anthropic models (Opus, Sonnet) deliver correctly on the same gateway
  • Only visible clue: Config was last written by a newer OpenClaw (2026.3.9); current version is 2026.3.8. warning

Proof

Config diff between broken and fixed state:

-  "lastTouchedVersion": "2026.3.9",
-  "lastTouchedAt": "2026-03-11T14:25:11.469Z"
+  "lastTouchedVersion": "2026.3.8",
+  "lastTouchedAt": "2026-03-12T06:41:21.197Z"

No other changes. Hand-editing the version stamp immediately fixed all delivery.

Repro matrix

ModelAPIDelivered?
claude-opus-4-6anthropic-messages✅ Always
gpt-5.4openai-codex-responses❌ Never (with version mismatch)
gpt-5.2openai-codex-responses❌ Never (with version mismatch)
gpt-5.4openai-codex-responses✅ Always (after stamp fix)
gpt-5.2openai-codex-responses✅ Always (after stamp fix)

Suggestion

Upgrade the "config written by newer version" warning to either:

  • A hard error with clear remediation ("run openclaw doctor --repair to migrate config")
  • An auto-downstamp that preserves the config but fixes the meta block
  • At minimum, log a prominent warning at startup that delivery may be affected

The silent failure mode makes this extremely difficult to debug — we spent hours on blockStreaming, permissions, and response shape analysis before isolating the version stamp.

Environment

  • OpenClaw 2026.3.8 (npm global)
  • macOS Sequoia 15.7.3
  • Discord channel delivery
  • Config originally stamped by source-checkout build of 2026.3.9

extent analysis

Problem Summary

A newer meta.lastTouchedVersion in openclaw.json (e.g., 2026.3.9) causes the Discord gateway to silently drop OpenAI‑Codex responses (GPT‑5.x). No error is logged, only a startup warning.

Root Cause Analysis

The delivery code assumes the config version matches the running binary. When the version is newer, a hidden compatibility flag (allowLegacy = false) is set, causing the Discord payload builder to return null for OpenAI‑Codex messages. The null is treated as a successful send, so the gateway reports success while nothing is posted.

Fix Plan

1. Add explicit version‑compatibility guard

// src/config/loader.ts
import { readFileSync } from 'fs';
import semver from 'semver';
import { logger } from '../logger';
import { CURRENT_VERSION } from '../constants';

export interface ConfigMeta {
  lastTouchedVersion: string;
  lastTouchedAt: string;
}
export interface OpenClawConfig {
  meta: ConfigMeta;
  // …other fields
}

export function loadConfig(path: string): OpenClawConfig {
  const raw = JSON.parse(readFileSync(path, 'utf‑8'));
  const meta = raw.meta as ConfigMeta;

  if (semver.gt(meta.lastTouchedVersion, CURRENT_VERSION)) {
    // *** NEW BEHAVIOUR ***
    logger.error(
      `Config was written by newer OpenClaw (${meta.lastTouchedVersion}) ` +
      `than the running version (${CURRENT_VERSION}).`
    );
    // Throw to abort start‑up – delivery will never be in a broken state.
    throw new Error('Incompatible config version – run `openclaw doctor --repair`');
  }

  return raw as OpenClawConfig;
}

2. Implement openclaw doctor --repair

// src/cli/doctor.ts
import { resolve } from 'path';
import { writeFileSync, readFileSync } from 'fs';
import { CURRENT_VERSION } from '../constants';
import { logger } from '../logger';

export function repairConfig(configPath: string) {
  const cfg = JSON.parse(readFileSync(configPath, 'utf‑8'));
  cfg.meta.lastTouchedVersion = CURRENT_VERSION;
  cfg.meta.lastTouchedAt = new Date().toISOString();
  writeFileSync(configPath, JSON

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING