Skip to content

refactor: use @vercel/detect-agent for repo creation#182

Closed
lihbr wants to merge 1 commit into
mainfrom
lh/use-vercel-detect-agent
Closed

refactor: use @vercel/detect-agent for repo creation#182
lihbr wants to merge 1 commit into
mainfrom
lh/use-vercel-detect-agent

Conversation

@lihbr
Copy link
Copy Markdown
Member

@lihbr lihbr commented May 11, 2026

Description

  • replace the manual AI harness detector with @vercel/detect-agent
  • move repository creation agent detection into src/clients/wroom.ts
  • remove the old shared detector and the tracking-side agent field added in feat(tracking): identify CLI and detect AI agent harness #175
  • add a focused unit test for repository creation query params

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Note

Low Risk
Low risk refactor that swaps how the agent value is detected and reported during repository creation and telemetry; main risk is slightly different agent names/behavior affecting query params or tracking metadata.

Overview
Switches repository creation and telemetry agent detection to @vercel/detect-agent, removing the project’s custom environment-based detector.

createRepository now determines the agent internally (and only adds the agent query param when detection succeeds), and repo-create no longer passes an agent field. The old src/lib/ai.ts helper is deleted and package.json/package-lock.json are updated to include the new dev dependency.

Reviewed by Cursor Bugbot for commit 0d01471. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2fad260. Configure here.

Comment thread src/tracking.ts
Comment thread src/clients/wroom.ts
@lihbr lihbr force-pushed the lh/use-vercel-detect-agent branch from 2fad260 to 0d01471 Compare May 11, 2026 02:15
Comment thread src/clients/wroom.ts
@lihbr lihbr closed this May 12, 2026
Comment thread src/clients/wroom.ts
Comment on lines +331 to +332
const { isAgent, agent } = await determineAgent();
if (isAgent) url.searchParams.set("agent", agent.name);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

💡 #idea: I prefer keeping the clients as a light layer above the API, essentially just a TypeScript wrapper around the endpoints. It helps keep the mental model simple in each area of the CLI.

That being said, I see the benefit of adding it in here.

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.

3 participants