Skip to content

feat(ensemble): add pyodide_safe_mode + async-DI to synthesize_panel (sy-huo)#454

Merged
openclaw-dv merged 1 commit into
mainfrom
polecat/garnet-mp30rglf
May 12, 2026
Merged

feat(ensemble): add pyodide_safe_mode + async-DI to synthesize_panel (sy-huo)#454
openclaw-dv merged 1 commit into
mainfrom
polecat/garnet-mp30rglf

Conversation

@openclaw-dv

Copy link
Copy Markdown
Collaborator

Summary

v1.2.0 lets Cloudflare Python Worker (pyodide) consumers — boardroom is the
first — drive the judge call through their own async LLM stack end-to-end
instead of crashing on synth_panel's threading-based client. Three additive
kwargs on synthesize_panel, all default-off; every v1.1.0 call site keeps
working.

New kwargs on synthesize_panel

  • judge_enabled=False — skip the judge LLM call entirely; returns a degenerate SynthesisResult synchronously. No thread spawn, no fetch deps, no LLM cost.
  • llm_client=<AsyncLLMClient> — inject a consumer-owned async client. Function returns a coroutine the consumer's event loop drives.
  • pyodide_safe_mode=True — hard guard; raises ValueError unless one of the safe paths is selected, instead of silently spawning a thread the runtime can't actually run.

AsyncLLMClient is a runtime_checkable Protocol — one method, returning
AsyncCompletion (text + optional usage). Any consumer's async LLM stack
satisfies it with a ~10-line adapter. Both AsyncLLMClient and
AsyncCompletion are exposed via synth_panel.ensemble.__all__.

Compatibility

Default behavior unchanged — every v1.1.0 call site keeps working. New
kwargs are opt-in.

Test plan

  • Tests pin the async-DI and pyodide_safe_mode contracts; synth_panel.ensemble public-API tests continue to enforce the surface.
  • GitHub CI runs the full suite on this PR.

References

…(sy-huo)

v1.2.0 lets Cloudflare Python Worker (pyodide) consumers — boardroom is
the first — drive the judge call through their own async LLM stack
end-to-end instead of crashing on synth_panel's threading-based client.

Three additive kwargs on synthesize_panel:

* judge_enabled=False — skip the judge LLM call entirely; returns a
  degenerate SynthesisResult synchronously. No thread spawn, no fetch
  deps, no LLM cost.
* llm_client=<AsyncLLMClient> — inject a consumer-owned async client.
  Function returns a coroutine the consumer's event loop drives.
* pyodide_safe_mode=True — hard guard; raises ValueError unless one of
  the safe paths is selected, instead of silently spawning a thread the
  runtime can't actually run.

AsyncLLMClient is a runtime-checkable Protocol — one method, returning
AsyncCompletion (text + optional usage). Any consumer's async LLM stack
satisfies it with a 10-line adapter. Both exposed via
synth_panel.ensemble.__all__.

Default behavior unchanged — every v1.1.0 call site keeps working.
@openclaw-dv
openclaw-dv merged commit c44cc43 into main May 12, 2026
15 checks passed
@openclaw-dv
openclaw-dv deleted the polecat/garnet-mp30rglf branch May 12, 2026 19:39
@openclaw-dv openclaw-dv added the semver:minor Bump minor version on merge label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:minor Bump minor version on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant