Skip to content

WRITING stage fails with ImportError: cannot import name 'get_style_files' from nanoresearch.templates #3

@cqyzc99

Description

@cqyzc99

Summary

The WRITING stage fails during PDF compilation because latex_bib_figures.py imports get_style_files from nanoresearch.templates, but nanoresearch/templates/__init__.py does not define or export that symbol.

Error

ImportError: cannot import name 'get_style_files' from 'nanoresearch.templates' (D:\NanoResearch\nanoresearch\templates\__init__.py)

Stack trace

Traceback (most recent call last):
  File "D:\NanoResearch\nanoresearch\pipeline\base_orchestrator.py", line 289, in _run_stage_with_retry
    result = await agent.run(**inputs)
  File "D:\NanoResearch\nanoresearch\agents\writing\writing_agent.py", line 373, in run
    pdf_result = await self._compile_pdf(tex_path, template_format=template_format)
  File "D:\NanoResearch\nanoresearch\agents\writing\latex_assembler.py", line 129, in _compile_pdf
    self._copy_style_files(template_format)
  File "D:\NanoResearch\nanoresearch\agents\writing\latex_bib_figures.py", line 467, in _copy_style_files
    from nanoresearch.templates import get_style_files
ImportError: cannot import name 'get_style_files' from 'nanoresearch.templates' (D:\NanoResearch\nanoresearch\templates\__init__.py)

Root cause

nanoresearch/agents/writing/latex_bib_figures.py calls:

from nanoresearch.templates import get_style_files

but nanoresearch/templates/__init__.py currently only exposes get_available_formats() and get_template_path().

In the current checkout, there are also no bundled .sty, .cls, or .bst files under nanoresearch/templates/, so the helper may have been removed or never implemented while the writing pipeline still expects it.

Steps to reproduce

  1. Run a research job that reaches the WRITING stage.
  2. Let the pipeline attempt PDF compilation.
  3. The run fails when _copy_style_files() executes.

Expected behavior

The WRITING stage should either:

  • provide a get_style_files() helper in nanoresearch.templates, or
  • skip style-file copying when the selected template has no extra style resources.

Environment

  • Repo: OpenRaiser/NanoResearch
  • Local checkout commit: b7bdd0afb6d1cfb2fd460a561a8aefcba148d2cb
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions