Skip to content

fix: parse Google docstrings whose Args: follows a section body#3862

Merged
seratch merged 1 commit into
openai:mainfrom
oldrobotdev:fix/google-docstring-args-after-section
Jul 17, 2026
Merged

fix: parse Google docstrings whose Args: follows a section body#3862
seratch merged 1 commit into
openai:mainfrom
oldrobotdev:fix/google-docstring-args-after-section

Conversation

@oldrobotdev

Copy link
Copy Markdown
Contributor

Summary

griffe's Google parser skips a section header when there is no blank line above it and the next line is indented, which silently drops every parameter description. #3832 normalized that for a header sitting directly below the summary, but the helper only inserts the blank line when the preceding line is non-indented. An Args: that follows another section's indented body still loses everything, and the tool reaches the model with no parameter descriptions:

def weather(city: str, units: str):
    """Get the weather for a city.

    Note:
        Results are cached.
    Args:
        city: The city to get weather for.
        units: Temperature units to use.
    """

griffe applies that gate no matter how the preceding line is indented, so this drops the non-indented restriction and both cases normalize the same way. The header regex stays anchored at column 0, so an Args: nested inside an example block still cannot match, and well-formed docstrings are still returned byte-identical.

Test plan

Two tests: parameter descriptions survive when Args: follows an indented Note: body, and that variant produces the same schema as the well-formed version with the blank line. Both fail on main and pass with the change.

.agents/skills/code-change-verification/scripts/run.sh passes (format, lint, typecheck, tests).

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass
  • If using Codex, I've run /review before submitting this PR

@seratch seratch added this to the 0.19.x milestone Jul 17, 2026
@seratch
seratch merged commit b2e9246 into openai:main Jul 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants