Skip to content

promptAsync background work can lose request instance context #26526

@qz1543706741

Description

@qz1543706741

Description

promptAsync starts prompt work in a forked effect and returns 204 immediately. Because the forked prompt effect does not explicitly provide the request's InstanceRef / WorkspaceRef, later background work can run with the default instance context instead of the request instance.

In integrations that depend on project-specific agent configuration, this can make subagent lookup see only default agents and fail to resolve custom agents.

The streaming prompt route already captures and provides the instance/workspace context around the prompt effect. promptAsync should do the same before forking.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions