Skip to content

fix: guard model registry lookup and prevent silent json serialization failure#458

Open
ELC1657 wants to merge 1 commit into
aliasrobotics:mainfrom
ELC1657:fix/parallel-worker-safety
Open

fix: guard model registry lookup and prevent silent json serialization failure#458
ELC1657 wants to merge 1 commit into
aliasrobotics:mainfrom
ELC1657:fix/parallel-worker-safety

Conversation

@ELC1657

@ELC1657 ELC1657 commented Jun 9, 2026

Copy link
Copy Markdown

Two defensive fixes in the parallel execution path:

tools/streaming.py: _get_agent_token_info() used direct dict
access (ACTIVE_MODEL_INSTANCES[key]) which raises KeyError if a
weakref entry is garbage-collected between the emptiness check and the
lookup. The identical logic in plan.py already uses .get() wrapped
in try/except — this makes streaming.py consistent with that safe
pattern.

parallel_worker.py: json.dump was called without a default
fallback. If any object in message_history is not JSON-serializable,
the TypeError is caught by the file-write error handler and the entire
worker result is silently lost. Added default=str to match the pattern
used in output.py.

Sign up for free to 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