Skip to content

feat(core): add OpenCode AI agent detection#34072

Merged
AgentEnder merged 1 commit intonrwl:masterfrom
beaussan:detect-opencode-too
Jan 15, 2026
Merged

feat(core): add OpenCode AI agent detection#34072
AgentEnder merged 1 commit intonrwl:masterfrom
beaussan:detect-opencode-too

Conversation

@beaussan
Copy link
Copy Markdown
Contributor

Current Behavior

Nx's AI agent detection currently identifies Claude Code, Repl.it, and Cursor AI agents via environment variables, but does not detect OpenCode.

Expected Behavior

Nx should also detect when running under OpenCode AI agent by checking for the OPENCODE environment variable, which OpenCode sets to 1 when active.

Related Issue(s)

N/A - Feature addition to improve AI agent detection coverage.

Changes

  • Added is_opencode_ai() function in packages/nx/src/native/utils/ai.rs
  • Updated is_ai_agent() to include OpenCode detection
  • Added corresponding unit tests

Add detection for OpenCode AI agent by checking for the OPENCODE
environment variable, following the same pattern used for Claude,
Repl.it, and Cursor AI detection.

This ensures the TUI is properly disabled when running under OpenCode.
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 10, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit fb45eec
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6962c905feac6400077f1cd7
😎 Deploy Preview https://deploy-preview-34072--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
nx-dev Ready Ready Preview Jan 10, 2026 9:54pm

@beaussan beaussan marked this pull request as ready for review January 10, 2026 21:48
@beaussan beaussan requested review from a team as code owners January 10, 2026 21:48
@beaussan beaussan requested a review from leosvelperez January 10, 2026 21:48
@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Jan 13, 2026

View your CI Pipeline Execution ↗ for commit fb45eec

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 7m 18s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2m 36s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx format:check ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-13 15:23:50 UTC

@AgentEnder AgentEnder merged commit 21d1555 into nrwl:master Jan 15, 2026
22 of 24 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants