fix(bridge): skip OpenClaw runtime-context envelope when picking prompt #3

Merged
hzhang merged 1 commits from fix/skip-runtime-context-message into main 2026-04-29 08:32:53 +00:00

1 Commits

Author SHA1 Message Date
zhi
91acce9b32 fix(bridge): skip OpenClaw runtime-context envelope when picking prompt
OpenClaw emits its runtime-context block as a separate custom_message; the
openai-completions adapter folds that into the request as an extra role=user
message after the real user input. extractLatestUserMessage was taking the
last user message unconditionally, so Claude received only the metadata
envelope and replied "your message came through empty".

Walk user messages backward, skip ones starting with the runtime-context
marker, and return the most recent real user message instead.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 08:19:59 +00:00