Summary
In UE 5.9 on macOS, when the Unreal Assistant panel uses the external Claude Code agent (claude-agent-acp), most turns end with a red “Answer generation failed.” box. This happens even for a one-word prompt like “Hi”.
The agent doesn’t actually fail:
- On every one of these turns, the agent streams a complete reply and ends with
stopReason: "end_turn". - The agent’s own session log contains the full answer.
- Closing and reopening the conversation in the panel shows the complete answer.
Only the panel’s status is wrong.
Sometimes one turn shows normally and the next one fails in the same conversation.
Environment
- Engine: 5.9.0-60351404+++UE5+Release-5.9 (Launcher build)
- OS: macOS 27.0.1 (26A434)
- Hardware: Apple M6
- Agent:
@agentclientprotocol/claude-agent-acp0.106.0, installed globally with npm, Node v24.22.1 - Panel: Unreal Assistant (Experimental AIAssistant plugin), agent set to Claude Code
Steps to reproduce
npm install -g @agentclientprotocol/claude-agent-acp, and make sure it is on the PATH that GUI apps see.- Open any project. In the Unreal Assistant panel, choose Claude Code as the agent.
- Start a new chat and send “Hi”.
Expected: The reply is shown as a normal, successful answer.
Actual: The reply streams in, then the panel shows “Answer generation failed.” Reopening the chat shows the full reply.
Evidence
1. The agent completes normally. I recorded the agent’s stdin and stdout while reproducing. Every failed turn ends with a valid ACP response to session/prompt:
{"jsonrpc":"2.0","id":<n>,"result":{"stopReason":"end_turn"}}
There are no JSON-RPC errors, and nothing is written to stderr.
2. The agent’s output doesn’t matter. I put a filter between the editor and the agent that cut the stream down to the bare minimum the protocol requires: initialize, session/new, agent_message_chunk updates, then {"stopReason":"end_turn"}. I removed every optional update, including available_commands_update, usage_update, and the session/status notifications. The panel still showed “Answer generation failed.”
3. The message is a service error, not an agent error. In the panel’s web bundle (dev.epicgames.com/embed-view/...), “Answer generation failed.” is the text for status SERVICE_ERROR. The page sets that status from its own sync with Epic’s backend: an SSE stream that ends without an END event, a guest-id failure, or a rejected or retried POST. A real agent failure uses AGENT_ERROR instead, which shows “The agent reported an error: …”. That message never appeared.
4. Nothing useful is logged on the editor side.
LogAIAssistantshows no error for these turns.- Agent stderr is logged only at
Verbose(AIAssistantAgentProcess.cpp). VeryVerboseis compiled out.- The embedded page’s JavaScript console isn’t written to the editor log, so I couldn’t see which backend request failed.
Impact
- Users are told their answer failed when it didn’t, so they retry and repeat work. This matters because the agent may already have changed project files or assets.
- It makes the Claude Code integration look broken.
Suggested fixes
- When the local agent has returned
stopReason: end_turn, show the turn as successful, and report a backend sync problem separately (for example “Couldn’t save this conversation”). Don’t replace a completed answer with “Answer generation failed.” - Log the reason for
SERVICE_ERROR(HTTP status, or “SSE ended without END”) toLogAIAssistant, or forward the embedded page’s console to the editor log, so failures like this can be diagnosed.
What Type of Bug are you experiencing?
AI
Steps to Reproduce
Steps to reproduce
npm install -g @agentclientprotocol/claude-agent-acp, and make sure it is on the PATH that GUI apps see.- Open any project. In the Unreal Assistant panel, choose Claude Code as the agent.
- Start a new chat and send “Hi”.
Expected Result
Expected: The reply is shown as a normal, successful answer.
Actual: The reply streams in, then the panel shows “Answer generation failed.” Reopening the chat shows the full reply.
Observed Result
Evidence
1. The agent completes normally. I recorded the agent’s stdin and stdout while reproducing. Every failed turn ends with a valid ACP response to session/prompt:
{"jsonrpc":"2.0","id":<n>,"result":{"stopReason":"end_turn"}}
There are no JSON-RPC errors, and nothing is written to stderr.
2. The agent’s output doesn’t matter. I put a filter between the editor and the agent that cut the stream down to the bare minimum the protocol requires: initialize, session/new, agent_message_chunk updates, then {"stopReason":"end_turn"}. I removed every optional update, including available_commands_update, usage_update, and the session/status notifications. The panel still showed “Answer generation failed.”
3. The message is a service error, not an agent error. In the panel’s web bundle (dev.epicgames.com/embed-view/...), “Answer generation failed.” is the text for status SERVICE_ERROR. The page sets that status from its own sync with Epic’s backend: an SSE stream that ends without an END event, a guest-id failure, or a rejected or retried POST. A real agent failure uses AGENT_ERROR instead, which shows “The agent reported an error: …”. That message never appeared.
4. Nothing useful is logged on the editor side.
LogAIAssistantshows no error for these turns.- Agent stderr is logged only at
Verbose(AIAssistantAgentProcess.cpp). VeryVerboseis compiled out.- The embedded page’s JavaScript console isn’t written to the editor log, so I couldn’t see which backend request failed.
Affects Versions
5.9
Platform(s)
Mac