Skip to content

fix(setup): show non-interactive setup results in a terminal - #10546

Merged
N0zoM1z0 merged 1 commit into
mainfrom
fix/setup-yes-terminal-summary
Nov 14, 2026
Merged

N0zoM1z0 merged 1 commit into
mainfrom
fix/setup-yes-terminal-summary

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

rea setup --yes in a terminal applied its changes and printed nothing. Setup's result is agent-only, which incur hides when stdout is a TTY and no --format is given. REA rendered a summary only for an interactive setup, or for a dry run when stdin, stdout and stderr were all terminals. It now renders the dry-run plan or the existing result summary whenever incur hides the result.

Fixes #10531 (split out of #2164). Based on #2185 by balkan16 (co-author), reduced to one renderer under one hidden-output check.

Change and scope

  • setupCommands.ts: after a non-interactive setup, render under incur's own condition (process.stdout.isTTY === true && !formatExplicit). That covers --yes, a setup that needs confirmation because stdin is redirected, and a dry run with redirected stdin. Main's dry-run renderer, and the remediation it now shows, are kept.
  • Not taken from fix(setup): show non-interactive setup results in a terminal #2185: its separate needs_human / not-completed renderer and the SetupHost changes. The existing result renderer already shows the remediation.

Contribution scope: ordinary fix within existing boundaries; maintainer scope decision not applicable.

  • Read existing files or captured data.

Evidence and regression coverage

cliSetup.test.ts runs setup --yes --client codex --skill=false under node-pty and expects "Restart Codex to load REA." plus the written config. It fails on base and passes with the fix. The TTY dry-run tests now use the same runSetupInTty helper, which applies the file's isolatedSetupEnvironment (including CODEX_HOME). Before that review fix, both TTY tests failed when the parent had CODEX_HOME set.

Validation performed

  • npm run test:focused -- tests/boundary/cli/cliSetup.test.ts, after rebasing onto current main: 30 passed.
  • npm run check:fast (pre-push): passed. oxfmt --check: clean.

Compatibility, safety, and release

  • Breaking changes: none. Structured output for pipes and explicit --format is unchanged.

Author readiness

Human owner: N0zoM1z0 (PR author, exempt from the declaration per CONTRIBUTING.md).

Supersedes #2185.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T14:01:17.963547Z
We couldn’t complete this review. Comment @codex review to try again.
ea7d5c0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

[Medium impact] The change affects terminal output for the setup command.

Fix the test's inherited CODEX_HOME before merging so it cannot change a developer's real configuration.

Findings

  1. P1 Test changes real Codex settings ▶
Fix with agent prompt
### Issue 1
tests/boundary/cli/cliSetup.test.ts:383-388
If a developer has `CODEX_HOME` set, this new `--yes` test writes to that Codex directory instead of the temporary home. `runSetupInTty` inherits the variable, and Codex path selection gives it precedence over `HOME`. Setup can change the developer's real REA registration and leave it changed after the test fails its temporary-path assertion.

Set `CODEX_HOME` in the shared helper, preferably by reusing `isolatedSetupEnvironment(home)`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Shows setup plans or result summaries when stdout is a terminal and no format was explicitly selected.

  • Non-interactive setup runs show their result in a terminal.

Reviews (1) · Last reviewed commit: "fix(setup): show non-interactive setup r..." · Reviewed by Greptile

Comment on lines +383 to +388
const { exitCode, output } = await runSetupInTty(home, [
"--yes",
"--client",
"codex",
"--skill=false",
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Test changes real Codex settings

If a developer has CODEX_HOME set, this new --yes test writes to that Codex directory instead of the temporary home. runSetupInTty inherits the variable, and Codex path selection gives it precedence over HOME. Setup can change the developer's real REA registration and leave it changed after the test fails its temporary-path assertion.

Set CODEX_HOME in the shared helper, preferably by reusing isolatedSetupEnvironment(home).

Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/boundary/cli/cliSetup.test.ts
Line: 383-388

Comment:
**Test changes real Codex settings**

If a developer has `CODEX_HOME` set, this new `--yes` test writes to that Codex directory instead of the temporary home. `runSetupInTty` inherits the variable, and Codex path selection gives it precedence over `HOME`. Setup can change the developer's real REA registration and leave it changed after the test fails its temporary-path assertion.

Set `CODEX_HOME` in the shared helper, preferably by reusing `isolatedSetupEnvironment(home)`.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid, thanks, and it affected the existing TTY dry-run tests too. runSetupInTty now spreads the file's isolatedSetupEnvironment(home) (HOME, USERPROFILE, CODEX_HOME and the XDG bases) over the inherited environment. With CODEX_HOME=/nonexistent/... set in the parent, both TTY tests failed before this change and all 30 pass after it.

Setup's result is agent-only, so incur hides it when stdout is a terminal and
no format was chosen. Only an interactive setup or a fully interactive TTY dry
run rendered a summary, so `rea setup --yes` printed nothing. Render the dry
run plan or the existing result summary under incur's own hidden-output
condition instead.

Fixes #10531
Supersedes #2185

Co-Authored-By: balkan16 <[email protected]>
Co-Authored-By: gensokyo-dev <[email protected]>
@gensokyo-dev
gensokyo-dev force-pushed the fix/setup-yes-terminal-summary branch from ea7d5c0 to 60ada9b Compare November 14, 2026 14:29
@N0zoM1z0
N0zoM1z0 merged commit 101e098 into main Nov 14, 2026
99 of 102 checks passed
@N0zoM1z0
N0zoM1z0 deleted the fix/setup-yes-terminal-summary branch November 14, 2026 15:06
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.

[Bug] rea setup --yes prints nothing in an interactive terminal

2 participants