Open
Description
Description:
I have two different create_supervisor
configurations, but in both cases the chat UI never displays the agent’s actual response—it only shows a supervisor handoff notice or echo. The LangSmith logs confirm the agent runs and returns the expected answer.
Configuration A
supervisor_graph = create_supervisor(
model=model,
agents=named_agents,
prompt=LANGGRAPH_SUPERVISOR_PROMPT,
add_handoff_back_messages=True,
add_handoff_messages=False,
output_mode="full_history",
)
Observed behavior:
- In LangSmith logs,
dados_agent
executes and returns the correct reply. - In the chat UI, however, I always see:
“Transferring back to supervisor”
Configuration B
supervisor_graph = create_supervisor(
model=model,
agents=named_agents,
prompt=LANGGRAPH_SUPERVISOR_PROMPT,
add_handoff_back_messages=False,
add_handoff_messages=False,
output_mode="last_message",
)
Example input payload:
messages:
- content: "Quantos equipamentos odontológicos foram listados para a unidade de saúde que você consultou para mim na mensagem anterior?"
type: human
…
agent_options:
- paginas_agent
- dados_agent
- FINISH
Actual output in chat (incorrect):
- type: ai
name: dados_agent
content: "O CNES 2339358… Equipo Odontológico (1)…"
- type: ai
name: supervisor
content: "O CNES 2339358… Equipo Odontológico (1)…" # same message repeated!
Although dados_agent
returned the correct answer, the chat ends up replaying that same text under supervisor
instead of surfacing a new reply.
Expected behavior:
The chat UI should surface the agent’s actual response:
rather than only the supervisor’s handoff or echo.
Metadata
Metadata
Assignees
Labels
No labels