Task tool fails with "undefined is not an object (evaluating 'Q.model')" when launching sub-agents #987

Closed
opened 2026-02-16 17:29:00 -05:00 by yindo · 5 comments
Owner

Originally created by @Gen-2k on GitHub (Jul 30, 2025).

Originally assigned to: @thdxr on GitHub.

Issue: Task Tool Fails When Launching Sub-Agents

Description

When attempting to use the task tool to launch any sub-agent (e.g., code-reviewer), the tool consistently fails with the following error message:

{"task_response": {"content": "Tool execution aborted", "name": "task"}}

And the underlying error observed is:

undefined is not an object (evaluating 'Q.model')

Steps to Reproduce

  1. Attempt to call the default_api.task() function with any valid subagent_type and prompt.
    • Example:
      print(default_api.task(description="Review code", prompt="Review this script", subagent_type="code-reviewer"))
      

Expected Behavior

The task tool should successfully launch the specified sub-agent without internal errors.

Actual Behavior

The task tool aborts execution, and an "undefined is not an object (evaluating 'Q.model')" error occurs internally, preventing the sub-agent from running.

Impact

This issue prevents the use of any sub-agent functionality, limiting the capabilities of the model for complex tasks that rely on these specialized agents.

Originally created by @Gen-2k on GitHub (Jul 30, 2025). Originally assigned to: @thdxr on GitHub. # Issue: Task Tool Fails When Launching Sub-Agents ## Description When attempting to use the `task` tool to launch any sub-agent (e.g., `code-reviewer`), the tool consistently fails with the following error message: ```json {"task_response": {"content": "Tool execution aborted", "name": "task"}} ``` And the underlying error observed is: ``` undefined is not an object (evaluating 'Q.model') ``` ## Steps to Reproduce 1. Attempt to call the default_api.task() function with any valid subagent_type and prompt. - Example: ```python print(default_api.task(description="Review code", prompt="Review this script", subagent_type="code-reviewer")) ``` ## Expected Behavior The task tool should successfully launch the specified sub-agent without internal errors. ## Actual Behavior The task tool aborts execution, and an "undefined is not an object (evaluating 'Q.model')" error occurs internally, preventing the sub-agent from running. ## Impact This issue prevents the use of any sub-agent functionality, limiting the capabilities of the model for complex tasks that rely on these specialized agents.
yindo closed this issue 2026-02-16 17:29:00 -05:00
Author
Owner

@michabbb commented on GitHub (Jul 30, 2025):

#1307

@michabbb commented on GitHub (Jul 30, 2025): #1307
Author
Owner

@thdxr commented on GitHub (Aug 4, 2025):

what model?

@thdxr commented on GitHub (Aug 4, 2025): what model?
Author
Owner

@michabbb commented on GitHub (Aug 4, 2025):

what model?

for example: https://github.com/sst/opencode/issues/1307#issuecomment-3142017309
(claude opus)

@michabbb commented on GitHub (Aug 4, 2025): > what model? for example: https://github.com/sst/opencode/issues/1307#issuecomment-3142017309 (claude opus)
Author
Owner

@rekram1-node commented on GitHub (Aug 5, 2025):

Possibly related:
#1641

@rekram1-node commented on GitHub (Aug 5, 2025): Possibly related: #1641
Author
Owner

@Gen-2k commented on GitHub (Aug 7, 2025):

Gemini models Pro and Flash

@Gen-2k commented on GitHub (Aug 7, 2025): Gemini models Pro and Flash
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#987