Provider error text repeats a secret embedded in the base URL
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Read crates/formless-core/src/errors.rs around explain, then compare URL sanitization in crates/formless-core/src/rate_limits.rs (display_endpoint) and the provider identity check in tokens.rs. Update the host and unreachable URL handling to remove userinfo, query, and fragment while preserving path and port; verify the listed credential, localhost, Groq, and plain localhost cases, including messages_name_the_next_step.
Written by the indexing model from the issue text.
Description
What is wrong
Provider error explanations repeat a secret that was embedded in provider.base_url.
For https://user:[email protected]/v1?api_key=secret:
- An auth failure says
The API key was rejected by user:[email protected]. - A rate limit says
user:[email protected] is rate limiting or out of quota. - A model or server error names that same
user:secret@…host. - An unreachable error says
Can't reach https://user:[email protected]/v1?api_key=secret.The query and any fragment are included too.
host is whatever sits between :// and the next /. That keeps userinfo. The unreachable line prints ctx.base_url unchanged.
user:secret@localhost:11434 also misses the local-server hint. local is host.starts_with("localhost"), and this host starts with user.
https://api.groq.com/openai/v1 still says api.groq.com. http://localhost:11434/v1 still suggests ollama serve.
Where
crates/formless-core/src/errors.rs, explain. The host split is base_url.split("://").nth(1) then split('/'). The unreachable message is Can't reach {}. with ctx.base_url. messages_name_the_next_step only uses URLs that have no userinfo.
crates/formless-core/src/rate_limits.rs, display_endpoint, already clears the username, password, query, and fragment before a rate-limit line is shown. provider_key in tokens.rs asserts that https://user:[email protected]/v1 does not leave secret in the provider identity.
Why it matters
A proxy or gateway base URL often carries the credential in userinfo or the query. The explanation is what /resume, the TUI, and formless doctor show after a failure. The secret is then on screen and in the explained error, even though the usage line for the same endpoint is redacted.
Suggested fix
Name the host and the unreachable URL with the userinfo, query, and fragment removed, the way display_endpoint does. Keep the path and port. The API key was rejected by example.test. for the URL above, and Can't reach must not contain secret. user:secret@localhost:11434 should still take the Ollama hint. Leave api.groq.com and a plain localhost:11434 URL as they are.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 12h 10m
- Merged PRs (30d)
- 780
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from athiwatc/formless
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
All issues in athiwatc/formless
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
topgrade-rs/topgrade#2540 ·
Maintainers usually reply within 1 day
-
Invalid JSON options for ngram and edge_ngram silently use defaultsPossibly taken @Tilendlesa claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
noemaforge/vimanam#153 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
mufeedvh/code2prompt#355 ·