fix(bench): remove hardcoded credential paths from benchmark runners#177
Conversation
The `_load_api_key()` function in longmemeval_bench.py and locomo_bench.py searched for API keys in a fixed path (`~/.config/lu/keys.json`) using personal key names (`anthropic_milla`, `anthropic_claude_code_main`). This leaks internal infrastructure details into the public codebase and trains contributors to store credentials in a non-standard location rather than using the standard ANTHROPIC_API_KEY env var. Simplified to: CLI flag > env var > empty string. Updated help text and HYBRID_MODE.md docs to match. Co-Authored-By: Tadao <[email protected]>
PR Review: fix(bench): remove hardcoded credential paths from benchmark runnersExecutive Summary
Affected Areas: Business Impact: None — removes dead infrastructure-specific code that external contributors could never use anyway. Flow Changes: Ratings
PR Health
AnalysisWhat Changed
Verification
IssuesNo issues found. This is a clean removal of personal infrastructure details that leaked into the public codebase. The change is complete and consistent across all 3 files. Created by Octocode MCP https://octocode.ai 🔍🐙 |
web3guru888
left a comment
There was a problem hiding this comment.
🔧 Review of #177 — fix(bench): remove hardcoded credential paths from benchmark runners
Scope: +4/−44 · 3 file(s)
benchmarks/HYBRID_MODE.md(modified: +0/−1)benchmarks/locomo_bench.py(modified: +1/−18)benchmarks/longmemeval_bench.py(modified: +3/−25)
🟢 Approved — clean, well-structured PR. Good work @travisbreaks!
🏛️ Reviewed by MemPalace-AGI · Autonomous research system with perfect memory · Showcase: Truth Palace of Atlantis
bensig
left a comment
There was a problem hiding this comment.
Code review + security audit clean.
…n conflicts Merge upstream/develop: MemPalace#177, MemPalace#361, MemPalace#449, MemPalace#450 (benchmarks, tilde expand, duplicate cache vars, test fixture cleanup). Merge upstream/main: MemPalace#666 (z3tz3r0's block reason disambiguation). Conflict resolution: keep our scoped "For THIS save" phrasing instead of MemPalace#666's absolute "Do NOT write to auto-memory" — both memory systems are used in tandem. Also drop "AAAK-compressed" from diary instructions since diary_write is plain text, not AAAK dialect. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Summary
_load_api_key()fallback to~/.config/lu/keys.jsonwith personal key names (anthropic_milla,anthropic_claude_code_main) fromlongmemeval_bench.pyandlocomo_bench.py--llm-keyflag >ANTHROPIC_API_KEYenv varHYBRID_MODE.mddocs to matchThe hardcoded path and personal key names leak internal infrastructure details. The standard
ANTHROPIC_API_KEYenv var is the expected pattern for Anthropic API consumers.Context
Identified while reviewing the security fixes in PR #34, which bundled this with several other changes. Per reviewer feedback on #34, submitting as a focused standalone fix.
Test plan
pytest tests/ -vpasses (benchmarks are not part of the test suite)python benchmarks/longmemeval_bench.py --helpshows updated help textANTHROPIC_API_KEY=sk-ant-... python benchmarks/longmemeval_bench.py ... --mode diarystill works🤖 Generated with Claude Code