Skip to content

promptAsync background work can lose request instance context #26526

Closed as not planned

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

Activity

  1. github-actions commented on May 9, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If this is the same issue, please consider closing this one and adding any new details to #21659 instead.

  2. github-actions commented on Jul 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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