Dead or unreachable code found
arena/app.py
clear_histories() (line ~1208) — never wired to any Gradio event; the only reference in the whole repo is its own test (tests/integration/test_callbacks.py::test_clear_histories_clears_user_input_and_resets_outputs). Either wire up a Clear button or delete the function and its test.
_remove_vote_record() (line ~323, the locking wrapper) — never called; only _remove_vote_record_unlocked() is used inside _persist_vote_submission.
if __name__ == "__main__": block (line ~1558) — duplicates arena/__main__.py::main() verbatim. One launch path is enough.
arena/core/api.py
async def main() demo + if __name__ == "__main__": (lines ~447–488) — ~45 lines of demo scaffolding inside a library module, with hardcoded model IDs and a stale site_url="http://localhost:6767" that contradicts arena/ui/config.py. If a manual smoke script is wanted, move it to scripts/ or an example; otherwise delete. This also makes load_dotenv/os imports in api.py removable.
arena/state/round.py
_model_ids_from_state() (line ~160) — no callers anywhere (arena or tests).
arena/ui/display.py
_empty_display_state() (line ~432) — no callers; it's just an alias for _empty_round_state().
_streaming_outputs() default chatbot_updates branch calls _targeted_chatbot_value_updates([], _default_display_order()), which is an obfuscated way of producing three gr.skip()s. Replace with an explicit (gr.skip(), gr.skip(), gr.skip())/helper for readability.
arena/core/reasoning.py
- The entire max-tokens capability computation is dead:
supports_max_tokens, default_max_tokens, max_reasoning_tokens, has_token_ceiling, and REASONING_TOKEN_BUDGET_OUTPUT_RATIO are computed and returned by reasoning_capabilities_for_model(), but nothing consumes them — control_type can only be "effort"/"none", normalize_reasoning_payload() only handles effort, and the UI only renders an effort dropdown. ~30 lines of logic + fields that only exist to be carried around. Delete until a token-budget control actually ships (git history preserves it).
Why it matters
This is a small app (~2 KLOC of source); the dead paths meaningfully add review surface, misleading capability metadata in logged payloads, and tests that pin unused behavior.
Dead or unreachable code found
arena/app.pyclear_histories()(line ~1208) — never wired to any Gradio event; the only reference in the whole repo is its own test (tests/integration/test_callbacks.py::test_clear_histories_clears_user_input_and_resets_outputs). Either wire up a Clear button or delete the function and its test._remove_vote_record()(line ~323, the locking wrapper) — never called; only_remove_vote_record_unlocked()is used inside_persist_vote_submission.if __name__ == "__main__":block (line ~1558) — duplicatesarena/__main__.py::main()verbatim. One launch path is enough.arena/core/api.pyasync def main()demo +if __name__ == "__main__":(lines ~447–488) — ~45 lines of demo scaffolding inside a library module, with hardcoded model IDs and a stalesite_url="http://localhost:6767"that contradictsarena/ui/config.py. If a manual smoke script is wanted, move it toscripts/or an example; otherwise delete. This also makesload_dotenv/osimports inapi.pyremovable.arena/state/round.py_model_ids_from_state()(line ~160) — no callers anywhere (arena or tests).arena/ui/display.py_empty_display_state()(line ~432) — no callers; it's just an alias for_empty_round_state()._streaming_outputs()defaultchatbot_updatesbranch calls_targeted_chatbot_value_updates([], _default_display_order()), which is an obfuscated way of producing threegr.skip()s. Replace with an explicit(gr.skip(), gr.skip(), gr.skip())/helper for readability.arena/core/reasoning.pysupports_max_tokens,default_max_tokens,max_reasoning_tokens,has_token_ceiling, andREASONING_TOKEN_BUDGET_OUTPUT_RATIOare computed and returned byreasoning_capabilities_for_model(), but nothing consumes them —control_typecan only be"effort"/"none",normalize_reasoning_payload()only handles effort, and the UI only renders an effort dropdown. ~30 lines of logic + fields that only exist to be carried around. Delete until a token-budget control actually ships (git history preserves it).Why it matters
This is a small app (~2 KLOC of source); the dead paths meaningfully add review surface, misleading capability metadata in logged payloads, and tests that pin unused behavior.