Skip to content

Add Amp agent detection#56

Merged
technicalpickles merged 1 commit intomainfrom
add-amp-agent-detection
Oct 2, 2025
Merged

Add Amp agent detection#56
technicalpickles merged 1 commit intomainfrom
add-amp-agent-detection

Conversation

@technicalpickles
Copy link
Copy Markdown
Owner

@technicalpickles technicalpickles commented Oct 2, 2025

Adds support for detecting Amp running in agent mode via the `AGENT=amp` environment variable.

Changes

  • Add agent mapping in `env_mapping.rs` with HIGH confidence
  • Add display name 'Amp' in `agent.rs` descriptor
  • Add comprehensive test coverage:
    • Unit test in `agent_declarative.rs`
    • CLI integration test in `cli_declarative.rs`
    • Mapping unit test in `env_mapping.rs`
    • Snapshot test in `info_snapshots.rs`

Testing

All 329 tests passing ✅

Example Usage

AGENT=amp envsense info
# Contexts:
#   - agent
# Traits:
#   agent:
#     id: amp

AGENT=amp envsense check agent.id=amp
# true

Detect Amp agent via AGENT=amp environment variable.

- Add agent mapping in env_mapping.rs with HIGH confidence
- Add display name 'Amp' in agent.rs descriptor
- Add unit test in agent_declarative.rs
- Add CLI integration test in cli_declarative.rs
- Add mapping unit test in env_mapping.rs
- Add snapshot test in info_snapshots.rs

All 329 tests passing.

Amp-Thread-ID: https://ampcode.com/threads/T-498346d9-f5bd-4c4d-a1a3-90ea721ff4c8
Co-authored-by: Amp <amp@ampcode.com>
@technicalpickles technicalpickles marked this pull request as ready for review October 2, 2025 15:19
Copilot AI review requested due to automatic review settings October 2, 2025 15:19
@technicalpickles technicalpickles merged commit d214212 into main Oct 2, 2025
4 checks passed
@technicalpickles technicalpickles deleted the add-amp-agent-detection branch October 2, 2025 15:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for detecting the Amp agent when running in agent mode using the AGENT=amp environment variable. This enhancement allows envsense to properly identify and report the Amp development agent context.

  • Add Amp agent detection with HIGH confidence level mapping
  • Include comprehensive test coverage across unit, integration, and snapshot tests
  • Register Amp agent descriptor with display name and capabilities

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/detectors/env_mapping.rs Adds Amp agent detection mapping and unit test
src/agent.rs Registers Amp agent descriptor with display name and capabilities
src/detectors/agent_declarative.rs Adds unit test for Amp agent detection
tests/cli_declarative.rs Adds CLI integration test for Amp agent detection
tests/info_snapshots.rs Adds snapshot test for Amp agent detection
tests/snapshots/info_snapshots__amp.snap Generated snapshot file for Amp agent detection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

2 participants