Title: fix(tools): harden UpdateTodoList for local LLM task JSON quirks by JessicaMulein · Pull Request #548 · cecli-dev/cecli · GitHub
Open Graph Title: fix(tools): harden UpdateTodoList for local LLM task JSON quirks by JessicaMulein · Pull Request #548 · cecli-dev/cecli
X Title: fix(tools): harden UpdateTodoList for local LLM task JSON quirks by JessicaMulein · Pull Request #548 · cecli-dev/cecli
Description: Summary Hardens UpdateTodoList so local models can pass tasks as a JSON string, char-split arrays, or brace-prefixed strings without breaking format_output or writing garbage one-character “tasks” to todo.txt. Problem On Ollama and similar local models we routinely see: tasks passed as a JSON string instead of a parsed array Character-split “arrays” from the model Strings that start with { but are not valid JSON main already has normalize_json_array() in cecli.tools.utils.helpers (used by Grep and others), but UpdateTodoList still used naive json.loads + a loop that treated each character as a task in format_output. Solution normalize_task_items() / format_task_lines() — shared coercion for execute and format_output coerce_task_item() — dict passthrough; invalid {…} strings fall back to plain task text format_output — json.loads guard; surface ToolError from normalization instead of silent corruption LIST_PARAMS = ["tasks"] preserved for base tool list handling Tests New file: tests/tools/test_update_todo_list.py (7 cases) Test Covers test_normalize_task_items_does_not_split_characters Char-split regression test_format_task_lines_accepts_json_string Tasks as embedded JSON string test_format_output_accepts_tasks_as_json_string End-to-end format_output test_format_output_reports_invalid_tasks_json Clear error on bad tasks test_coerce_task_item_plain_string_starting_with_brace Invalid { prefix fallback pytest tests/tools/test_update_todo_list.py -v # 7 passed (local run) pytest tests/helpers/monorepo -q # 24 passed — no monorepo regression on this branch Scope In scope: cecli/tools/update_todo_list.py, tests/tools/test_update_todo_list.py, minor import-order touch in tests/tools/test_get_lines.py. Out of scope: General glued-tool JSON (parse_tool_arguments), Grep, session encryption — separate PRs if still needed on main. Checklist Uses existing normalize_json_array (no duplicate helper stack) execute and format_output share the same normalization path Tests added and passing locally No change to clone/multi-repo workspace behavior
Open Graph Description: Summary Hardens UpdateTodoList so local models can pass tasks as a JSON string, char-split arrays, or brace-prefixed strings without breaking format_output or writing garbage one-character “tasks” ...
X Description: Summary Hardens UpdateTodoList so local models can pass tasks as a JSON string, char-split arrays, or brace-prefixed strings without breaking format_output or writing garbage one-character “tasks” ...
Opengraph URL: https://github.com/cecli-dev/cecli/pull/548
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1a5a023a-22f1-5811-2fd7-2f1df1fec559 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A51C:1B5FB5:939B37:D4BE37:6A6215D7 |
| html-safe-nonce | e6b184bac48722d9a5fc6e8cefc5dd19b6084a556208954d47fd6f0b38ec2f89 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTFDOjFCNUZCNTo5MzlCMzc6RDRCRTM3OjZBNjIxNUQ3IiwidmlzaXRvcl9pZCI6IjI0MzQxMjQ2NTYxMDg3NzA3NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d4589cf9d9e46b97b0e4cc0f00c16a134f59fd6ed8815e9c1ffe6a725097054f |
| hovercard-subject-tag | pull_request:3789927132 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/cecli-dev/cecli/pull/548/files |
| twitter:image | https://avatars.githubusercontent.com/u/3766240?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3766240?s=400&v=4 |
| og:image:alt | Summary Hardens UpdateTodoList so local models can pass tasks as a JSON string, char-split arrays, or brace-prefixed strings without breaking format_output or writing garbage one-character “tasks” ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ccf61cb7ab435725b916ed640f57c45b2c4721db9469bc32656080efc5214b3e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/cecli-dev/cecli git https://github.com/cecli-dev/cecli.git |
| octolytics-dimension-user_id | 250452847 |
| octolytics-dimension-user_login | cecli-dev |
| octolytics-dimension-repository_id | 1030985330 |
| octolytics-dimension-repository_nwo | cecli-dev/cecli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 638629097 |
| octolytics-dimension-repository_parent_nwo | Aider-AI/aider |
| octolytics-dimension-repository_network_root_id | 638629097 |
| octolytics-dimension-repository_network_root_nwo | Aider-AI/aider |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a7585b3d2ee639495a70ce464d0a18bad88ea12c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width