import re def create_gradio_anchor_id(text: str, validation) -> str: """ Replicates the ID format created by gr.Markdown(header_links=True). Example: "Paper Finder Validation" -> "h-paper-finder-validation" """ text = text.lower() text = re.sub(r'\s+', '-', text) # Replace spaces with hyphens text = re.sub(r'[^\w-]', '', text) # Remove non-word characters if validation: return f"h-{text}-leaderboard-1" return f"h-{text}-leaderboard" TITLE = """

OpenHands Index

""" INTRO_PARAGRAPH = """

The OpenHands Index

This is a comprehensive benchmark for evaluating AI coding agents across real-world software engineering tasks. As agents become more capable, we need ways to measure their performance across diverse challenges, from fixing bugs to building applications.

The index assesses models across five categories: Issue Resolution (fixing bugs), Greenfield (building new apps), Frontend (UI development), Testing (test generation), and Information Gathering. All models are currently evaluated using the OpenHands Software Agent SDK. This provides a single view of both performance and cost efficiency, enabling fair comparisons between agents.

For methodology details, see the About page.

""" SCATTER_DISCLAIMER = """ **Note:** Agents without cost data are displayed to the right of the vertical divider line. """ PARETO_DISCLAIMER = """ Agents names that are green are Pareto optimal, meaning they achieve the best performance for their cost. """ BUG_FIXING_DESCRIPTION = """ The **Issue Resolution** category evaluates how well agents can diagnose and fix bugs in real-world codebases. This tests their ability to understand GitHub issues, navigate repositories, identify root causes, and implement correct fixes.

The scores shown below reflect performance aggregated across two distinct benchmarks: SWE-bench (text-based bug reports) and SWE-bench-multimodal (issues with visual context like screenshots or diagrams).

For detailed results, use the links above to explore individual benchmarks.
""" APP_CREATION_DESCRIPTION = """ The **Greenfield** category in OpenHands Index evaluates an agent's ability to build complete applications from scratch based on natural language specifications. This tests whether agents can understand requirements, design architecture, write modular code, and create working applications.

This category currently includes Commit0, which challenges agents to implement complete features and applications by generating the initial commit for a project.

For detailed results, use the links above to explore individual benchmark pages.
""" FRONTEND_DEVELOPMENT_DESCRIPTION = """ The **Frontend** category evaluates agents on their ability to build user interfaces and web applications. This tests skills in HTML, CSS, JavaScript frameworks, responsive design, and creating interactive user experiences.

This category uses the dev set of SWE-bench Multimodal (Verified), a version of SWE-bench Multimodal that includes only problems verified as solveable by human review.
""" TEST_GENERATION_DESCRIPTION = """ The **Testing** category evaluates agents on their ability to create comprehensive test suites for existing code. This tests their understanding of code behavior, edge cases, and the ability to write effective unit tests, integration tests, and end-to-end tests.

This category includes SWT-bench (Software Testing Benchmark), which challenges agents to generate high-quality test cases that achieve good coverage and catch real bugs.
""" INFORMATION_GATHERING_DESCRIPTION = """ The **Information Gathering** category tests whether agents can effectively search for information, synthesize knowledge from multiple sources, and answer complex questions that require tool use and reasoning.

This category includes GAIA (General AI Assistant benchmark), which evaluates agents on real-world assistant tasks that require web search, file manipulation, and multi-step reasoning to gather and process information.
""" SUBMISSION_CONFIRMATION = """ **Your agent has been submitted to OpenHands Index for evaluation.**

🙏 Thanks for contributing!

You'll receive a confirmation email from our team within 2 business days with next steps. We will reach out to you directly if further information is needed.

