Skip to content

feat(runtime): detect universal agent environment mode#15

Open
robinbraemer wants to merge 2 commits into
mainfrom
add-agent-env-detection
Open

feat(runtime): detect universal agent environment mode#15
robinbraemer wants to merge 2 commits into
mainfrom
add-agent-env-detection

Conversation

@robinbraemer

Copy link
Copy Markdown
Member

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

  • Added universal AGENT environment variable detection to runtime mode selection so AGENT=true and named agent values trigger agent output mode.
  • Covered the new AGENT detection paths with focused runtime mode tests while preserving existing provider-specific and automation environment behavior.
  • Updated README and architecture docs to include the universal AGENT mode 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=true and AGENT=codex switch the CLI to agent output, and existing CODEX_SANDBOX=1 and CI=true behavior still selects agent output.

Evidence: Pseudo-terminal CLI transcript showing baseline human output, AGENT-triggered agent output, and preserved provider/CI behavior
## TTY baseline without automation env (expected human output)
0.0.0
{
  "version": "0.0.0"
}

## TTY with AGENT=true (expected agent output)
status: ok
command: akua --version
observations[1]:
  0.0.0
data:
  version: 0.0.0

## TTY with AGENT=codex (expected agent output)
status: ok
command: akua --version
observations[1]:
  0.0.0
data:
  version: 0.0.0

## Existing provider env still triggers agent mode
status: ok
command: akua --version
observations[1]:
  0.0.0
data:
  version: 0.0.0

## Existing automation env still triggers agent mode
status: ok
command: akua --version
observations[1]:
  0.0.0
data:
  version: 0.0.0

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.ts
  • bun test test/cli.test.ts
  • script -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.

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.

1 participant