feat: detect Warp agent via OZ_RUN_ID#90
Merged
Merged
Conversation
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 detectedLatest commit: 47111cf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #89.
Problem
Warp was detected from
TERM_PROGRAM=WarpTerminal, which Warp sets in every window whether or not its agent is active. Runningastro devby hand in Warp therefore tripped detection (reported as ahybridenvironment), causing tools like Astro to switch into agent/background mode for an ordinary interactive session.The
hybridentry 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_IDfor 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 inagent_sdk/driver/harness/mod.rs, read back inagent_sdk/ambient.rs).So this PR:
OZ_RUN_IDand reports it astype: "agent"(was"hybrid"viaTERM_PROGRAM).namefrom"Warp Terminal"to"Warp"(id stayswarp).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
hybridproviders left after this. Thehybridtype andisHybrid()remain in the API; tests updated accordingly.OZ_RUN_IDset →{"id":"warp","type":"agent"};TERM_PROGRAM=WarpTerminalalone → not detected.