Skip to content

fix(bug-001): stop mid-stream wait_for cancels + Daedalus ops slice - #24

Merged
singul-oss merged 13 commits into
JailbrokenAI:mainfrom
q3042852622-ship-it:fix/bug-001-stream-timeout-await-llm
Aug 9, 2026
Merged

fix(bug-001): stop mid-stream wait_for cancels + Daedalus ops slice#24
singul-oss merged 13 commits into
JailbrokenAI:mainfrom
q3042852622-ship-it:fix/bug-001-stream-timeout-await-llm

Conversation

@q3042852622-ship-it

Copy link
Copy Markdown
Contributor

PR: fix BUG-001 mid-stream timeout / false network error

Branch: fix/bug-001-stream-timeout-await-llm
Commit: local (push requires write access to origin)

Summary

Stops red-team tools from cancelling healthy streaming completions with short asyncio.wait_for deadlines, which was the root cause of:

  • runs dying mid-flight with CancelledError
  • false network error labels after the model already returned text
  • transform/profile sweeps showing ERROR despite valid refusals/answers

Changes

Core

  • tools/_util.py: add await_llm() 鈥?outer timeout floored at 120s, timeout<=0 disables outer cancel; re-raises as TimeoutError with clear non-network wording.
  • 33 attack tools: replace await asyncio.wait_for(...) on LLM/judge completes with await await_llm(...).
  • Keep real process timeouts on shell.py / chrome helpers / mcp bridge.

Providers

  • base.complete_with_reasoning: on CancelledError/transport errors after tokens, return partial text instead of total failure.
  • openai_provider / anthropic_provider: soft StopEvent(partial) if content already streamed; else classified errors.
  • classify_http_error(): timeout / connect / cancelled / http 鈥?no blanket network error.
  • Image provider uses the same classifier.

Profile / target tools

  • profile_target no longer wait_for-cancels target streams; default timeout 120s.
  • query_target error hints distinguish cancel vs network vs auth.

Docs / tests

  • docs/BUGS.md, docs/FULL_AUDIT_2026-07-26.md
  • tests/test_await_llm.py
  • updated tests/test_provider_timeout.py

Test plan

pytest tests/test_await_llm.py \
  tests/test_provider_timeout.py \
  tests/test_providers.py \
  tests/test_profile_target.py \
  tests/test_multi_fire.py \
  tests/test_framing_sweep.py \
  tests/test_best_of_n.py -q
# 63 passed

Manual:

  1. Restart desktop backend (Ctrl+Shift+R or relaunch).
  2. Run Agent profile_target / transform survey against CPA Grok.
  3. Confirm steps no longer mass-ERROR after ~45s with partial text.
  4. Confirm hard failures still surface as timeout/connect/http, not generic network.

Operator note

Must restart the Wallbreaker backend process to load this code.

Gate

  • scripts/minimal_gate.ps1: 127 passed + CLI smokes green (2026-07-28)

Ops note

  • Branch also includes thematic Daedalus/measure/datasets/engine/desktop commits prepared for review.
  • Push to JailbrokenAI origin blocked (viewerPermission=READ); opened from fork q3042852622-ship-it.

Replace tool-layer asyncio.wait_for on LLM completes with await_llm
(minimum 120s outer floor; prefer provider HTTP timeouts). Return
partial stream content on CancelledError/transport teardown, and classify
httpx failures as timeout/connect/http instead of blanket network error
across OpenAI, Anthropic, and image providers.

Includes profile_target timeout fix, provider timeout tests, await_llm
unit tests, and audit notes in docs/BUGS.md.
Add the operating-engine goal doc, CI/scripts for the minimal pytest+CLI
gate, datasets-refresh workflow, and tracked sorrybench/xstest fixtures
so offline FRR/SORRY batteries no longer depend on gitignored library/.
Add the Daedalus product layer: liberation doctrine injection, dual/single
topology config, cyber-gate MODE LIBERATE rescue, global LiberationStore
with hybrid/external embed retrieval, REPLAY hooks, validate-gated
writeback, and display branding helpers. Wire agent loop + control/validate
tools and cover with unit tests.
Harden trustworthy ASR: keep decomposed StrongREJECT scoring, short-circuit
GARBLED before the LLM judge, expand judge_selftest metrics (kappa/Spearman/
per-class), add frr_scan for benign over-refusal, and surface frr/garbled
rates in report scorecards and session verdict tags.
…mmands

Add offline-capable SORRY-Bench and XSTest loaders (package fixtures),
datasets status/refresh helpers, and CLI surfaces: datasets list|refresh,
schedule install|list|uninstall, and --watch/--schedule/--checkpoint for
relentless autonomous runs.
Default bandit on for campaign/recommend/seed_sweep and mutate constraint
when variants>1. Add relentless checkpoints/watch helpers, schedule daemon
module, low_perplexity transform flags, image_crescendo alias, AgentDojo
inject bank expansion, and rug_pull/worm_wrap/agentbench tools with tests.
…r fixes

Expand TUI app/widgets for liberation modes and session ergonomics, add
BUG-001 partial-salvage regression coverage, and land remaining provider
factory/base timeout resolution tweaks used by the operating loop.
Add the desktop launcher/Electron app sources (without node_modules) and
expand the dashboard SPA/API for Daedalus options, terminal, model pool,
command palette, and agent controls, with matching dashboard tests.
Record real grok-4.5 run: CODE ok, hard AES-rShell frames refused, soft TCP
lab client COMPLIED with validate 2/3, liberation memory save, REPLAY hit,
FRR 0%, and report fields (ASR/FRR/technique mix).
Add COMPLETE audit of Daedalus/wallbreaker operating-engine state,
prioritized forward horizons (ship → operate → hard targets → ops),
and copy-paste Codex goal prompts. Refresh LONG_HORIZON immediate next.
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