Don't crash planning when the LLM returns a non-object palette
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start with easyedit/plan.py:50-53 and inspect how make_plan() merges the palette and handles montage_queries. Add or run the unit test described in the issue, stubbing ask_json with string and list palettes and invalid hex values; done means invalid palette parts use defaults and non-string montage query items are handled safely. An open linked pull request (#41) is already addressing this issue.
Written by the indexing model from the issue text.
Description
llm.py promises that a bad reply "degrades quality instead of breaking the pipeline", but make_plan() trusts the shape of palette. If the model answers "palette": "gold and black" (or a list), {**DEFAULT_PALETTE, **(reply.get("palette") or {})} raises TypeError: 'str' object is not a mapping, and the whole run dies before any download. Checked with ask_json stubbed to return {"speech_query": "x", "palette": "gold and black"}.
The individual colours aren't checked either. They go into edit.js, and template/film.js:11 uses them as CSS colours, so a value like "red-ish" renders as no colour.
Task: merge palette only if it is a dict, and keep only the four known keys whose values match ^#[0-9a-fA-F]{6}$. Fall back to DEFAULT_PALETTE for everything else. Do the same type check for montage_queries items (strings only).
Where: easyedit/plan.py:50-53.
Done when: a unit test that stubs ask_json shows that a string palette, a list palette, and a palette with a bad hex all produce a plan whose palette uses the defaults for the bad parts.
Getting started: Python 3.10+, Node 22+, FFmpeg on PATH. npm install, pip install -r requirements.txt, then python -m easyedit.doctor. Run python -m unittest discover before opening a PR. Passing --llm none skips the model entirely, which is the fastest way to test. Comment here to claim it. Questions → Discord.
- Dominant language
- Python
- Stars
- 168
- Forks
- 24
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 14
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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 blixvip/easyedit
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
All issues in blixvip/easyedit
Similar issues
-
area: web priority: P1 story
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nfiasco/Quant-Time-Machine#151 ·
Maintainers usually reply within 1 day
-
docs pydanty:is-working
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
pydantic/pydantic-ai#12892 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
Azure/azure-sdk-for-python#49886 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Core] Deprecated(error=True) raises only on the first call; later calls run the removed APIPossibly taken @wguo7 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ray-project/ray#67965 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
btclib-org/btclib#3006 ·
Maintainers usually reply within 1 day