Skip to content

Comments

feat(core): improve AX of configure-ai-agents with auto-detection#34496

Open
MaxKless wants to merge 6 commits intomasterfrom
caia-ax
Open

feat(core): improve AX of configure-ai-agents with auto-detection#34496
MaxKless wants to merge 6 commits intomasterfrom
caia-ax

Conversation

@MaxKless
Copy link
Collaborator

@MaxKless MaxKless commented Feb 18, 2026

Current Behavior

When configure-ai-agents is invoked from within an AI agent (e.g. Claude Code), it either shows an interactive multi-select prompt (which the agent can't interact with) or requires --agents and --no-interactive flags to work correctly. This makes the experience awkward when AI agents call the command as part of workspace setup.

Expected Behavior

When an AI agent is detected (via environment variables like CLAUDECODE), the command now:

  1. Auto-configures the detected agent if it's not yet configured, partially configured, or outdated — no prompts needed
  2. Auto-updates any other outdated agents alongside the detected one
  3. Reports non-configured agents with a suggested nx configure-ai-agents --agents ... command
  4. Reports up-to-date status if the detected agent is already fully configured

When --agents is explicitly passed, detection is ignored entirely (existing behavior preserved). --check mode also works with detection — it checks the detected agent plus all other configured agents.

Additionally:

  • Strips AI agent detection env vars (CLAUDECODE, CLAUDE_CODE, OPENCODE, GEMINI_CLI, etc.) from e2e subprocess environments to prevent the test runner's environment from leaking into tests
  • Fixes e2e tests to use AGENTS.md (not GEMINI.md) for gemini assertions, matching what the gemini generator actually creates for fresh installations

MaxKless and others added 3 commits February 18, 2026 14:22
- When called from a detected AI agent (via env vars like CLAUDECODE),
  skip the interactive prompt and auto-configure the detected agent
  plus any outdated agents
- Report non-configured agents with a suggested command
- When --agents is explicitly passed, ignore detection entirely
- Strip AI agent env vars from e2e test environment to prevent leaks
- Fix gemini e2e test assertions to use AGENTS.md (the actual rules file)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MaxKless MaxKless requested review from a team, meeroslav and vsavkin as code owners February 18, 2026 14:39
@MaxKless MaxKless requested a review from JamesHenry February 18, 2026 14:39
@netlify
Copy link

netlify bot commented Feb 18, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 0c63d68
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6996cbf4eabd8700087c1565
😎 Deploy Preview https://deploy-preview-34496--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.

@netlify
Copy link

netlify bot commented Feb 18, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 0c63d68
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6996cbf4f030040008249f24
😎 Deploy Preview https://deploy-preview-34496--nx-dev.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.

@nx-cloud
Copy link
Contributor

nx-cloud bot commented Feb 18, 2026

View your CI Pipeline Execution ↗ for commit 0c63d68

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ⛔ Cancelled 1h 39m 49s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 4m 10s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 9s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-19 10:23:13 UTC

nx-cloud[bot]

This comment was marked as outdated.

MaxKless and others added 2 commits February 18, 2026 18:15
…re-ai-agents

Unify the automatic configuration logic so --no-interactive (without
explicit --agents) behaves the same as AI agent auto-detection: update
outdated agents and report non-configured ones. The detected agent is
now also configured regardless of the --no-interactive flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…re-ai-agents

Unify the automatic configuration logic so --no-interactive (without
explicit --agents) behaves the same as AI agent auto-detection: update
outdated agents and report non-configured ones. The detected agent is
now also configured regardless of the --no-interactive flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> [Self-Healing CI Rerun]
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

…re-ai-agents

Unify the automatic configuration logic so --no-interactive (without
explicit --agents) behaves the same as AI agent auto-detection: update
outdated agents and report non-configured ones. The detected agent is
now also configured regardless of the --no-interactive flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> [Self-Healing CI Rerun]
Copy link
Contributor

@nx-cloud nx-cloud bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud has identified a possible root cause for your failed CI:

Our test failures are unrelated to this PR's changes to AI agent auto-detection. The failing tests (e2e-react, e2e-storybook) are in domains completely separate from the touched projects (e2e-nx, e2e-utils, nx), and exhibit pre-existing flakiness (0.25%-2.87%). The errors stem from environment issues: corrupted @microsoft/api-extractor dependency installation and corepack configuration problems in temporary test projects.

No code changes were suggested for this issue.

Trigger a rerun:

Rerun CI

Nx Cloud View detailed reasoning on Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant