Skip to content

fix(form-filler): treat a null table in the LLM answer as empty - #764

Closed
vikash7485 wants to merge 1 commit into
fireform-core:developmentfrom
vikash7485:fix/expand-output-null-table
Closed

vikash7485 wants to merge 1 commit into
fireform-core:developmentfrom
vikash7485:fix/expand-output-null-table

Conversation

@vikash7485

Copy link
Copy Markdown
Contributor

Description

expand_output() used llm_output.get(name, []). The default only applies when the key is missing, so a table returned as null crashed the fill with TypeError: 'NoneType' object is not iterable. Providers without structured output (e.g. Anthropic) can return null this way. The fix uses llm_output.get(name) or [].

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added test_expand_output_treats_null_table_as_empty (fails before the fix, passes after)
  • pytest tests/ → 458 passed, ruff check app/ → clean

Test Configuration:

  • Python version: 3.13.7
  • Docker/Compose version: N/A
  • OS: Windows 11

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes

Providers without structured output (e.g. Anthropic) can return null for
a table array. expand_output used dict.get with a [] default, which only
applies when the key is missing, so enumerate(None) raised TypeError and
the whole fill failed. Fall back to an empty list for null as well.
@marcvergees

Copy link
Copy Markdown
Member

Hi @vikash7485,

Nice to have new people here. Maybe it'd be interesting to you to hop in our Discord channel to could update of what's going on in the project and hop on weekly meetings.

This PR description reads as AI-generated and includes inaccurate claims. Notably, the statement that "Providers without structured output (e.g. Anthropic) can return null this way" is completely false—Anthropic supports structured outputs, and that isn't why null would be returned here.

M

@vikash7485

vikash7485 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @marcvergees , you're right. Anthropic does support structured outputs. I misread FireForm's own config (structured_output=False in specs.py) as a limitation of the provider, and I hadn't actually seen a model return null for a table. Sorry about that.

Thanks for the invite too. I'll join the Discord and the weekly meeting, and I'll check there before opening any more PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants