[UI] Empty Path Reference in Link Generation

← All Specs

Goal

Eliminate empty-path links emitted by the application so pages do not render anchor tags with blank href attributes. The fix should target the current live failure mode rather than broadly rewriting link generation. It should preserve valid external links while suppressing UI affordances when the backing URL is missing.

Acceptance Criteria

☑ The affected route no longer renders <a href=""> for missing external links.
☑ Link generation still renders valid external anchors when a non-empty URL is present.
☑ The root cause and verification steps are recorded in the work log.

Approach

  • Reproduce the empty-link output on the current app to confirm the task is still relevant.
  • Patch the affected HTML generation path in api.py to guard against blank external URLs.
  • Re-run the route-level verification and confirm the empty href is gone.
  • Dependencies

    • None.

    Dependents

    • None known.

    Work Log

    2026-04-26 04:52:43Z — Codex

    • Performed staleness review against the current worktree at ca6f2bb77.
    • Confirmed the task is still relevant by requesting GET /forge/tool/paper_corpus_search and observing <a href="">External site →</a> in the rendered HTML.
    • Traced the current root cause to forge_tool_page() in api.py, which always rendered the external-site anchor even when external_url was an empty string for tools like paper_corpus_search.

    2026-04-26 04:56:00Z — Codex

    • Verified python3 -m py_compile api.py succeeds after the change.
    • Verified api.forge_tool_page("paper_corpus_search") renders with href="" absent and no External site button when external_url is blank.
    • Verified api.forge_tool_page("gene_info") still renders the External site anchor and does not contain href="".

    2026-04-26 — SciDEX Agent

    • Rebased branch onto current origin/main (47 commits ahead).
    • Confirmed staged fix is correct: forge_tool_page() now builds ext_link_html conditionally — only renders the anchor when external_url is non-empty.
    • Verified python3 -m py_compile api.py passes.
    • Committed and pushed for deploy.

    File: ec53d7d8_empty_path_reference_in_link_generation_spec.md
    Modified: 2026-04-25 23:09
    Size: 2.2 KB