Skip to content

Fix WMQ examples (78-84) - #494

Merged
mp-orkes merged 9 commits into
mainfrom
fix/wmq-examples-2
Aug 14, 2026
Merged

Fix WMQ examples (78-84)#494
mp-orkes merged 9 commits into
mainfrom
fix/wmq-examples-2

Conversation

@mp-orkes

@mp-orkes mp-orkes commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Continuing the WMQ example pass from #492. Tested each against a local OSS server with WMQ enabled.

Bugs

  • 78 — crashed on worker spawn (no if __name__ == "__main__" guard), and tempfile.mkdtemp() at module level gave every worker its own IPC dir, so approval requests never reached the main process. Dir now crosses via APPROVAL_WORKFLOW_IPC_DIR.
  • 79 — dropped the last paragraph: the barrier waited on the Researcher forwarding, then stopped both agents while the Writer was still mid-turn. Now waits on publish sentinels.
  • 80, 81, 82 — docstrings named anthropic/claude-sonnet-4-20250514, which 404s. On that model 82 never replies; it works on claude-sonnet-5.

Docstrings — corrected claims that no longer match the code: the wrong tool named as 78's approval gate, a closure in 79 that #477 removed, a "no time.sleep()" claim in 82_fan_out_fan_in contradicted by the code, updateVariables named as 84's stop mechanism (it's POST /agent/{id}/stop), undocumented /disconnect and /tools in 81, and a missing WMQ requirement throughout.

Testing

78: 5 tasks through 3 approval gates, COMPLETED. 79: 3/3 paragraphs across 4 runs (was consistently 2/3). 82_fan_out_fan_in: 9/9 answers, all 5 workflows COMPLETED. 83: same domain across runtime restart, both tasks ran. 84: _stop_requested: true, COMPLETED. 82: replies correctly on claude-sonnet-5.

79 and 82_fan_out_fan_in still fail roughly 1 run in 3 on #493 (handle.stop() leaving _stop_requested false) — unrelated to these fixes.

🤖 Generated with Claude Code

mp-orkes and others added 9 commits August 14, 2026 12:58
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mp-orkes
mp-orkes requested review from kowser-orkes and v1r3n and removed request for kowser-orkes August 14, 2026 19:46
@mp-orkes mp-orkes self-assigned this Aug 14, 2026
@mp-orkes mp-orkes changed the title Fix WMQ examples (78-79) Fix WMQ examples (78-84) Aug 14, 2026
@mp-orkes
mp-orkes marked this pull request as ready for review August 14, 2026 19:53
@mp-orkes

Copy link
Copy Markdown
Contributor Author

Reviewed and manually tested all the examples with Claude’s assistance. The coding agent examples are interactive and were validated manually.

Screenshot 2026-08-14 at 16 12 44 Screenshot 2026-08-14 at 13 59 16

@mp-orkes
mp-orkes merged commit 46bffcc into main Aug 14, 2026
6 checks passed
@mp-orkes
mp-orkes deleted the fix/wmq-examples-2 branch August 14, 2026 21:58
ambiorix2099 added a commit that referenced this pull request Aug 14, 2026
- settings.py docstring claimed the default model was
  anthropic/claude-sonnet-4-6; the code defaults to openai/gpt-4o (#485).
- Add langchain-anthropic to the langchain and agents extras, so
  langgraph/43_react_agent_multi_model.py runs after the documented
  install. It requires anthropic >=0.120 and langchain-core >=1.5.4, which
  the lock file now reflects (#486).
- Wrap the body of langgraph/46_crash_and_resume.py in a __main__ guard.
  Without it, spawned workers re-imported the module and re-ran the whole
  demo. The tools and graph stay at module level so workers can still
  rebuild them (#489).
- Replace anthropic/claude-sonnet-4-20250514, which the API answers with
  404 not_found_error, with anthropic/claude-sonnet-5, the replacement
  #494 verified against a live server (#480).
- 74_cli_error_output.py asserted against result.output, which is a dict,
  so the substring check tested keys and the example could never pass. Use
  str(result.output), as the other examples that need a string do (#481).
- Point run_examples.sh at examples/agents. It globbed examples/, where no
  numbered examples live, so it collected nothing and always passed (#484).

Because that glob matched nothing, the script's skip list had never been
exercised. Add the examples that must not run unattended: seven that act on
real third-party accounts, and eight that block on stdin with no canned
response. --all still runs them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ambiorix2099 added a commit that referenced this pull request Aug 15, 2026
Reverts the previous commit's removal of thinking_budget_tokens and picks
a model that accepts it instead.

These three set thinking_budget_tokens, which the SDK serializes as
{"enabled": true, "budgetTokens": N}. Claude 4.7+ models reject that
shape, and the SDK has no way to emit the adaptive form the API asks for:
reasoning_effort is set on the agent config but never reaches the
LLM_CHAT_COMPLETE task, so it is silently dropped rather than acting as a
substitute. Dropping thinking to stay on claude-sonnet-5 therefore traded
away a demonstrated feature for no gain.

claude-sonnet-4-6 accepts thinking_budget_tokens and still fixes the 404
from the retired id, which is what #480 is about. It is also registered
on more deployments: 59_coding_agent.py now passes against both Conductor
OSS 3.32.0 (302s) and Orkes 5.5.0 (301s), where under claude-sonnet-5 the
Orkes leg failed outright.

The rule this leaves: examples that set thinking_budget_tokens pin
claude-sonnet-4-6; everything else stays on claude-sonnet-5, matching
#494. 60 and 60a were not run, as both act on a real GitHub repository.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants