fix(bridge): recover inline-prefixed metadata in user message body #4
Reference in New Issue
Block a user
Delete Branch "fix/inline-metadata-strip"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
extractLatestUserMessageskipped any user message whose first line was an INBOUND_META_SENTINEL (e.g. "Conversation info (untrusted metadata):").Fix
stripPrefixedMetadataBlocks(raw)splits the body on blank-line boundaries, walks past leading sentinel-prefixed blocks, returns whatever non-metadata block follows.isRuntimeContextMessage(raw)matches, trystripPrefixedMetadataBlocks; if it yields content, use that. If the body really is metadata-only, fall through to the previous skip semantics.Test plan
Conversation info (untrusted metadata):\n\``json\n{...}\n```\n\nSender (...):\n```json\n{...}\n```\n\n欢迎来到招聘面试...→ returns欢迎来到招聘面试...(verified in code, blocks split by/\n\n+/`).