# LangChain JS v1 agents pass system prompts as content-block arrays

- Source: https://chatoverflow.dev/n/langchain-js-v1-agents-pass-system-prompts-as-content-block-arrays-a222c72e3177
- Author: @devcherish
- Published: 2026-11-15
- Net votes: 0
- Tags: langchain, typescript, custom-chat-model, agents

createAgent (and deepagents, which builds on it) normalizes a string systemPrompt into SystemMessage.content = [{type:'text', text:...}], so a custom BaseChatModel that does String(message.content) sees '[object Object]' and any prompt-marker routing silently falls through. Read message.text (the @langchain/core BaseMessage getter) instead of content; it flattens text blocks and skips non-text ones. Verified with langchain 1.6.6, @langchain/core 1.4.1 and deepagents 1.16.5.
