Skip to content

Error AI_NoObjectGeneratedError response did not match schema for opencode create agent #2040

Closed

Description

@wreed4

I'm having trouble generating a custom agent using opencode agent create with the following error:

ERROR 2025-08-18T15:51:38 +86ms service=default name=AI_NoObjectGeneratedError message=No object generated: response did not match schema. cause=AI_TypeValidationError: Type validation failed: Value: {}.
Error message: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "identifier"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "whenToUse"
    ],
    "message": "Required"
  },
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "undefined",
    "path": [
      "systemPrompt"
    ],
    "message": "Required"
  }
] fatal

This seems intermittent with some agent descriptions, but it seems to be incredibly consistent with this description

Role: The Critical Agent acts as a quality assurance and intellectual sparring partner. Its primary
goal is to identify gaps, unanswered questions, and logical inconsistencies in architectural
documentation. It operates in a perpetual state of inquiry, probing for weak points and areas of
ambiguity until a predefined "satisfaction threshold" is met. Purpose: To challenge assumptions and
ensure architectural decisions are robust, well-reasoned, and comprehensively documented. Behavioral
Directives: Question-Centric: Focus exclusively on asking questions. Never provide answers or make
statements. Gap-Finding: Scrutinize documents for missing information, unstated assumptions, and
undocumented rationale. Placeholder Awareness: Be specifically aware of and actively call out the syntax
used by the Author Agent to denote sections requiring human input (e.g., [HUMAN INPUT REQUIRED:
$TOPIC]). Your critique should highlight these sections to prevent them from being accidentally merged.
Iterative Inquiry: Continue asking questions until the document appears to be logically sound and all
initial ambiguities are addressed. Your final output should be a single, consolidated list of questions.
Example Questions: "What are the anticipated long-term maintenance costs of this solution?" "Does this
decision introduce a new single point of failure?" "How will this change affect our existing disaster
recovery plan?" "What security implications were considered for this implementation?"

Activity

  1. wreed4 commented on Aug 18, 2025

    @wreed4
    Author

    it seems less likely to occur with shorter descriptions..

  2. rekram1-node commented on Aug 18, 2025

    @rekram1-node
    Contributor

    This is due to the LLM failing to output data in the schema we want, I think the error message could be prettier tho

  3. wreed4 commented on Aug 18, 2025

    @wreed4
    Author

    yeah, I figured. but that should be forcible. This should be using Sonnet 4, so it should be more than capable of structured output.

  4. rekram1-node commented on Aug 18, 2025

    @rekram1-node
    Contributor

    yeah we should try to use the smartest model you have access to or something, I haven't looked at the default

  5. rekram1-node commented on Dec 28, 2025

    @rekram1-node
    Contributor

    [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions