Skip to content

[FEATURE]: Set universal AI_AGENT marker for subprocesses #40441

Closed as not planned

Description

@complynx

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Set AI_AGENT=opencode in the environment inherited by subprocesses and tools started during an OpenCode session. If a caller already provides a non-empty AI_AGENT, preserve it so wrappers can identify themselves.

AI_AGENT is a universal marker used across coding agents. It gives downstream CLIs one stable signal for agent-friendly behavior—such as disabling prompts and pagers or choosing machine-readable output—without maintaining product-specific heuristics. OpenCode-specific environment variables can continue serving their existing purposes; this marker complements rather than replaces them.

The value should be advisory only: not telemetry, authentication, authorization, sandboxing, or a trust boundary. The proposed slug follows the standard's lowercase hyphen naming: opencode.

Standard: https://github.com/vercel/vercel/tree/main/packages/detect-agent#the-ai_agent-standard

Activity

  1. complynx commented on Aug 4, 2026

    @complynx
    Author

    Closing as a duplicate of #34065. I added the universal AI_AGENT=opencode naming, wrapper-preservation behavior, and advisory-only boundary to the existing design thread.

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