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

推荐订阅源

The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
S
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Recorded Future
Recorded Future
I
Intezer
云风的 BLOG
云风的 BLOG
博客园 - Franky
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
T
Tenable Blog
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Attack and Defense Labs
Attack and Defense Labs
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
The Cloudflare Blog
Webroot Blog
Webroot Blog
W
WeLiveSecurity
H
Heimdal Security Blog
博客园 - 三生石上(FineUI控件)
V
Vulnerabilities – Threatpost
G
Google Developers Blog
O
OpenAI News
V
V2EX
罗磊的独立博客
博客园_首页
N
News | PayPal Newsroom
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
H
Hacker News: Front Page
博客园 - 叶小钗
T
Tor Project blog
AI
AI

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix(codex): honor OAuth contextTokens in native harness · openclaw/openclaw@58f81b0
lilesjtu · 2026-05-06 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -143,6 +143,7 @@ Docs: https://docs.openclaw.ai

143143

- Agents/media: avoid direct generated-media completion fallback while the announce-agent run is still pending, so async video and music completions do not duplicate raw media messages. (#77754)

144144

- WebChat/Codex media: stage Codex app-server generated local images into managed media before Gateway display, so Codex-home image paths no longer hit `LocalMediaAccessError` while keeping Codex home out of the display allowlist. Thanks @frankekn.

145145

- Plugins/update: repair plugin-local `openclaw` peer links for all recorded npm plugins after any npm update mutates the shared managed npm tree, so targeted or batch updates cannot leave Codex, Discord, or Brave with pruned SDK imports. (#77787) Thanks @ProspectOre.

146+

- Codex harness: honor `models.providers.openai-codex.models[].contextTokens` for native `openai/*` Codex runtime runs and `/status` context reporting, so subscription-backed Codex agents use the configured OAuth context cap without inflating past the runtime model window. Fixes #77858. Thanks @lilesjtu.

146147

- TUI/sessions: bound the session picker to recent rows and use exact lookup-style refreshes for the active session, so dusty stores no longer make TUI hydrate weeks-old transcripts before becoming responsive. Thanks @vincentkoc.

147148

- Doctor/gateway: report recent supervisor restart handoffs in `openclaw doctor --deep`, using the installed service environment when available so service-managed clean exits are visible in guided diagnostics. Thanks @shakkernerd.

148149

- Gateway/status: show recent supervisor restart handoffs in `openclaw gateway status --deep`, including JSON details, so clean service-managed restarts are reported as restart handoffs instead of opaque stopped-service diagnostics. Thanks @shakkernerd.

Original file line numberDiff line numberDiff line change

@@ -35,6 +35,7 @@ type DiscoveredModel = {

3535

name?: string;

3636

provider: string;

3737

contextWindow?: number;

38+

contextTokens?: number;

3839

reasoning?: boolean;

3940

input?: ModelInputType[];

4041

compat?: ModelCatalogEntry["compat"];

@@ -161,6 +162,9 @@ export function loadManifestModelCatalog(params: {

161162

if (contextWindow) {

162163

entry.contextWindow = contextWindow;

163164

}

165+

if (row.contextTokens) {

166+

entry.contextTokens = row.contextTokens;

167+

}

164168

if (typeof row.reasoning === "boolean") {

165169

entry.reasoning = row.reasoning;

166170

}

@@ -189,6 +193,7 @@ function normalizePersistedModelCatalogEntry(

189193

entry: Record<string, unknown>,

190194

defaults?: {

191195

contextWindow?: number;

196+

contextTokens?: number;

192197

},

193198

): ModelCatalogEntry | undefined {

194199

const id = normalizeOptionalString(entry.id) ?? "";

@@ -206,6 +211,12 @@ function normalizePersistedModelCatalogEntry(

206211

: defaults?.contextWindow !== undefined

207212

? defaults.contextWindow

208213

: PI_CUSTOM_MODEL_DEFAULT_CONTEXT_WINDOW;

214+

const contextTokens =

215+

typeof entry?.contextTokens === "number" && entry.contextTokens > 0

216+

? entry.contextTokens

217+

: defaults?.contextTokens !== undefined

218+

? defaults.contextTokens

219+

: undefined;

209220

const reasoning = typeof entry?.reasoning === "boolean" ? entry.reasoning : false;

210221

const parsedInput = Array.isArray(entry?.input)

211222

? entry.input.filter((value): value is ModelInputType =>

@@ -217,7 +228,16 @@ function normalizePersistedModelCatalogEntry(

217228

entry?.compat && typeof entry.compat === "object"

218229

? (entry.compat as ModelCatalogEntry["compat"])

219230

: undefined;

220-

return { id, name, provider, contextWindow, reasoning, input, compat };

231+

return {

232+

id,

233+

name,

234+

provider,

235+

contextWindow,

236+

...(contextTokens !== undefined ? { contextTokens } : {}),

237+

reasoning,

238+

input,

239+

compat,

240+

};

221241

}

222242
223243

async function loadReadOnlyPersistedModelCatalog(params?: {

@@ -242,9 +262,14 @@ async function loadReadOnlyPersistedModelCatalog(params?: {

242262

typeof providerConfig?.contextWindow === "number" && providerConfig.contextWindow > 0

243263

? providerConfig.contextWindow

244264

: undefined;

265+

const providerContextTokens =

266+

typeof providerConfig?.contextTokens === "number" && providerConfig.contextTokens > 0

267+

? providerConfig.contextTokens

268+

: undefined;

245269

for (const entry of providerConfig.models as Record<string, unknown>[]) {

246270

const normalized = normalizePersistedModelCatalogEntry(providerRaw, entry, {

247271

contextWindow: providerContextWindow,

272+

contextTokens: providerContextTokens,

248273

});

249274

if (normalized && !shouldSuppressBuiltInModel(normalized)) {

250275

models.push(normalized);

@@ -370,10 +395,23 @@ export async function loadModelCatalog(params?: {

370395

typeof entry?.contextWindow === "number" && entry.contextWindow > 0

371396

? entry.contextWindow

372397

: undefined;

398+

const contextTokens =

399+

typeof entry?.contextTokens === "number" && entry.contextTokens > 0

400+

? entry.contextTokens

401+

: undefined;

373402

const reasoning = typeof entry?.reasoning === "boolean" ? entry.reasoning : undefined;

374403

const input = Array.isArray(entry?.input) ? entry.input : undefined;

375404

const compat = entry?.compat && typeof entry.compat === "object" ? entry.compat : undefined;

376-

models.push({ id, name, provider, contextWindow, reasoning, input, compat });

405+

models.push({

406+

id,

407+

name,

408+

provider,

409+

contextWindow,

410+

...(contextTokens !== undefined ? { contextTokens } : {}),

411+

reasoning,

412+

input,

413+

compat,

414+

});

377415

}

378416

if (!readOnly) {

379417

const supplemental = await augmentModelCatalogWithProviderPlugins({

Original file line numberDiff line numberDiff line change

@@ -8,6 +8,7 @@ export type ModelCatalogEntry = {

88

provider: string;

99

alias?: string;

1010

contextWindow?: number;

11+

contextTokens?: number;

1112

reasoning?: boolean;

1213

input?: ModelInputType[];

1314

compat?: ModelCompatConfig;

Original file line numberDiff line numberDiff line change

@@ -442,6 +442,7 @@ function applyModelCatalogMetadata(params: {

442442

}

443443

const nextAlias = alias ?? params.entry.alias;

444444

const nextContextWindow = configuredEntry?.contextWindow ?? params.entry.contextWindow;

445+

const nextContextTokens = configuredEntry?.contextTokens ?? params.entry.contextTokens;

445446

const nextReasoning = configuredEntry?.reasoning ?? params.entry.reasoning;

446447

const nextInput = configuredEntry?.input ?? params.entry.input;

447448

const nextCompat = configuredEntry?.compat ?? params.entry.compat;

@@ -451,6 +452,7 @@ function applyModelCatalogMetadata(params: {

451452

name: configuredEntry?.name ?? params.entry.name,

452453

...(nextAlias ? { alias: nextAlias } : {}),

453454

...(nextContextWindow !== undefined ? { contextWindow: nextContextWindow } : {}),

455+

...(nextContextTokens !== undefined ? { contextTokens: nextContextTokens } : {}),

454456

...(nextReasoning !== undefined ? { reasoning: nextReasoning } : {}),

455457

...(nextInput ? { input: nextInput } : {}),

456458

...(nextCompat ? { compat: nextCompat } : {}),

@@ -465,6 +467,7 @@ function buildSyntheticAllowedCatalogEntry(params: {

465467

const configuredEntry = params.metadata.configuredByKey.get(key);

466468

const alias = params.metadata.aliasByKey.get(key);

467469

const nextContextWindow = configuredEntry?.contextWindow;

470+

const nextContextTokens = configuredEntry?.contextTokens;

468471

const nextReasoning = configuredEntry?.reasoning;

469472

const nextInput = configuredEntry?.input;

470473

const nextCompat = configuredEntry?.compat;

@@ -475,6 +478,7 @@ function buildSyntheticAllowedCatalogEntry(params: {

475478

provider: params.parsed.provider,

476479

...(alias ? { alias } : {}),

477480

...(nextContextWindow !== undefined ? { contextWindow: nextContextWindow } : {}),

481+

...(nextContextTokens !== undefined ? { contextTokens: nextContextTokens } : {}),

478482

...(nextReasoning !== undefined ? { reasoning: nextReasoning } : {}),

479483

...(nextInput ? { input: nextInput } : {}),

480484

...(nextCompat ? { compat: nextCompat } : {}),

@@ -836,6 +840,10 @@ export function buildConfiguredModelCatalog(params: { cfg: OpenClawConfig }): Mo

836840

typeof model?.contextWindow === "number" && model.contextWindow > 0

837841

? model.contextWindow

838842

: undefined;

843+

const contextTokens =

844+

typeof model?.contextTokens === "number" && model.contextTokens > 0

845+

? model.contextTokens

846+

: undefined;

839847

const reasoning = typeof model?.reasoning === "boolean" ? model.reasoning : undefined;

840848

const input = Array.isArray(model?.input) ? model.input : undefined;

841849

const compat = model?.compat && typeof model.compat === "object" ? model.compat : undefined;

@@ -844,6 +852,7 @@ export function buildConfiguredModelCatalog(params: { cfg: OpenClawConfig }): Mo

844852

id,

845853

name,

846854

contextWindow,

855+

contextTokens,

847856

reasoning,

848857

input,

849858

compat,

Original file line numberDiff line numberDiff line change

@@ -181,6 +181,16 @@ const COMPACTION_CONTINUATION_RETRY_INSTRUCTION =

181181

"The previous attempt compacted the conversation context before producing a final user-visible answer. Continue from the compacted transcript and produce the final answer now. Do not restart from scratch, do not repeat completed work, and do not rerun tools unless the transcript clearly lacks required evidence.";

182182

type EmbeddedRunAttemptForRunner = Awaited<ReturnType<typeof runEmbeddedAttemptWithBackend>>;

183183
184+

function resolveHarnessContextConfigProvider(params: {

185+

provider: string;

186+

harnessId: string;

187+

}): string {

188+

if (params.harnessId === "codex" && params.provider.trim().toLowerCase() === "openai") {

189+

return "openai-codex";

190+

}

191+

return params.provider;

192+

}

193+
184194

function resolveEmbeddedRunLaneTimeoutMs(timeoutMs: number): number | undefined {

185195

if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {

186196

return undefined;

@@ -530,6 +540,10 @@ export async function runEmbeddedPiAgent(

530540

const resolvedRuntimeModel = resolveEffectiveRuntimeModel({

531541

cfg: params.config,

532542

provider,

543+

contextConfigProvider: resolveHarnessContextConfigProvider({

544+

provider,

545+

harnessId: agentHarness.id,

546+

}),

533547

modelId,

534548

runtimeModel,

535549

});

Original file line numberDiff line numberDiff line change

@@ -1,5 +1,12 @@

11

import { describe, expect, it, vi } from "vitest";

2-

import { buildBeforeModelResolveAttachments, resolveHookModelSelection } from "./setup.js";

2+

import type { ModelDefinitionConfig } from "../../../config/types.models.js";

3+

import type { OpenClawConfig } from "../../../config/types.openclaw.js";

4+

import type { ProviderRuntimeModel } from "../../../plugins/provider-runtime-model.types.js";

5+

import {

6+

buildBeforeModelResolveAttachments,

7+

resolveEffectiveRuntimeModel,

8+

resolveHookModelSelection,

9+

} from "./setup.js";

310
411

const hookContext = {

512

sessionId: "session-1",

@@ -73,3 +80,90 @@ describe("resolveHookModelSelection", () => {

7380

);

7481

});

7582

});

83+
84+

function createRuntimeModel(): ProviderRuntimeModel {

85+

return {

86+

provider: "openai",

87+

id: "gpt-5.5",

88+

name: "gpt-5.5",

89+

baseUrl: "https://api.openai.com/v1",

90+

api: "openai-responses",

91+

reasoning: true,

92+

input: ["text", "image"],

93+

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

94+

contextWindow: 1_050_000,

95+

contextTokens: 272_000,

96+

maxTokens: 128_000,

97+

};

98+

}

99+
100+

function createConfiguredModel(

101+

overrides: Partial<ModelDefinitionConfig> = {},

102+

): ModelDefinitionConfig {

103+

return {

104+

id: "gpt-5.5",

105+

name: "gpt-5.5",

106+

reasoning: true,

107+

input: ["text", "image"],

108+

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

109+

contextWindow: 1_050_000,

110+

contextTokens: 1_000_000,

111+

maxTokens: 128_000,

112+

...overrides,

113+

};

114+

}

115+
116+

describe("resolveEffectiveRuntimeModel", () => {

117+

it("can read Codex OAuth context overrides for native Codex harness runs", () => {

118+

const cfg = {

119+

models: {

120+

providers: {

121+

"openai-codex": {

122+

baseUrl: "https://chatgpt.com/backend-api/codex",

123+

models: [createConfiguredModel()],

124+

},

125+

},

126+

},

127+

} satisfies OpenClawConfig;

128+
129+

const result = resolveEffectiveRuntimeModel({

130+

cfg,

131+

provider: "openai",

132+

contextConfigProvider: "openai-codex",

133+

modelId: "gpt-5.5",

134+

runtimeModel: createRuntimeModel(),

135+

});

136+
137+

expect(result.ctxInfo).toEqual({

138+

source: "modelsConfig",

139+

tokens: 1_000_000,

140+

});

141+

expect(result.effectiveModel.contextWindow).toBe(1_000_000);

142+

});

143+
144+

it("keeps the runtime model contextTokens when no alternate context provider is supplied", () => {

145+

const cfg = {

146+

models: {

147+

providers: {

148+

"openai-codex": {

149+

baseUrl: "https://chatgpt.com/backend-api/codex",

150+

models: [createConfiguredModel()],

151+

},

152+

},

153+

},

154+

} satisfies OpenClawConfig;

155+
156+

const result = resolveEffectiveRuntimeModel({

157+

cfg,

158+

provider: "openai",

159+

modelId: "gpt-5.5",

160+

runtimeModel: createRuntimeModel(),

161+

});

162+
163+

expect(result.ctxInfo).toEqual({

164+

source: "model",

165+

tokens: 272_000,

166+

});

167+

expect(result.effectiveModel.contextWindow).toBe(272_000);

168+

});

169+

});

Original file line numberDiff line numberDiff line change

@@ -117,6 +117,7 @@ export function buildBeforeModelResolveAttachments(

117117

export function resolveEffectiveRuntimeModel(params: {

118118

cfg: OpenClawConfig | undefined;

119119

provider: string;

120+

contextConfigProvider?: string;

120121

modelId: string;

121122

runtimeModel: ProviderRuntimeModel;

122123

}): {

@@ -125,7 +126,7 @@ export function resolveEffectiveRuntimeModel(params: {

125126

} {

126127

const ctxInfo = resolveContextWindowInfo({

127128

cfg: params.cfg,

128-

provider: params.provider,

129+

provider: params.contextConfigProvider ?? params.provider,

129130

modelId: params.modelId,

130131

modelContextTokens: readPiModelContextTokens(params.runtimeModel),

131132

modelContextWindow: params.runtimeModel.contextWindow,

Original file line numberDiff line numberDiff line change

@@ -10,6 +10,7 @@ import {

1010

addSubagentRunForTests,

1111

resetSubagentRegistryForTests,

1212

} from "../../agents/subagent-registry.js";

13+

import type { ModelDefinitionConfig } from "../../config/types.models.js";

1314

import {

1415

completeTaskRunByRunId,

1516

createQueuedTaskRun,

@@ -37,6 +38,16 @@ vi.mock("../../agents/harness/builtin-pi.js", () => ({

3738

}));

3839
3940

const baseCfg = baseCommandTestConfig;

41+

const codexStatusModel: ModelDefinitionConfig = {

42+

id: "gpt-5.5",

43+

name: "GPT-5.5",

44+

reasoning: true,

45+

input: ["text", "image"],

46+

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

47+

contextWindow: 1_050_000,

48+

contextTokens: 1_000_000,

49+

maxTokens: 128_000,

50+

};

4051
4152

async function buildStatusReplyForTest(params: { sessionKey?: string; verbose?: boolean }) {

4253

const commandParams = buildCommandTestParams("/status", baseCfg);

@@ -650,6 +661,52 @@ describe("buildStatusReply subagent summary", () => {

650661

);

651662

});

652663
664+

it("uses Codex OAuth context overrides for openai models running on the Codex harness", async () => {

665+

registerStatusCodexHarness();

666+
667+

const text = await buildStatusText({

668+

cfg: {

669+

...baseCfg,

670+

models: {

671+

providers: {

672+

"openai-codex": {

673+

baseUrl: "https://chatgpt.com/backend-api/codex",

674+

models: [codexStatusModel],

675+

},

676+

},

677+

},

678+

agents: {

679+

defaults: {

680+

agentRuntime: { id: "codex" },

681+

},

682+

},

683+

},

684+

sessionEntry: {

685+

sessionId: "sess-status-codex-context",

686+

updatedAt: 0,

687+

totalTokens: 25_000,

688+

},

689+

sessionKey: "agent:main:main",

690+

parentSessionKey: "agent:main:main",

691+

sessionScope: "per-sender",

692+

statusChannel: "mobilechat",

693+

provider: "openai",

694+

model: "gpt-5.5",

695+

resolvedFastMode: false,

696+

resolvedVerboseLevel: "off",

697+

resolvedReasoningLevel: "off",

698+

resolveDefaultThinkingLevel: async () => undefined,

699+

isGroup: false,

700+

defaultGroupActivation: () => "mention",

701+

modelAuthOverride: "oauth",

702+

activeModelAuthOverride: "oauth",

703+

});

704+
705+

const normalized = normalizeTestText(text);

706+

expect(normalized).toContain("Model: openai/gpt-5.5");

707+

expect(normalized).toContain("Context: 25k/1.0m");

708+

});

709+
653710

it("uses workspace-scoped auth evidence in /status auth labels", async () => {

654711

const tempRoot = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-status-auth-label-"));

655712

const workspaceDir = path.join(tempRoot, "workspace");