#6110: refactor: simplify boolean logic using nullish coalescing
Cluster:
Refactor Console Logging in Agents
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR refactors `formatTerminalLink` in `src/utils.ts` to simplify the `allow` computation for emitting OSC-8 terminal hyperlinks. The nested ternary that treated `opts.force` as a tri-state override is replaced with nullish coalescing, keeping the default behavior of enabling links only when `process.stdout.isTTY` is truthy and allowing explicit `true`/`false` overrides.
Change is localized to a utility function used for terminal output formatting; no broader control flow or API surface changes are introduced.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a small refactor in a single utility function that preserves the intended tri-state behavior of `opts.force` (true/false override, otherwise fall back to TTY detection) via `??`. No behavioral change is apparent for valid inputs, and the modification is unlikely to impact unrelated parts of the codebase.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#3978: refactor: changing nested ternaries to a switch statement
by watercubz · 2026-01-29
78.6%
#3872: improve bash-tools.exec.ts code quality
by Bestom927 · 2026-01-29
78.4%
#9974: refactor(agents): replace console.warn with SubsystemLogger in comp...
by dinakars777 · 2026-02-05
77.4%
#6059: fix #6044
by vivganes · 2026-02-01
77.3%
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
77.0%
#8800: chore: apply oxfmt formatting
by shamsulalam1114 · 2026-02-04
76.9%
#9273: Add files via upload
by cyrilliu1974 · 2026-02-05
76.9%
#13838: UI: fix config panel CI failures and modularize rendering
by fresed05 · 2026-02-11
76.6%
#7701: Update README.md
by stephenchen2025 · 2026-02-03
76.4%
#7919: feat: implement timezone support for console timestamps and add ver...
by southpy · 2026-02-03
75.8%