Skip to content

Format CLI errors and centralize output fallback#83

Merged
fuxingloh merged 12 commits intomainfrom
copilot/format-use-agently-errors-again
Mar 19, 2026
Merged

Format CLI errors and centralize output fallback#83
fuxingloh merged 12 commits intomainfrom
copilot/format-use-agently-errors-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

CLI errors were surfacing raw stack traces; defaults weren’t consistently respecting output format resolution.

  • Error formatting: Added handleCliError to render unexpected failures as boxen in TTY, JSON/plain otherwise; wired into CLI entry to catch parseAsync failures.
  • Output resolution: Centralized resolveOutputFormat in output.ts with a safe fallback and warning when option parsing fails.
  • Tests: Added/updated errors.test.ts to cover formatting paths and exit behavior.

Example:

// packages/use-agently/src/bin.ts
try {
  await cli.parseAsync();
  await Promise.all([checkAutoUpdate(), flushTelemetry()]);
} catch (err) {
  handleCliError(err, resolveOutputFormat(cli));
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • mainnet.base.org
    • Triggering command: /usr/local/bin/node node dist/cli.js dev --anvil-port 8545 --anvil-host 0.0.0.0 --port 4022 --network base (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 11 commits March 17, 2026 17:28
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Co-authored-by: fuxingloh <4266087+fuxingloh@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix formatting of use-agently error messages Format CLI errors and centralize output fallback Mar 17, 2026
Copilot AI requested a review from fuxingloh March 17, 2026 17:40
@fuxingloh fuxingloh marked this pull request as ready for review March 19, 2026 06:24
@fuxingloh fuxingloh merged commit 37562d3 into main Mar 19, 2026
6 checks passed
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.

2 participants