Skip to content

fix: logs.file: false in config file ignored when using CLI#3469

Merged
mrlubos merged 3 commits intomainfrom
copilot/fix-logs-file-setting
Feb 27, 2026
Merged

fix: logs.file: false in config file ignored when using CLI#3469
mrlubos merged 3 commits intomainfrom
copilot/fix-logs-file-setting

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

Commander.js's --no-log-file negation option always populates logFile (defaulting to true when not explicitly passed). cliToConfig unconditionally spread file: cli.logFile into the config, so the CLI always sent { logs: { file: true } } to createClient. mergeConfigs then overwrote the config file's { file: false } with the CLI's { file: true }.

Changes

  • cli/adapter.ts: Change condition from cli.logFile !== undefined to cli.logFile === false — only inject file: false when --no-log-file is explicitly passed; omit file entirely otherwise, letting config file values take effect
  • __tests__/cli.test.ts: Update tests to reflect that default CLI invocations no longer inject file: true into the logs config
// openapi-ts.config.ts
export default {
  logs: { file: false }, // now respected — no crash log written on error
  input: '...',
};
Original prompt

This section details on the original issue you should resolve

<issue_title>Settings logs file to false still creates a logs file on error</issue_title>
<issue_description>### Description

When setting the following settings in my openapi-config.ts I still get an error logs file on error. It seems this settings is not applied at all.

  logs: {
    // this has no effect
    file: false,
  },

Reproducible example or configuration

See Stackblitz with gibberish url, which will cause an error to be thrown and an error file to be created, even though file is set to false
https://stackblitz.com/edit/hey-api-client-fetch-example-xkcxetrp

OpenAPI specification (optional)

No response

System information (optional)

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@changeset-bot
Copy link

changeset-bot bot commented Feb 26, 2026

🦋 Changeset detected

Latest commit: 9e3d347

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hey-api/openapi-ts Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hey-api-docs Ready Ready Preview, Comment Feb 27, 2026 9:03am

Request Review

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with logs file creation on error fix: logs.file: false in config file ignored when using CLI Feb 26, 2026
@mrlubos mrlubos marked this pull request as ready for review February 27, 2026 09:03
@pullfrog
Copy link

pullfrog bot commented Feb 27, 2026

Leaping into action...

Pullfrog  | View workflow run | Using OpenCode | Triggered by Pullfrogpullfrog.com𝕏

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug 🔥 Broken or incorrect behavior. labels Feb 27, 2026
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.11%. Comparing base (75d9833) to head (9e3d347).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3469   +/-   ##
=======================================
  Coverage   40.11%   40.11%           
=======================================
  Files         478      478           
  Lines       17488    17488           
  Branches     5294     5300    +6     
=======================================
  Hits         7016     7016           
  Misses       8425     8425           
  Partials     2047     2047           
Flag Coverage Δ
unittests 40.11% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 27, 2026

Open in StackBlitz

@hey-api/codegen-core

npm i https://pkg.pr.new/@hey-api/codegen-core@3469

@hey-api/json-schema-ref-parser

npm i https://pkg.pr.new/@hey-api/json-schema-ref-parser@3469

@hey-api/nuxt

npm i https://pkg.pr.new/@hey-api/nuxt@3469

@hey-api/openapi-ts

npm i https://pkg.pr.new/@hey-api/openapi-ts@3469

@hey-api/shared

npm i https://pkg.pr.new/@hey-api/shared@3469

@hey-api/types

npm i https://pkg.pr.new/@hey-api/types@3469

@hey-api/vite-plugin

npm i https://pkg.pr.new/@hey-api/vite-plugin@3469

commit: 98e7402

@mrlubos mrlubos merged commit a6c2e78 into main Feb 27, 2026
12 of 17 checks passed
@mrlubos mrlubos deleted the copilot/fix-logs-file-setting branch February 27, 2026 09:12
@hey-api hey-api bot mentioned this pull request Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔥 Broken or incorrect behavior. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings logs file to false still creates a logs file on error

2 participants