Skip to content

fix: resilience fixes for local LLM structured output - #152

Closed
82deutschmark wants to merge 5 commits into
PlanExeOrg:mainfrom
VoynichLabs:fix/local-model-structured-output
Closed

fix: resilience fixes for local LLM structured output#152
82deutschmark wants to merge 5 commits into
PlanExeOrg:mainfrom
VoynichLabs:fix/local-model-structured-output

Conversation

@82deutschmark

Copy link
Copy Markdown
Collaborator

Summary

Two bug fixes discovered during local model QA testing on Mac Mini M4 Pro 64GB with Qwen 3.5-35B-A3B via LM Studio.

Fix 1: SelectScenarioTask — holistic_profile_of_the_plan field

Problem:SelectScenarioTask fails with Pydantic validation error on holistic_profile_of_the_plan field in PlanCharacteristics. Field is defined last in the schema; local LLMs with constrained output budgets close the JSON object before generating it.

Confirmed root cause: LMStudio default num_output=4096 causes silent truncation. Reproduced deterministically with Qwen 3.5-35B-A3B (2 consecutive failures, 0 retries succeed).

Fix:default='' makes the field resilient — pipeline continues with an empty holistic profile rather than failing entirely. Downstream scenarios_markdown.py (line 71) uses f-string interpolation so empty string renders cleanly.

Verified fix: With num_output=8192, SelectScenarioTask passes. default='' adds a second layer of resilience for other local models.

Fix 2: CreateScheduleTask — KeyError on server_iso_utc

Problem:CreateScheduleTask raises KeyError: 'server_iso_utc' during CLI runs.

Fix: Safe dict access with .get().

Test environment

  • Mac Mini M4 Pro, 64GB unified memory
  • LM Studio + Qwen 3.5-35B-A3B (MoE, 35B active params)
  • PlanExe pipeline: ALL_DETAILS_BUT_SLOW

82deutschmarkand others added 5 commits March 3, 2026 14:24
- select_scenario.py: make holistic_profile_of_the_plan optional with
default='' to handle LLMs that truncate output before last field in
nested JSON objects (confirmed fix: SelectScenarioTask now passes with
Qwen 3.5-35B-A3B at num_output=8192)
- CreateScheduleTask: fix KeyError on server_iso_utc for CLI runs
Tested on Mac Mini M4 Pro 64GB with LM Studio + Qwen 3.5-35B-A3B.
Root cause: LMStudio default num_output=4096 causes silent truncation
of last fields in structured JSON output.
@82deutschmark

Copy link
Copy Markdown
CollaboratorAuthor

Closing — PR contains local config files and run outputs that should not be in upstream. Reopening with only the relevant code fixes.

huangyingting pushed a commit to repomesh/PlanExe that referenced this pull request Jun 26, 2026
Resolves Dependabot security alerts in worker_plan/pyproject.toml by bumping to the first stable patched release of each package:
- aiohttp 3.13.5 -> 3.14.1 (alerts PlanExeOrg#152,PlanExeOrg#153,PlanExeOrg#156-PlanExeOrg#164)
- tornado 6.5.4 -> 6.5.7 (alerts PlanExeOrg#113,PlanExeOrg#114,PlanExeOrg#136,PlanExeOrg#155,PlanExeOrg#165,PlanExeOrg#166,PlanExeOrg#171)
- python-multipart 0.0.22 -> 0.0.32 (alerts PlanExeOrg#142,PlanExeOrg#149,PlanExeOrg#167-PlanExeOrg#170)
- urllib3 2.6.3 -> 2.7.0 (alerts PlanExeOrg#150,PlanExeOrg#151)
- marshmallow 3.24.2 -> 3.26.2 (alert PlanExeOrg#81), staying on 3.x to avoid the breaking 4.x major
transformers alert PlanExeOrg#137 is excluded: its only fix is the 5.x major line and the vulnerable Trainer class is never imported by PlanExe (handled separately).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for freeto 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.

1 participant

@82deutschmark