We appreciate your support in advancing scientific AI. """ # External URLs for benchmark descriptions SCHOLAR_QA_CS_URL = "https://www.semanticscholar.org/paper/OpenScholar%3A-Synthesizing-Scientific-Literature-LMs-Asai-He/b40df4b273f255b3cb5639e220c8ab7b1bdb313e" LITQA2_URL = "https://www.semanticscholar.org/paper/Language-agents-achieve-superhuman-synthesis-of-Skarlinski-Cox/fa5f9aa1cb6f97654ca8e6d279ceee1427a87e68" ARXIV_DIGESTABLES_URL = "https://www.semanticscholar.org/paper/ArxivDIGESTables%3A-Synthesizing-Scientific-into-Newman-Lee/c7face35e84f2cb04fb1600d54298799aa0ed189" SUPER_URL = "https://www.semanticscholar.org/paper/SUPER%3A-Evaluating-Agents-on-Setting-Up-and-Tasks-Bogin-Yang/053ef8299988680d47df36224bfccffc817472f1" CORE_BENCH_URL = "https://www.semanticscholar.org/paper/CORE-Bench%3A-Fostering-the-Credibility-of-Published-Siegel-Kapoor/4c913d59d150fe7581386b87dfd9f90448a9adee" DS1000_URL = "https://arxiv.org/abs/2211.11501" DISCOVERY_BENCH_URL = "https://www.semanticscholar.org/paper/DiscoveryBench%3A-Towards-Data-Driven-Discovery-with-Majumder-Surana/48c83799530dc523ee01e6c1c40ad577d5c10a16" # Helper function to create external links def external_link(url, text, is_s2_url=False): url = f"{url}?utm_source=openhands_index" if is_s2_url else url return f"{text}" def internal_leaderboard_link(text, validation): anchor_id = create_gradio_anchor_id(text, validation) return f"{text}" # Function to get benchmark descriptions with validation flag def get_benchmark_description(benchmark_name, validation): descriptions = { 'PaperFindingBench': ( "PaperFindingBench assesses an agent's ability to locate sets of papers based on a natural language " "description that may involve both the papers' content and metadata, such as the author or publication year." ), 'LitQA2-FullText-Search': ( f"A version of {internal_leaderboard_link('LitQA2-FullText', validation)} that isolates the retrieval aspect of the task. " f"This benchmark features the same multi-choice questions as {internal_leaderboard_link('LitQA2-FullText', validation)}, but the agent is not evaluated on answering the actual question " "but rather on providing a ranked list of papers in which the answer is likely to be found." ), 'ScholarQA-CS2': ( "ScholarQA-CS2 assesses long-form model responses to literature review questions in the domain of computer science. " "Answers are expected to be comprehensive reports, such as those produced by deep research systems. " f"This benchmark advances on the previously released {external_link(SCHOLAR_QA_CS_URL, 'ScholarQA-CS', is_s2_url=True)} " "by using queries from real-world usage, and introducing new evaluation methods for coverage and precision " "of both the report text and its citations." ), 'LitQA2-FullText': ( f"{external_link(LITQA2_URL, 'LitQA2', is_s2_url=True)}, a benchmark introduced by FutureHouse, gauges a model's ability to answer questions that require document retrieval from the scientific literature. " "It consists of multiple-choice questions that necessitate finding a unique paper and analyzing its detailed full text to spot precise information; these questions cannot be answered from a paper’s abstract. " "While the original version of the benchmark provided for each question the title of the paper in which the answer can be found, it did not specify the overall collection to search over. In our version, " "we search over the index we provide as part of the standard toolset. The “-FullText” suffix indicates we consider only the subset of LitQA2 questions for which " "the full-text version of the answering paper is open source and available in our index." ), 'ArxivDIGESTables-Clean': ( f"{external_link(ARXIV_DIGESTABLES_URL, 'ArxivDIGESTables', is_s2_url=True)} assesses the ability of models to construct literature review tables, i.e., tables whose rows are papers and whose columns constitute a set of " "aspects used to compare and contrast the papers. The goal is to construct such tables given a set of related papers and a table caption describing the user's goal. Generated tables are evaluated by " "comparing them to actual tables published in ArXiv papers. The “-Clean” suffix indicates a curated subset of ArxivDIGESTables which drops tables that are either trivial or impossible to reconstruct from full-texts." ), 'SUPER-Expert': ( "SUPER-Expert evaluates the capability of models in setting up and executing tasks from low-resource " "research repositories—centralized databases containing research data and related materials. " f"The \"-Expert\" split indicates the name of the most challenging split in the {external_link(SUPER_URL, 'original SUPER benchmark', is_s2_url=True)} " "that involves solving reproduction tasks from scratch and without any intermediate hints or details " "about the important landmarks involved in each task." ), 'CORE-Bench-Hard': ( "Core-Bench-Hard tests computational reproducibility, a task involving reproducing the results of a study " "using provided code and data. It consists of both language-only and vision-language challenges across " "multiple difficulty levels. " f"The \"-Hard\" split refers to the name of the most challenging split in the original {external_link(CORE_BENCH_URL, 'Core-bench benchmark', is_s2_url=True)} " "where only a README file is provided with no instructions or an auxiliary Dockerfile." ), 'DS-1000': ( "DS-1000 is an established code generation benchmark containing Python data science coding questions " "originally sourced from StackOverflow. It's designed to reflect an array of diverse, realistic, and " "practical use cases and directly involves many of the Python libraries commonly used in data science " f"and machine learning research. We split the original {external_link(DS1000_URL, 'dataset')} " "into 100 validation and 900 test problems." ), 'DiscoveryBench': ( "DiscoveryBench is the first comprehensive benchmark to formalize the multi-step process of data-driven " "analysis and discovery (i.e., data loading, transformation, statistical analysis, and modeling). " f"Originally introduced {external_link(DISCOVERY_BENCH_URL, 'here', is_s2_url=True)}, it is designed to systematically " "evaluate how well current LLMs can replicate or reproduce published scientific findings across diverse " "domains, including social science, biology, history, and more." ), 'E2E-Bench': ( "E2E-Bench is the \"decathlon\" of AI-assisted research. It measures whether a system can run the entire " "research pipeline, starting with an initial task description, to designing and performing (software) " "experiments, to analyzing and writing up the results." ), 'E2E-Bench-Hard': ( f"E2E-Bench-Hard is a more challenging variant of {internal_leaderboard_link('E2E-Bench', validation)}. Tasks are generated using the HypER system, " "which identifies research trends and proposes new, underexplored problems. Unlike the regular version, " "these tasks are not simplified or curated for accessibility; they are reviewed only for feasibility. " "This version is intended to test whether systems can handle more complex and less-structured research " f"scenarios, following the same end-to-end process as {internal_leaderboard_link('E2E-Bench', validation)}." ) } return descriptions.get(benchmark_name, "") CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results" CITATION_BUTTON_TEXT = r"""@article{openhands-index, title={OpenHands Index}, author={OpenHands Team}, year={2025}, eprint={TBD.TBD}, archivePrefix={arXiv}, primaryClass={cs.AI}, secondaryClass={cs.CL} }""" LEGAL_DISCLAIMER_TEXT = """

