Skip to content

Action server fails to start under sema4ai-actions 1.4.2 due to docstring_parser import error (DocstringYields) #270

@joshyorko

Description

@joshyorko

Summary

Upgrading sema4ai-actions from 1.4.1 to 1.4.2 in package.yaml causes the action server to fail to start during action collection. The failure originates in docstring parsing/linting: the environment raises an ImportError when docstring_parser.common is expected to expose DocstringYields but does not.

This does not occur with sema4ai-actions=1.4.1 (downgrading to 1.4.1 is an immediate workaround).

Reproduction (minimal)

  1. In package.yaml set:
pypi:
  - sema4ai-actions=1.4.2
  # ... other deps
  1. Run the action server from the repo root:
action-server start

Observed behavior / error

The server fails during action import/collection with a traceback similar to:

ImportError: cannot import name 'DocstringYields' from 'docstring_parser.common' (/opt/.../site-packages/docstring_parser/common.py)
...
RuntimeError: It was not possible to list the actions.
...
Error when importing module 'src.linkedin.linkedin-actions' at location '.../src/linkedin/linkedin-actions.py'

Key excerpt from the log we observed inside our environment:

Error calling: <function _ActionsArgDispatcher._register_lint.<locals>.on_func_found at 0x...>.
Traceback (most recent call last):
  File "/opt/.../site-packages/sema4ai/actions/_callback.py", line 48, in __call__
    c(*args, **kwargs)
  File "/opt/.../site-packages/sema4ai/actions/_args_dispatcher.py", line 281, in on_func_found
    errors = list(
             ^^^^^
  File "/opt/.../site-packages/sema4ai/actions/_args_dispatcher.py", line 283, in <genexpr>
    for x in _lint_action.iter_lint_errors(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/.../site-packages/sema4ai/actions/_lint_action.py", line 435, in iter_lint_errors
    yield from _check_docstring_contents(pm, node, docstring, kind)
  File "/opt/.../site-packages/sema4ai/actions/_lint_action.py", line 274, in _check_docstring_contents
    import docstring_parser
  File "/opt/.../site-packages/docstring_parser/__init__.py", line 14, in <module>
    from .parser import compose, parse, parse_from_object
  File "/opt/.../site-packages/docstring_parser/parser.py", line 6, in <module>
    from docstring_parser import epydoc, google, numpydoc, rest
  File "/opt/.../site-packages/docstring_parser/numpydoc.py", line 12, in <module>
    from .common import (
ImportError: cannot import name 'DocstringYields' from 'docstring_parser.common' (/opt/.../site-packages/docstring_parser/common.py)

Why we think this is a problem with the release

  • The issue only appears when using sema4ai-actions=1.4.2 and not with 1.4.1.
  • The error points to docstring_parser internals; likely either a transitive dependency version change, or a change in sema4ai-actions that expects a newer docstring_parser API than what is present in the environment.
  • The action package import path fails while running the docstring lint step inside your action-collection flow, indicating a docstring parsing incompatibility.

Immediate workaround

  • Pin sema4ai-actions=1.4.1 in package.yaml. That restores action-server startup in our environment.

Suggested fixes for maintainers

  1. Audit the sema4ai-actions 1.4.2 dependency pins (direct or transitive) for docstring_parser and ensure it pins a version that exposes DocstringYields or adapt the docstring lint code to work with the currently installed docstring_parser versions.

  2. Consider adding a try/except fallback in the docstring linting code to gracefully skip/ignore the yields-related checks when DocstringYields is unavailable (and log a clear message), rather than raising ImportError and preventing action loading.

  3. Add a minimal reproducible test or CI job that runs action collection against a repo with several typical action docstrings; this would detect breakages caused by docstring_parser API changes earlier.

Information from our environment (for context)

  • Repo: linkedin-easy-apply
  • package.yaml (relevant lines):
pypi:
  - sema4ai-actions=1.4.2  # triggers the error
  - robocorp-browser=2.3.5
  - python-dotenv=1.1.1
  - beautifulsoup4=4.13.5
  - pandas=2.3.2
  - mindsdb_sdk=3.4.6
  - SQLAlchemy=2.0.43
  - psycopg2-binary=2.9.10
  • Python: 3.12.x (the action-server runtime used python3.12 in our setup)
  • Observed behavior on action-server start (command prints earlier stacktrace and aborts)

Request

Could you please:

  • Investigate if sema4ai-actions 1.4.2 introduced a changed dependency or internal usage of docstring_parser that requires DocstringYields? If so, pin a compatible docstring_parser version or add a fallback.
  • If you prefer, I can open a PR that clamps the docstring_parser version or makes the lint code resilient — tell me which approach you'd prefer.

Thanks — this is blocking action server startup for users who build with sema4ai-actions 1.4.2; downgrading to 1.4.1 is an immediate workaround.

FWIW not sure if this due to me being on action-server v2.14.1binary.

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