Skip to content

Conversation

@fangchenli
Copy link
Contributor

Summary

Fixes 7 issues identified during code review of PR #12:

  • API key security: Pass Gemini API key via x-goog-api-key header instead of URL query parameter to prevent leakage in logs/tracebacks
  • SDK system_instruction: Use Gemini SDK's native system_instruction parameter instead of concatenating system messages into the user prompt
  • Dedup content builders: Merge _build_sdk_contents and _build_http_contents into a single _build_contents method
  • Redact error traces: Apply redact_text() to llm_call_failed trace error messages to prevent sensitive data in traces
  • Fix protocol info key: _extract_protocol_info was reading "protocol" instead of "protocol_name", causing empty protocol name in inspect output
  • Fix CLI error message: Catch-all error was referencing ANTHROPIC_API_KEY instead of being provider-agnostic
  • Wire LLM step guard: Add check_llm_allowed_in_step("work") runtime guard in the engine to enforce the LLM-only-in-WORK invariant

Test plan

  • All 373 tests pass
  • mypy passes
  • ruff passes
  • Pre-commit hooks pass

🤖 Generated with Claude Code

- Pass Gemini API key via x-goog-api-key header instead of URL query
  parameter to prevent key leakage in logs and tracebacks
- Use Gemini SDK's native system_instruction parameter instead of
  concatenating system messages into the user prompt
- Deduplicate _build_sdk_contents and _build_http_contents into a
  single _build_contents method
- Redact error messages in llm_call_failed trace events using
  redact_text() to prevent sensitive data in traces
- Fix _extract_protocol_info reading wrong key ("protocol" vs
  "protocol_name") causing empty protocol name in inspect output
- Fix CLI catch-all error message referencing ANTHROPIC_API_KEY
  instead of being provider-agnostic
- Wire check_llm_allowed_in_step runtime guard into the engine's
  PROPOSE step to enforce the LLM-only-in-WORK invariant

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@fangchenli fangchenli merged commit aad0c0d into main Jan 28, 2026
3 checks passed
@fangchenli fangchenli deleted the fix/pr12-review-issues branch January 28, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant