bytedance / bytedance/pdf-parser
fix: show effective Uvicorn defaults in serve help
- Dominant language
- Python
- Stars
- 14
- Forks
- 9
- Avg merge
- 43m
- Merged PRs (30d)
- 1
Description
## Problem
`hi-pdf-parser serve --help` reports option defaults from the command function's `None` sentinel values rather than the effective `UvicornSettings` defaults. One boolean is actively inverted in the help output.
This affects current `main` at `c6478aae9ab50a13fc54c0599a0a459396c15b99` and release `0.0.5`.
## Reproduction
Using the repository's locked Python 3.11 environment:
```console
python -m hi_pdf_parser serve --help
```
The output includes:
```text
--host ... [default: None]
--port ... [default: None]
--proxy-headers / --no-proxy-headers ... [default: no-proxy-headers]
--timeout-keep-alive ... [default: None]
```
However, `UvicornSettings` defines effective defaults of:
```text
host = 0.0.0.0
port = 6001
proxy_headers = true
timeout_keep_alive = 600
```
## Expected behavior
CLI help should describe the defaults that are actually passed to Uvicorn when neither a CLI option nor an environment override is supplied. In particular, it should not say proxy headers are disabled when they are enabled.
## Impact
Operators can configure networking and reverse-proxy behavior based on incorrect help text.
## Why there is no PR in this report
The `None` values currently preserve the distinction between explicit CLI overrides and `UVICORN_*`/`.env` settings. A fix needs a decision on whether help should show static built-in defaults, resolve the current environment dynamically, or describe environment precedence without labeling a concrete default. That public CLI/configuration presentation choice is left to maintainers.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the `serve` CLI entry point and `UvicornSettings`, then reproduce the output with `python -m hi_pdf_parser serve --help`. Resolve how help should present static defaults, environment overrides, and precedence; done means the displayed defaults accurately describe effective behavior without inverting proxy-headers status.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100