Skip to content

ddg: x-vqd-hash-1 protocol rewrite (plugin v0.2.0) — FEAT-10 closed - #3

Merged
VTSTech merged 1 commit into
mainfrom
ddg-protocol-rewrite
Oct 9, 2026
Merged

VTSTech merged 1 commit into
mainfrom
ddg-protocol-rewrite

Conversation

@VTSTech

@VTSTech VTSTech commented Oct 9, 2026

Copy link
Copy Markdown
Owner

DDG retired the x-vqd-4 token AND the 2025 model catalog. This is the full rewrite to the challenge-based protocol (reverse-engineered 2026-10-09, cross-validated against benoitpetit/duckduckgo-chat-cli):

  • Proof lifecycle: /status (x-vqd-accept: 1) returns a base64 JS challenge in x-vqd-hash-1; solved by the bundled Node helper (ddg_vqd.js, DDG_SOLVE_UA in lockstep with the request UA); post-processed like the page bundle (client_hashes -> base64(SHA256(String(value))), meta origin/stack/duration) -> the X-Vqd-Hash-1 REQUEST header; per-turn rotation via the /chat response header.
  • Chat body: canUseTools/canUseApproxLocation/reasoningEffort/ durableStream (client-minted RSA-2048 JWK via bundled ddg_durable.js).
  • SSE: role-based grammar (assistant/source/tool-invocation/ ui-component) + legacy action fallback + bracketed markers.
  • Catalog rotated: 8 live wire IDs (gpt-6-luna, gpt-5.6-luna, gpt-5.4-nano/mini, claude-haiku-4-5, mistral-small-2603, tinfoil/gpt-oss-120b, tinfoil/gemma4-31b) with forward-resolving legacy aliases; live discovery via fetch_capabilities() (/duckchat/v1/capabilities, proof-gated retry).
  • generate_stream() TRUE incremental (FEAT-10 closed) with full error-taxonomy parity.
  • Fixes over the first rewrite pass: is_cloud=True restored (BaseBackend defaults direct subclasses to local), tool/function roles fold to user (DDG only understands user/assistant), mixed-case legacy alias keys never matched the lowercased lookup, stream limit/403/429/5xx wrapping.
  • Tests: 49 -> 99 (proof lifecycle, wire shape, SSE grammar, stream, capabilities, taxonomy, alias table, node plumbing). Suite 3,433 passed / 20 skipped. ruff + black clean.
  • scripts/probe_duckduckgo.py rewritten for the new protocol (--live drives the backend end-to-end; TEST-13 automation).
  • audit: FEAT-10 CLOSED; TEST-13 partially closed (handshake live-verified via ddg-challenge-solver; one live 200 SSE turn remains). Register 136 findings / 18 OPEN.

DDG retired the x-vqd-4 token AND the 2025 model catalog. This is the
full rewrite to the challenge-based protocol (reverse-engineered
2026-10-09, cross-validated against benoitpetit/duckduckgo-chat-cli):

- Proof lifecycle: /status (x-vqd-accept: 1) returns a base64 JS
  challenge in x-vqd-hash-1; solved by the bundled Node helper
  (ddg_vqd.js, DDG_SOLVE_UA in lockstep with the request UA);
  post-processed like the page bundle (client_hashes ->
  base64(SHA256(String(value))), meta origin/stack/duration) ->
  the X-Vqd-Hash-1 REQUEST header; per-turn rotation via the /chat
  response header.
- Chat body: canUseTools/canUseApproxLocation/reasoningEffort/
  durableStream (client-minted RSA-2048 JWK via bundled ddg_durable.js).
- SSE: role-based grammar (assistant/source/tool-invocation/
  ui-component) + legacy action fallback + bracketed markers.
- Catalog rotated: 8 live wire IDs (gpt-6-luna, gpt-5.6-luna,
  gpt-5.4-nano/mini, claude-haiku-4-5, mistral-small-2603,
  tinfoil/gpt-oss-120b, tinfoil/gemma4-31b) with forward-resolving
  legacy aliases; live discovery via fetch_capabilities()
  (/duckchat/v1/capabilities, proof-gated retry).
- generate_stream() TRUE incremental (FEAT-10 closed) with full
  error-taxonomy parity.
- Fixes over the first rewrite pass: is_cloud=True restored (BaseBackend
  defaults direct subclasses to local), tool/function roles fold to
  user (DDG only understands user/assistant), mixed-case legacy alias
  keys never matched the lowercased lookup, stream limit/403/429/5xx
  wrapping.
- Tests: 49 -> 99 (proof lifecycle, wire shape, SSE grammar, stream,
  capabilities, taxonomy, alias table, node plumbing). Suite 3,433
  passed / 20 skipped. ruff + black clean.
- scripts/probe_duckduckgo.py rewritten for the new protocol
  (--live drives the backend end-to-end; TEST-13 automation).
- audit: FEAT-10 CLOSED; TEST-13 partially closed (handshake
  live-verified via ddg-challenge-solver; one live 200 SSE turn
  remains). Register 136 findings / 18 OPEN.
@VTSTech
VTSTech merged commit 0f814a9 into main Oct 9, 2026
5 checks passed
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