From b7ffce8d8850b84f37785a2c2a5f5abc4c7bd8df Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Thu, 11 Jun 2026 13:50:26 +0000 Subject: [PATCH] docs(architecture): document v0.18.1 completion guard, reasoning cap option, request-builder scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QA F1 (REJECT-P1 on 2bdc763, qa-reviews/prautoblogger/2026-06-11-2bdc763.md): ARCHITECTURE.md was not updated in the commit that introduced the new class and option (Standard §7 same-commit rule). - File tree: add class-open-router-completion-guard.php (empty-completion guard, v0.18.1) under includes/providers/. - Options table: add prautoblogger_reasoning_max_tokens (v0.18.1 reasoning token cap; default PRAUTOBLOGGER_DEFAULT_REASONING_MAX_TOKENS = 2048; 0 = legacy uncapped effort mode). - File tree: refresh class-open-router-request-builder.php description — it now owns request body assembly + the reasoning token cap/headroom, not just headers. No version bump: 0.18.1 is still unreleased on this branch. Agent-Session: prab-empty-draft-guard-20260611 --- ARCHITECTURE.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 51d033f..df64ea8 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -195,6 +195,7 @@ prautoblogger/ │ ├── providers/ │ │ ├── interface-llm-provider.php # Contract for any LLM provider │ │ ├── class-open-router-provider.php # OpenRouter API implementation (chat completions) +│ │ ├── class-open-router-completion-guard.php # Empty-completion guard: warn on finish_reason=length, one reasoning-off retry, audited failure (v0.18.1) │ │ ├── class-open-router-embedding-provider.php # Text embeddings for semantic dedup │ │ ├── class-open-router-pricing.php # Model pricing lookup and cost estimation │ │ ├── interface-source-provider.php # Contract for any social media source @@ -207,7 +208,7 @@ prautoblogger/ │ │ ├── class-open-router-image-support.php # API key, response parsing, retry/backoff helpers │ │ ├── class-open-router-image-pricing.php # Model resolution + per-image cost estimation │ │ ├── class-open-router-config.php # API base URL (direct vs AI Gateway) -│ │ ├── class-open-router-request-builder.php # Header building + Hostinger cURL auth workaround +│ │ ├── class-open-router-request-builder.php # Request body assembly + reasoning token cap/headroom (v0.18.1) + headers + Hostinger cURL auth workaround │ │ ├── class-runware-image-provider.php # Runware FLUX.1 (default v0.9.0+) │ │ ├── class-runware-image-pricing.php # FLUX schnell/dev cost table + resolver │ │ ├── class-runware-image-support.php # Key, response parsing, retry, dimension snap @@ -561,6 +562,7 @@ All prefixed with `prautoblogger_`: | `prautoblogger_analysis_model` | OpenRouter model for analysis (default: cheap) | | `prautoblogger_writing_model` | OpenRouter model for writing (default: quality) | | `prautoblogger_editor_model` | OpenRouter model for chief editor (default: quality) | +| `prautoblogger_reasoning_max_tokens` | v0.18.1 — hard cap on thinking tokens per call when reasoning is enabled; sent as OpenRouter `reasoning.max_tokens` (replaces `effort` when active) and the request `max_tokens` is raised by the cap so reasoning can never consume the visible-content budget; 0 = legacy uncapped effort mode. Default `PRAUTOBLOGGER_DEFAULT_REASONING_MAX_TOKENS` (2048) | | `prautoblogger_daily_article_target` | Number of articles per day (1-10, default: 1) | | `prautoblogger_writing_pipeline` | 'single_pass' or 'multi_step' (default: multi_step) | | `prautoblogger_niche_description` | Text description of the site's niche |