Skip to content

feat: detect Warp agent via OZ_RUN_ID#90

Merged
ascorbic merged 2 commits into
mainfrom
warp-agent-detection
Jun 23, 2026
Merged

feat: detect Warp agent via OZ_RUN_ID#90
ascorbic merged 2 commits into
mainfrom
warp-agent-detection

Conversation

@ascorbic

Copy link
Copy Markdown
Owner

Fixes #89.

Problem

Warp was detected from TERM_PROGRAM=WarpTerminal, which Warp sets in every window whether or not its agent is active. Running astro dev by hand in Warp therefore tripped detection (reported as a hybrid environment), causing tools like Astro to switch into agent/background mode for an ordinary interactive session.

The hybrid entry only ever existed because, at the time it was added, there was no way to detect Warp's actual agent. There now is.

Change

Warp's agent ("Oz") sets OZ_RUN_ID for the commands it runs, and reads it back to detect it is inside an agent run (verified in Warp's now-open-source code: warp_cli/src/lib.rs, applied in agent_sdk/driver/harness/mod.rs, read back in agent_sdk/ambient.rs).

So this PR:

  • Detects Warp via OZ_RUN_ID and reports it as type: "agent" (was "hybrid" via TERM_PROGRAM).
  • Renames the provider name from "Warp Terminal" to "Warp" (id stays warp).
  • Plain Warp sessions are no longer detected at all — only commands run under its agent.

When Warp orchestrates a third-party harness (Claude Code, Codex, Gemini, opencode), that harness still sets its own signal and is detected as itself (it appears earlier in the provider list), so this only claims the native-agent case.

Notes

  • There are no hybrid providers left after this. The hybrid type and isHybrid() remain in the API; tests updated accordingly.
  • Verified end-to-end: OZ_RUN_ID set → {"id":"warp","type":"agent"}; TERM_PROGRAM=WarpTerminal alone → not detected.

Warp was detected from TERM_PROGRAM=WarpTerminal, which is set in every
Warp window regardless of agent use, causing false positives for people
using Warp as a regular terminal (#89).

Warp's agent ("Oz") sets OZ_RUN_ID for commands it runs and reads it back
to detect it is inside an agent run, so key detection on that and report
Warp as an agent rather than a hybrid environment.
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 47111cf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
am-i-vibing Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ascorbic ascorbic merged commit 39a2d13 into main Jun 23, 2026
1 check passed
@ascorbic ascorbic deleted the warp-agent-detection branch June 23, 2026 17:52
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.

Warp terminal detected as "vibing"

1 participant