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

推荐订阅源

博客园_首页
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
aimingoo的专栏
aimingoo的专栏
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
J
Java Code Geeks
G
Google Developers Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
罗磊的独立博客
GbyAI
GbyAI
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

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: expose generic image background option · openclaw/o...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -52,6 +52,7 @@ const MAX_CODEX_IMAGE_BASE64_CHARS = 64 * 1024 * 1024;

5252

const LOG_VALUE_MAX_CHARS = 256;

5353

const MOCK_OPENAI_PROVIDER_ID = "mock-openai";

5454

const OPENAI_OUTPUT_FORMATS = ["png", "jpeg", "webp"] as const;

55+

const OPENAI_BACKGROUNDS = ["transparent", "opaque", "auto"] as const;

5556

const OPENAI_QUALITIES = ["low", "medium", "high", "auto"] as const;

5657

const OPENAI_IMAGE_MODELS = [

5758

DEFAULT_OPENAI_IMAGE_MODEL,

@@ -174,10 +175,11 @@ function appendOpenAIImageOptions(

174175

req: Parameters<ImageGenerationProvider["generateImage"]>[0],

175176

): void {

176177

const openai = req.providerOptions?.openai;

178+

const background = openai?.background ?? req.background;

177179

const entries: Record<string, unknown> = {

178180

...(req.quality !== undefined ? { quality: req.quality } : {}),

179181

...(req.outputFormat !== undefined ? { output_format: req.outputFormat } : {}),

180-

...(openai?.background !== undefined ? { background: openai.background } : {}),

182+

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

181183

...(openai?.moderation !== undefined ? { moderation: openai.moderation } : {}),

182184

...(openai?.outputCompression !== undefined

183185

? { output_compression: openai.outputCompression }

@@ -201,7 +203,7 @@ function resolveOpenAIImageRequestModel(

201203

if (

202204

options?.allowTransparentDefaultReroute === true &&

203205

model === DEFAULT_OPENAI_IMAGE_MODEL &&

204-

req.providerOptions?.openai?.background === "transparent"

206+

(req.providerOptions?.openai?.background ?? req.background) === "transparent"

205207

) {

206208

return OPENAI_TRANSPARENT_BACKGROUND_IMAGE_MODEL;

207209

}

@@ -513,6 +515,7 @@ function createOpenAIImageGenerationProviderBase(params: {

513515

output: {

514516

formats: [...OPENAI_OUTPUT_FORMATS],

515517

qualities: [...OPENAI_QUALITIES],

518+

backgrounds: [...OPENAI_BACKGROUNDS],

516519

},

517520

},

518521

generateImage: params.generateImage,

@@ -580,6 +583,7 @@ async function generateOpenAICodexImage(params: {

580583

const size = req.size ?? DEFAULT_SIZE;

581584

const timeoutMs = resolveOpenAIImageTimeoutMs(req.timeoutMs);

582585

const openai = req.providerOptions?.openai;

586+

const background = openai?.background ?? req.background;

583587

headers.set("Content-Type", "application/json");

584588

const content: Array<Record<string, unknown>> = [

585589

{ type: "input_text", text: req.prompt },

@@ -610,7 +614,7 @@ async function generateOpenAICodexImage(params: {

610614

size,

611615

...(req.quality !== undefined ? { quality: req.quality } : {}),

612616

...(req.outputFormat !== undefined ? { output_format: req.outputFormat } : {}),

613-

...(openai?.background !== undefined ? { background: openai.background } : {}),

617+

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

614618

...(openai?.outputCompression !== undefined

615619

? { output_compression: openai.outputCompression }

616620

: {}),