Skip to content

Conversation

@benjibc
Copy link
Contributor

@benjibc benjibc commented Dec 15, 2025

Note

Introduce FIREWORKS_EXTRA_HEADERS and new get_platform_headers, updating all API calls to use it; add OpenAI API key to .env.example and adjust multipart uploads to omit Content-Type.

  • Auth/Headers:
    • Add get_extra_headers() and get_platform_headers() to centralize request headers and support FIREWORKS_EXTRA_HEADERS.
  • API Calls Updated:
    • Replace manual headers with get_platform_headers() across evaluation.py (preview/create), cli_commands/create_rft.py (polling/existence checks), fireworks_rft.py (dataset create/upload, RFT job), platform_api.py (secrets create/get/delete), and pytest/handle_persist_flow.py (dataset create/upload, job create).
    • For file uploads, omit Content-Type to allow multipart boundaries to be set by requests.
    • Add debug prints in create_dataset_from_jsonl to show extra headers usage (masked auth).
  • Env Example:
    • Add OPENAI_API_KEY to .env.example.

Written by Cursor Bugbot for commit 9761e85. This will update automatically on new commits. Configure here.


# DEBUG: Print headers (mask auth token)
debug_headers = {k: (v[:20] + "..." if k == "Authorization" else v) for k, v in headers.items()}
print(f"[DEBUG] Headers being sent: {debug_headers}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Debug print statements accidentally committed to production code

Debug print statements were left in the create_dataset_from_jsonl function. These lines print [DEBUG] prefixed messages to stdout, including the FIREWORKS_EXTRA_HEADERS environment variable value and partial authorization tokens (first 20 characters). This debugging code pollutes output for production users and potentially leaks sensitive information.

Fix in Cursor Fix in Web


# DEBUG: Print headers (mask auth token)
debug_headers = {k: (v[:20] + "..." if k == "Authorization" else v) for k, v in headers.items()}
print(f"[DEBUG] Headers being sent: {debug_headers}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Debug print statements accidentally committed to production code

Debug print statements were left in the create_dataset_from_jsonl function. These lines print [DEBUG] prefixed messages to stdout, including the FIREWORKS_EXTRA_HEADERS environment variable value and partial authorization tokens (first 20 characters). This debugging code pollutes output for production users and potentially leaks sensitive information.

Fix in Cursor Fix in Web

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +146 to +148
# DEBUG: Check environment variable
extra_headers_env = os.environ.get("FIREWORKS_EXTRA_HEADERS", "<NOT SET>")
print(f"[DEBUG] FIREWORKS_EXTRA_HEADERS env: {extra_headers_env}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Stop printing extra header secrets during dataset creation

create_dataset_from_jsonl now unconditionally prints the value of FIREWORKS_EXTRA_HEADERS (and the constructed headers below) to stdout. If callers set that env var with API tokens or other sensitive headers, every dataset creation leaks those secrets into logs/terminals because there is no debug guard or masking.

Useful? React with 👍 / 👎.

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.

2 participants