feat(runtime): detect universal agent environment mode#15
Open
robinbraemer wants to merge 2 commits into
Open
Conversation
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.
Intent
Add universal AGENT environment variable support to Akua CLI runtime mode detection. AGENT=true and AGENT= should both trigger agent output mode while preserving the existing provider-specific and automation env var behavior. Keep the change small and focused to src/runtime/mode.ts with targeted tests for the two requested AGENT forms; avoid broader CLI architecture changes or infra mutations beyond pushing the PR requested by the user.
What Changed
AGENTenvironment variable detection to runtime mode selection soAGENT=trueand named agent values trigger agent output mode.AGENTdetection paths with focused runtime mode tests while preserving existing provider-specific and automation environment behavior.AGENTmode detection signal.Risk Assessment
✅ Low: The change is narrowly scoped to adding AGENT to existing environment detection and targeted tests, with no material correctness or compatibility risks found.
Testing
Focused runtime and CLI entrypoint tests passed; the pseudo-terminal transcript demonstrates that a clean TTY defaults to human output,
AGENT=trueandAGENT=codexswitch the CLI to agent output, and existingCODEX_SANDBOX=1andCI=truebehavior still selects agent output.Evidence: Pseudo-terminal CLI transcript showing baseline human output, AGENT-triggered agent output, and preserved provider/CI behavior
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bun test test/mode.test.tsbun test test/cli.test.tsscript -q /var/folders/1y/cjgf53nj31n_dxsspqnjfjvc0000gn/T/no-mistakes-evidence/01KX34KEY9M99GAG1W9W8QWTG6/agent-env-tty-transcript.txt /bin/zsh -lc '<TTY baseline plus AGENT=true, AGENT=codex, CODEX_SANDBOX=1, CI=true akua --version checks>'✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.