mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4499] [CLOSED] [Benchmark] "none" is no key for --credential-env; the key is redacted as written and as a whole word #5068
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5068
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4499
Author: @coryjett
Created: 10/28/2026
Status: ❌ Closed
Base:
main← Head:fix-bench-none-key📝 Commits (1)
9c56d12bench: "none" is no key for --credential-env; the key is redacted as written and as a whole word (#4483)📊 Changes
5 files changed (+67 additions, -7 deletions)
View changed files
📝
strata_cli/bench_facts.py(+12 -3)📝
strata_cli/cli.py(+1 -1)➕
tests/terminal/test_bench_redactor.py(+41 -0)📝
tools/strata_bench.py(+5 -3)📝
tools/test_strata_bench.py(+8 -0)📄 Description
Problem and result
Fixes #4483. With a run config whose
api_keyis"none"andSTRATA_KEY=nonein the environment,strata bench run --profile ... --credential-env STRATA_KEYsentBearer noneon every request and, because theredactor replaced the key as a case-insensitive substring, wrote "the first mpty reasoning" for "nonempty" in its
README (the run in #4468). Any key of four or more characters that is also a common word, or a short hex string that
occurs inside a hash, corrupted the README, outputs.jsonl, config.json and engine.log the same way.
After:
bench_facts.credential_value()treats an empty or "none" (any case) credential as no key, the same rule therun-config path already applied;
bench runuses it for--credential-env. The key is redacted exactly as written(case-sensitive) and only as a whole word, in
strata_cli/bench_facts.pyand intools/strata_bench.py. User andhost names, home folders and private addresses are redacted as before.
Related discussion
#4483
Approach
A small helper plus an
exactflag on the redactor'sadd()in both runners. TheBearer <token>pattern isunchanged, so an authorization header is still hidden whatever the key. Touches
strata_cli/cli.pyat thebench runkey read (~line 1255), well away from #4476's_redact_argvchange; the two apply independently.Validation
Passed:
python3.12 -m unittest tests.terminal.test_bench_redactor tools.test_strata_bench tests.terminal.test_bench_standard tests.terminal.test_bench_facts_amd:Ran 106 tests in 54.144s, OK (1 skipped). Strata Control 0.1.52's bundled Python 3.12.15, Ubuntu 26.10, this branch (main
46c152a1+ this commit).bench_facts.py,cli.pyandtools/strata_bench.py(production files stashed, tests kept): Ran 11 tests in 0.012s FAILED (failures=3, errors=2) (credential_valueis missing on main; the substring and case cases fail).Failed:
Not run:
strata bench runwith this branch.Limits
Bearerpattern needs eight).Warning on short keys would be a separate change.
-or a word character (abcd1234-x) is not a whole word and is not replaced; theold substring match would have caught it, at the cost above.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.