conductor-oss/conductor · error · TerminateWorkflowException

Error preparing chat completion task input: %s

Error message

Error preparing chat completion task input: %s

What it means

Error "Error preparing chat completion task input: %s" thrown in conductor-oss/conductor.

Source

Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/ai/AgentChatCompleteTaskMapper.java:156

                chatCompletion.setMessages(history);
            }
            if (chatCompletion.getUserInput() != null && history.isEmpty()) {
                history.add(new ChatMessage(ChatMessage.Role.user, chatCompletion.getUserInput()));
            }
            getHistory(workflowModel, taskModel, chatCompletion);
            condenseIfNeeded(chatCompletion, taskModel, workflowModel);
            updateTaskModel(chatCompletion, taskModel);
            sanitizeMessages(chatCompletion);
            validateRunnableConversation(chatCompletion);
            ensureEndsWithUserMessage(chatCompletion, taskModel);
            ensureJsonOutputUserMessage(chatCompletion);
        } catch (Exception e) {
            if (e instanceof TerminateWorkflowException) {
                throw (TerminateWorkflowException) e;
            } else {
                log.error("input: {}", taskModel.getInputData());
                log.error(e.getMessage(), e);
                throw new TerminateWorkflowException(
                        String.format(
                                "Error preparing chat completion task input: %s", e.getMessage()));
            }
        }
        return taskModel;
    }

    /**
     * OpenAI's JSON mode validation checks user input messages for the word "json".
     * System/developer instructions are not sufficient for the Responses API.
     */
    private void ensureJsonOutputUserMessage(ChatCompletion chatCompletion) {
        if (!chatCompletion.isJsonOutput()) {
            return;
        }

        List<ChatMessage> messages = chatCompletion.getMessages();
        if (messages == null) {

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Check the task input parameters for the LLM chat-complete task; a null or unserializable value commonly causes this.
  2. Ensure referenced upstream outputs exist and are of the expected type.
  3. Look at the wrapped exception message (%s) for the concrete mapping failure.

When it happens

Trigger: Thrown at agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/ai/AgentChatCompleteTaskMapper.java:156 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/54f8bf0645213e8a. Report an issue: GitHub.