schema_dsl() raises IndexError when a field has no name before the colon
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
Research direction
Start at schema_dsl() in llm/utils.py around lines 394-395 and reproduce the two examples from the issue. Verify that nameless fields are skipped without raising IndexError, while the existing handling of blank field strings remains unchanged.
Written by the indexing model from the issue text.
Description
Calling schema_dsl() with a field that has no name before the colon crashes with IndexError: list index out of range.
Repro:
from llm.utils import schema_dsl
schema_dsl(':just a description') # IndexError
schema_dsl('name, :description') # IndexError
Root cause (llm/utils.py line 394-395): after field.split(":", 1), field_info can be an empty string. field_info.strip().split() then returns [], so field_parts[0] raises IndexError.
The fix is to continue when field_parts is empty, silently skipping the nameless field — consistent with how blank field strings are already filtered out during field splitting.
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 998
- Avg merge
- 8d 1h
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simonw/llm
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100