Skip to content

[BUG]: Graph Chat replies render as [object Object] instead of natural language #129

Description

@Mailendiran98

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Graph Chat answers a natural-language question about the knowledge graph with the literal text [object Object], so no readable answer is shown. The agent's tool trace (e.g. describe_entity) appears, but the final response is lost. The bug occurs when the configured LLM serving endpoint returns message.content as a list of OpenAI content blocks (reproduced on databricks-gpt-oss-120b and databricks-qwen35-122b-a10b) rather than a plain string.

Root cause: src/agents/agent_dtwin_chat/engine.py reads content = message.get("content", "") and assigns it directly to result.reply. When the endpoint returns content as a list ([{"type":"text","text":...}]), result.reply becomes a list, the SSE done event serializes it as a JSON array, and the frontend's renderMarkdown(event.reply) stringifies it to [object Object]. The shared helper extract_message_content() (in agents/engine_base.py) already handles this shape and is used by the other agents — agent_dtwin_chat is the one that doesn't use it.

Expected Behavior

Graph Chat should return the agent's natural-language answer as a string (Markdown) — including the entity link — after it queries the graph with describe_entity / query_graphql.

Steps To Reproduce

  1. Deploy OntoBricks to Databricks Apps with a domain built (ontology + mappings + knowledge graph).
  2. In Domain Settings set an LLM serving endpoint that returns content as content blocks (e.g. databricks-gpt-oss-120b).
  3. Open Graph Chat and ask a question about a specific entity.
  4. Observe the assistant reply is [object Object]; only the describe_entity tool trace is visible.

Cloud

AWS

Browser

Chrome

OntoBricks Version

0.6.2

Relevant log output

Additional Context

Note: I have referred opensharing dataset in Databricks free edition (samples.wanderbricks)

Metadata

Metadata

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions