Skip to content

Fix [object Object] serialization issue with multi-modal content#11

Open
kevinfealey wants to merge 2 commits intoatalovesyou:mainfrom
kevinfealey:main
Open

Fix [object Object] serialization issue with multi-modal content#11
kevinfealey wants to merge 2 commits intoatalovesyou:mainfrom
kevinfealey:main

Conversation

@kevinfealey
Copy link

  • Handle OpenAI multi-modal content format where content can be an array of content parts (e.g., [{"type": "text", "text": "Hello"}]) in addition to plain strings
  • Add defensive string coercion in response handlers to prevent [object Object] appearing when unexpected types are encountered
  • Update OpenAI types to properly reflect that content can be string or array format per OpenAI API spec
  • Add debug logging for request diagnostics

Fixes issue #2 in upstream repo where Clawdbot integration showed [object Object] instead of actual message content.

- Handle OpenAI multi-modal content format where content can be an array
  of content parts (e.g., [{"type": "text", "text": "Hello"}]) in addition
  to plain strings
- Add defensive string coercion in response handlers to prevent
  [object Object] appearing when unexpected types are encountered
- Update OpenAI types to properly reflect that content can be string
  or array format per OpenAI API spec
- Add debug logging for request diagnostics

Fixes issue atalovesyou#2 in upstream repo where Clawdbot integration showed
[object Object] instead of actual message content.
Provides tested configuration for integrating with OpenClaw including
provider setup, model definitions, and agent defaults.

Addresses user confusion reported in upstream issue atalovesyou#2.
bwiedmann added a commit to bwiedmann/claude-max-api-proxy that referenced this pull request Feb 15, 2026
…ssue with multi-modal content

# Conflicts:
#	src/adapter/openai-to-cli.ts
#	src/types/openai.ts
Grivn added a commit to mnemon-dev/claude-max-api-proxy that referenced this pull request Feb 20, 2026
Fixes applied (from upstream PRs atalovesyou#7, atalovesyou#11, atalovesyou#12, atalovesyou#13, atalovesyou#17, atalovesyou#20):

- fix: normalizeModelName crash on undefined model (issue atalovesyou#21)
- fix: [object Object] serialization for array content parts
- fix: E2BIG error by passing prompt via stdin instead of CLI arg
- fix: ensureString on result.result to prevent non-string output
- feat: CLAUDE_DANGEROUSLY_SKIP_PERMISSIONS env var for headless mode
- feat: OPENCLAW_PROXY=1 env injection for hook isolation
- feat: model aliases for claude-*-4-5, claude-*-4-6 generations
- feat: claude-proxy/ provider prefix support
- feat: developer role support in message conversion
- perf: increase subprocess timeout from 5min to 15min

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant