Registry generators crash on a whitespace-only voice_style

Open Beginner friendly
#538 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
tooling

Research direction

The crash is in the voice_style_excerpt line of each systems/superintelligence/*/scripts/build_registry.py generator; search those scripts for voice_style to find every copy. Reproduce by building the registry with a temporary persona whose voice_style is only whitespace, and see the IndexError from splitlines()[0]. Done when every generator guards on the stripped text, the build succeeds, and that persona's excerpt is an empty string.

Written by the indexing model from the issue text.

Description

bug P2

Several systems/superintelligence/*/scripts/build_registry.py generators build voice_style_excerpt like this:

(fm.get("voice_style", "") or "").strip().splitlines()[0][:160] if fm.get("voice_style") else ""

A voice_style that is only whitespace passes the guard and strips to "". Then splitlines() returns [], [0] raises IndexError, and the whole registry build stops.

Fix: guard on the stripped text, for example (lines := (fm.get("voice_style") or "").strip().splitlines()) and lines[0][:160] or "", in every generator that has this line.

Check: a temp persona with voice_style: " " builds, and its excerpt is "".

Dominant language
HTML
Stars
347
Forks
12
Avg merge
2d 16h
Merged PRs (30d)
95

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coco-research/coco

All issues in coco-research/coco

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.