Fix api_name=False handling in Gradio API info (PR #13508)
Session from gradio-pi-sessions on Hugging Face by abidlabs · MIT · condensed by Coders Talk
Click a segment to jump to that moment
4msession
0interventions
by library · 1d
GOAL
Review PR #13508's fix for the api_name=False TypeError bug, assess reviewer feedback, and implement the agreed-upon correction.
- +0Prompt · +0Review PR #13508 and its comments — do you agree with the suggestions?
- +0mAgent did · +0mInvestigated the PR diff, linked issue #13482, and reproduced the underlying bug: api_name=False leaves fn.api_name as a boolean, which crashes ORJSONResponse with 'Dict key must be str' when used as a dict key in monitoring/analytics.
- +1mAgent did · +1mConcluded the PR's fix (setting api_visibility='private') was directionally correct but incomplete, since fn.api_name remained a bool causing the TypeError elsewhere.
- +2mPrompt · +2mCan we just set api_name = "false" for internal usage, no need to test
- +2mAgent did · +2mAgreed with the approach, specifying that api_name = "false" must be set before append_unique_suffix is called, and recommended changing the changeset from minor/feat to patch/fix.
- +2mPrompt · +2mYes ok do that and push
- +3mAgent did · +3mChecked out the PR branch, edited gradio/blocks.py to set api_name = "false" before api_visibility assignment, updated the changeset to patch/fix, verified behavior with a manual script, and committed the change.
- +3mFail · +3mgit push was rejected because the remote branch had moved ahead (fetch first error).
- +3mAgent did · +3mFetched the updated remote branch, rebased the local commit on top, re-verified the fix, and successfully pushed commit f2771b8d4 to the PR branch.
- +4mOutcome · +4mPushed fix commit f2771b8d4 to PR #13508: api_name=False now coerced to string 'false' (private), changeset downgraded from minor/feat to patch/fix.
VERDICT
I'd start by pointing the agent straight at the linked issue and asking it to reproduce the crash before reviewing the PR diff, since that's what actually clarified whether the reviewers' concerns were valid. My decision to just coerce api_name to the string "false" instead of writing a proper test was the call that kept this fast — the agent's own investigation had already proven the bug and the fix was small enough not to need one.