Repository navigation
feat(cli): automatically detect coding agents - #145
Merged
Merged
Conversation
Enable the existing agent preset for recognized agent environments when stdout is piped and no explicit output format was requested. Select it before parsing so help and parse errors remain machine readable. Add --no-agent and ALTERTABLE_AGENT_MODE overrides, preserve explicit format behavior, and isolate human-mode tests from inherited agent markers.
leonkenneth
approved these changes
Oct 15, 2026
This was referenced Oct 15, 2026
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.
Coding agents currently need to pass
--agenton every invocation to receive structured output. Inspired by DuckDB’s agent detection, this change automatically enables the existing agent preset when a recognized agent environment marker is nonempty, stdout is not a terminal, and no explicit output format was requested.Detection happens before command parsing, so agents receive structured help and JSON errors as well as JSON results. Explicit
--jsonand--formatselections bypass automatic detection.Add
--no-agentandALTERTABLE_AGENT_MODE=1|0overrides. CLI flags take precedence over the environment, and--no-agentwins when both flags are supplied. Existing preset restrictions remain: commands that stream subprocess output, such asapp buildandapp dev, require--no-agentin detected agent environments.Update documentation and generated command references, add regression coverage, and isolate human-output tests from inherited agent settings.