feat: set AGENT=1 environment variable to identify AI agent execution#1749
Closed
swen128 wants to merge 1 commit into
Closed
feat: set AGENT=1 environment variable to identify AI agent execution#1749swen128 wants to merge 1 commit into
swen128 wants to merge 1 commit into
Conversation
Sets process.env["AGENT"] = "1" at startup so all child processes can detect they're being run by an AI agent. This allows scripts and tools to adapt their behavior accordingly. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
github-actions
Bot
force-pushed
the
dev
branch
from
September 29, 2025 05:53
f16de3d to
cc0d460
Compare
github-actions
Bot
force-pushed
the
dev
branch
from
November 10, 2025 05:43
772b621 to
eb855e1
Compare
github-actions
Bot
force-pushed
the
dev
branch
3 times, most recently
from
November 22, 2025 18:07
f1dc981 to
3e15a39
Compare
github-actions
Bot
force-pushed
the
dev
branch
3 times, most recently
from
November 27, 2025 01:29
f8ee907 to
6a9856d
Compare
bussard76
pushed a commit
to bussard76/openwork
that referenced
this pull request
May 12, 2026
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sets the env var
AGENT=1at startup to identify when processes are run by an AI agent.Context
Claude Code Implementation
Claude Code sets
CLAUDECODE=1environment variable for similar purposes. This is useful when you want to:Bun Test Integration
Bun's test runner already supports AI agent detection through the
AGENT=1environment variable:AGENT=1is detected, Bun shows concise, AI-friendly test reports