Terms and Conditions

OpenHands maintains this repository for agent evaluation submissions to OpenHands Index. To keep OpenHands Index fair and auditable, all evaluation logs and associated submission files will be made publicly available. This includes your benchmark inputs, model output responses, and other data and information related to your submission as needed to verify the results.


Your submissions to OpenHands Index will be posted, scored, and ranked on the leaderboard at https://huggingface.co/spaces/OpenHands/openhands-index. You agree you have the rights to the materials you submit and that you will not share any personal, sensitive, proprietary, or confidential information.

""" def format_error(msg): return f"

{msg}

" def format_warning(msg): return f"

{msg}

" def format_log(msg): return f"

{msg}

" def hyperlink(link_url: str, text: str = "🔗") -> str: if not link_url or not isinstance(link_url, str): return str(text) # Or simply "" if link_url is bad return f'{text}' def hf_uri_to_web_url(uri: str) -> str: """ Convert a Hugging Face-style URI like: hf://datasets/{namespace}/{repo}/{path...} into a public web URL: https://huggingface.co/datasets/{namespace}/{repo}/tree/main/{path...} """ prefix = "hf://datasets/" if not uri.startswith(prefix): raise ValueError("URI must start with 'hf://datasets/'") parts = uri[len(prefix) :].split("/", 2) if len(parts) < 3: raise ValueError("Expected format: hf://datasets/{namespace}/{repo}/{path...}") namespace, repo, path = parts return f"https://huggingface.co/datasets/{namespace}/{repo}/tree/main/{path}" css = """ /* OpenHands-Design tokens (OpenHands-Design/index.html, DESIGN.md) */ :root { --oh-bg: hsl(0 0% 5%); --oh-card: hsl(0 0% 7%); --oh-secondary: hsl(0 0% 8%); --oh-muted: hsl(0 0% 12%); /* Light mode: 1px strokes / dividers — same grey as top nav bar (#e4e4e7 zinc-200) */ --oh-border: #e4e4e7; /* Slightly stronger on interactive hover (zinc-300) */ --oh-border-hover: #d4d4d8; --oh-muted-hover: hsl(0 0% 18%); --oh-fg: hsl(0 0% 98%); --oh-fg-muted: hsl(0 0% 55%); --oh-primary: hsl(0 0% 100%); --oh-primary-fg: hsl(0 0% 0%); --oh-success: #22c55e; --oh-success-fg: #86efac; --oh-warning: #f59e0b; --oh-info: #3b82f6; --oh-destructive: #dc2626; --oh-ring: #cccccc; --oh-shadow-card: 0 1px 2px 0 hsl(0 0% 0% / 0.3); --oh-font-sans: 'Inter', system-ui, sans-serif; --oh-font-mono: 'JetBrains Mono', ui-monospace, monospace; /* DESIGN.md §5: spacing (4px scale) — index.html / section rhythm */ --oh-pad-x-page: 24px; /* DESIGN.md: container max 1400px — page column + #page-content-wrapper */ --oh-content-max: 87.5rem; /* DESIGN.md §4: dropdown item hover (light / dark) */ --oh-form-hover-light: #f4f4f5; --oh-form-active-dark: hsl(0 0% 12% / 0.6); --oh-pad-y-section: 4rem; /* 64px — .section in index.html */ --oh-gap-prose-paragraph: 1rem; /* 16px — gap-4 */ --oh-gap-prose-tight: 0.5rem; /* 8px — gap-2 */ --oh-prose-size: 0.875rem; /* 14px — text-sm, primary body */ --oh-prose-leading: 1.5rem; /* 24px — leading-6 w/ text-sm */ /* DESIGN.md: inline links use --info; focus ring = --oh-ring */ --oh-link-visited: hsl(217 60% 48%); --oh-link-hover: hsl(217 85% 62%); /* Legacy var names (charts, tables) — mapped to design surfaces */ --color-primary-accent: #e8e8e5; --color-primary-light: #f5f5f4; --color-primary-dark: #a1a1aa; --color-secondary-accent: #22c55e; --color-secondary-dark: #16a34a; --color-neutral-50: #fafafa; --color-neutral-100: #f4f4f4; --color-neutral-200: #e5e5e5; --color-neutral-300: #d4d4d4; --color-neutral-700: #404040; --color-neutral-800: #262626; --color-neutral-900: #171717; --color-neutral-950: #0d0d0d; --color-primary-link: #404040; --color-primary-link-dark: #a3a3a3; --color-background-light: #fafafa; --color-background-dark: #0d0d0d; --color-text-dark: #0d0d0d; --color-text-light: #fafafa; --color-button-hover: #404040; --color-danger: #dc2626; } /* Dark theme: near-black strokes (DESIGN.md --border / #242424) */ html.dark, body.dark, html:has([class*="gradio-container-"].dark), .gradio-container.dark, [class*="gradio-container-"].dark { --oh-border: hsl(0 0% 14%); --oh-border-hover: hsl(0 0% 24%); } body, .gradio-container { font-family: var(--oh-font-sans) !important; -webkit-font-smoothing: antialiased; } code, kbd, pre, .cell-wrap.svelte-v1pjjd { font-family: var(--oh-font-mono) !important; } /* Markdown `---` →
. Gradio preflight uses color:inherit on hr, which tracks body text, not the border line. */ /* Section divider: 1px solid var(--oh-border) — light #e4e4e7 (top nav), dark #242424 */ gradio-app hr, .gradio-container hr, #about-page-content-wrapper hr, #page-content-wrapper hr, .prose hr, div[class*="markdown"] hr, .divider-line hr, [class~="divider-line"] hr { box-sizing: border-box; display: block; height: 0 !important; margin: 0.75rem 0 1.5rem 0; padding: 0 !important; border: 0 !important; border-top: 1px solid var(--oh-border) !important; background: transparent !important; background-color: transparent !important; /* Some UAs use `color` for the default
border; lock to the border token (not --body-text-color) */ color: var(--oh-border) !important; opacity: 1 !important; } /* No top padding on gradio-app (control_page_title is a prop on this element) */ gradio-app { padding-top: 0; overflow: visible !important; display: block; } /* In-flow strip so the fixed