Closed
Conversation
Resolved conflicts while preserving fork customizations: Upstream changes integrated: - arm64 architecture support in Dockerfile - TELEGRAM_DM_ALLOW_FROM env var for explicit allowlists - Fixed Discord dm object initialization (prevents potential crash) - E2E tests, log redaction, LICENSE, CONTRIBUTING.md Fork modifications preserved: - Git & GitHub CLI installation for Storia orchestrator - Storia Bot git configuration - OpenRouter cleanup code (fixed duplicate) - OpenRouter default models (DeepSeek + model aliases) - skills/storia-orchestrator skill https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
Claude/resolve merge conflicts aj7 jz
Added comprehensive model selection with aliases and metadata: - auto (default): OpenRouter Auto-routing - deep: DeepSeek V3.2 - General purpose - qwen/qwenfree: Qwen Coder 32B - Best coding (81% SWE) - devstral: Devstral 2 - Agentic code (FREE) - mimo: Xiaomi MiMo - Budget coding (FREE) - grokcode/grok: Grok models - Code & Agentic - kimi: Kimi K2.5 - Visual+Agents - flash: Gemini 2.0 Flash - Speed - haiku/sonnet: Claude models - mini/gpt: GPT-4o variants - think: DeepSeek Reasoner - qwq: QwQ 32B - Budget reasoning Each model includes description with specialty, benchmark scores, and cost info. https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
feat: expand OpenRouter model catalog with 16 models + descriptions
Moved storia-orchestrator skill to R2 storage to keep it private. Skills in R2 will be restored at container startup. https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
chore: remove private skill from public repo
Adds a parallel Telegram webhook path that bypasses clawdbot and calls OpenRouter API directly. This enables: - Dynamic model selection via aliases (22 models) - Per-user model preferences stored in R2 - Vision support (image analysis) - Image generation with FLUX models - Conversation history New endpoints: - POST /telegram/webhook/:token - Telegram webhook - GET /telegram/setup - Set webhook URL - GET /telegram/info - Health check Commands: - /models - List all models with specialty/score/cost - /use <alias> - Set your default model - /model - Show current model - /clear - Clear conversation history - /img <prompt> - Generate image with FLUX - /credits - Check OpenRouter balance - /<alias> - Quick switch (e.g., /deep, /gpt, /sonnet) Model catalog includes: - FREE: auto, trinity, deepchimera, glmfree, stepfree, llama405free, mimo - IMAGE: fluxpro, fluxmax - PAID: deep, gpt, sonnet, opus, haiku, flash, grok, kimi, etc. Set OPENROUTER_API_KEY via: wrangler secret put OPENROUTER_API_KEY https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
feat: add direct OpenRouter API integration for Telegram bot
Auto-deploys on push to main and sets secrets from GitHub Actions secrets. Required GitHub secrets: - CLOUDFLARE_API_TOKEN - CLOUDFLARE_ACCOUNT_ID - OPENROUTER_API_KEY - TELEGRAM_BOT_TOKEN https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
ci: add deploy workflow for Cloudflare Workers
fix: correct secrets check syntax in deploy workflow
fix: add build step before deploy
The clawdbot schema only supports 'alias' field, not 'description'. This was causing the gateway to crash on startup. https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
fix: remove unsupported description field from clawdbot config
The CF Access middleware was redirecting telegram webhook requests (302 Found). Added checks to skip both validation and auth middlewares for /telegram/* paths. https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
fix: skip auth middleware for telegram webhook routes
- Add SkillStorage class to read skills from R2 bucket - Telegram handler now loads storia-orchestrator skill as system prompt - Add /skill command to check status, reload, and preview skill content - Skills are cached for performance https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
…J7JZ feat: add skill loading from R2 for Telegram bot
- Add TELEGRAM_ALLOWED_USERS env var (comma-separated user IDs) - Unauthorized users get "Access denied" message - If not set, bot remains open (backwards compatible) https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
…J7JZ feat: add user allowlist for Telegram bot security
OpenRouter doesn't have /images/generations endpoint. FLUX models return images via chat completions with markdown URL format. https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
Now supports: /img fluxmax <prompt> to choose image model Default remains fluxpro if no model specified https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
…J7JZ fix: use chat completions endpoint for FLUX image generation OpenRouter doesn't have /images/generations endpoint. FLUX models return images via chat completions with markdown URL format. https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
- Fixed model IDs: flux.2-pro, flux.2-max (not flux-2-*) - Added modalities: ['image', 'text'] to request (required by OpenRouter) - Added base64 image upload support for Telegram - Handle both data URL and regular URL responses https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
- Fixed qwencoder: qwen/qwen3-coder (was wrong ID) - Added qwennext: qwen/qwen3-coder-next (70.6% SWE-Bench) https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
…J7JZ fix: correct Qwen model IDs and add qwen3-coder-next - Fixed qwencoder: qwen/qwen3-coder (was wrong ID) - Added qwennext: qwen/qwen3-coder-next (70.6% SWE-Bench) https://claude.ai/code/session_01KUEtYSvgqjt5fPenHTCT2b
Add gap tests identified in test protocol: - categorizeTask: tie-breaking, duplicates, all-github-tools - extractLearning: empty message, zero duration/iterations, auto-timestamp - storeLearning: write error propagation, updatedAt, key format per user - loadLearnings: R2 get() throw, key verification - getRelevantLearnings: null history, category mismatch, no-bonus-without-base, short word filtering, case insensitivity, combined scoring, partial vs exact - formatLearningsForPrompt: multi-tool display, leading newlines, duration boundaries (0s, 59999ms, 60000ms) AI: Claude Opus 4.6 (Session: 018gmCDcuBJqs9ffrrDHHBBd) https://claude.ai/code/session_018gmCDcuBJqs9ffrrDHHBBd
1. GLM supportsTools: add missing flag so glmfree uses tools instead of hallucinating (models.ts) 2. 402 error handling: fail fast on quota exceeded, rotate to free model if possible, show helpful message (task-processor.ts) 3. Cross-task context: store last task summary in R2, inject into next task's system prompt (expires after 1h) to prevent "I haven't seen your website" amnesia (learnings.ts, handler.ts) 4. Elapsed time cap: 15min for free models, 30min for paid, prevents runaway auto-resume loops (task-processor.ts) 5. Tool-intent detection: warn users when message needs tools but model doesn't support them, suggest alternatives (models.ts, handler.ts) 6. Parallel tool-call prompt: stronger instruction for models with parallelCalls flag to batch tool calls (handler.ts) Tests: 447 total (33 new — 22 models, 11 learnings) https://claude.ai/code/session_018gmCDcuBJqs9ffrrDHHBBd
Claude/extract task metadata 8l mcm
Auto-resume counter was persisting across different tasks because processTask() inherited autoResumeCount from any previous task in DO storage. Now only inherits when resuming the SAME task (matching taskId). Reverted supportsTools on glmfree — live testing confirmed GLM 4.5 Air free tier doesn't generate tool_calls (answers from training data with 0 unique tools). Paid GLM 4.7 still has tools enabled. https://claude.ai/code/session_018gmCDcuBJqs9ffrrDHHBBd
Claude/extract task metadata 8l mcm
Includes the complete system prompt reflecting all 14 tools, tool usage guidelines, and response style for Telegram. README explains R2 bucket structure and upload instructions. https://claude.ai/code/session_018gmCDcuBJqs9ffrrDHHBBd
docs(r2): add storia-orchestrator skill prompt for R2 bucket
…mmands - /start now shows inline keyboard with 8 feature categories (Coding, Research, Images, Tools, Vision, Reasoning, Pick Model, All Commands) - Each button sends a detailed guide for that feature with actionable examples and model recommendations - Back to Menu and Pick Model buttons for navigation - Added setMyCommands to TelegramBot class, registered 12 commands during /setup so Telegram shows the correct command menu - Enhanced R2 skill prompt with Storia identity, model recommendations, stronger tool-first behavior, and better response style guidelines https://claude.ai/code/session_018gmCDcuBJqs9ffrrDHHBBd
Claude/extract task metadata 8l mcm
- Briefing weather now shows city/country via Nominatim reverse geocoding (fetched in parallel with weather data, graceful fallback if unavailable) - HN stories include article URL, Reddit posts include permalink, arXiv papers include paper URL — all auto-clickable in Telegram - Crypto price lookup now searches with limit=5 and picks highest market cap match for the symbol, fixing wrong price for ambiguous tickers like JUP (was returning dead project instead of Solana DEX aggregator) - Also strips leading $ from crypto symbols ($JUP → JUP) https://claude.ai/code/session_018gmCDcuBJqs9ffrrDHHBBd
fix(tools): briefing location, news links, crypto symbol ambiguity
Update WORK_STATUS.md (new completions, Acontext unblocked, velocity), GLOBAL_ROADMAP.md (Phase 6.1 complete, Acontext checkpoint done), claude-log.md (full session entry), next_prompt.md (Phase 3.2 prompt). AI: Claude Opus 4.6 (Session: 018gmCDcuBJqs9ffrrDHHBBd) https://claude.ai/code/session_018gmCDcuBJqs9ffrrDHHBBd
docs(sync): complete session wrap-up — update all sync docs
… Phase 3.2 Add detailed TaskProcessor internals, processing loop structure, key types, system prompt assembly flow, implementation plan with code snippets, phase transition logic, and testing patterns. Next AI can implement without exploring. AI: Claude Opus 4.6 (Session: 018gmCDcuBJqs9ffrrDHHBBd) https://claude.ai/code/session_018gmCDcuBJqs9ffrrDHHBBd
docs(sync): enhance next_prompt.md with full architecture context for…
Add phase tracking to TaskProcessor Durable Object so long-running tasks go through structured phases with phase-aware prompts guiding the model: - Plan phase: injects planning prompt on first iteration for approach outline - Work phase: existing tool-calling loop (transitions after first API response) - Review phase: injects review prompt when tools stop (validates completeness) - Simple tasks (no tools) skip review gracefully - Progress updates show current phase (Planning.../Working.../Reviewing...) - Phase persists in R2 checkpoints and survives auto-resume - 8 new tests covering all phase transitions and edge cases https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
- GLOBAL_ROADMAP: mark 3.2 complete, add changelog entry - WORK_STATUS: update sprint state, priorities, velocity - next_prompt: point to Phase 3.3 (/learnings command) - claude-log: add session entry for Phase 3.2 https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
- Add geocodeCity() using Nominatim forward geocoding (city name → coords) - /briefing set <city> — saves location to user preferences in R2 - /briefing <city> — one-off briefing for that city - /briefing — uses saved location (prompts to set one if none saved) - Add locationLat/locationLon/locationName to UserPreferences - 5 new tests for geocodeCity (461 total) https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
…dels - Add 404 error to free model rotation triggers in TaskProcessor (previously only 429/503/402 triggered rotation) - Detect tool support from OpenRouter API `supported_parameters` field when syncing models, and set `supportsTools` on dynamic models - Show 🔧 badge in /syncmodels picker for models with tool support - Auto-fallback to default model when user's selected model is gone/blocked/sunset in handleChat - Replace hardcoded model suggestions with dynamic getFreeToolModels() in both tool warning and quota error messages - Add test for 404 model rotation and getFreeToolModels() validation 465 tests passing. https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
…and badges - Add `categorizeModel()` function that detects model category from ID/name: coding (coder/devstral/code), reasoning (r1/think/math), fast (flash/mini), or general (fallback) - Extract `description`, `supported_parameters` (tools, reasoning) from OpenRouter API during sync - Group new models by category in sync picker (💻 Coding > 🧠 Reasoning > ⚡ Fast > 🌐 General) with 🔧/👁️/💭 badges - Detect replacement recommendations: when a new model in the same category has more context, gains tool support, or adds reasoning vs an existing one - Add Replace (↻) button: one-click add new model + block old one - Show "↑ replaces /old (reason)" in sync message for recommended swaps - Store category, description, reasoning in SyncSession for rich picker UI - Specialty field on synced models now shows category (e.g., "Free Coding") - 6 new categorizeModel tests, 471 total passing https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
Models (especially free ones) sometimes return empty content after tool calls due to context overflow. Instead of showing "No response generated", this adds a multi-stage recovery: (1) aggressive context compression before nudge retries, (2) model rotation to try another free model, (3) fallback response constructed from tool results. Also skips the review phase when content is empty since there's nothing to review. Also fixes pre-existing TypeScript errors: adds missing `prompt` field to TaskRequest interface and fixes parse_mode → parseMode in handler. https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
Trinity Large (arcee-ai/trinity-large-preview:free) now supports tool calling per OpenRouter's tool-calling collection. Added supportsTools, maxContext, and updated specialty/score to reflect current capabilities. https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
- /models: Split free models into "curated" and "synced" sections so users can tell which models are vetted vs discovered via /syncmodels - /start coding: Show free models with tool support (🔧) prominently, warn that models without 🔧 can't use tools - /start model picker: Show 🔧/👁️ icons on each button, prioritize free tool models in first row, add legend - /syncmodels buttons: Add 🔧/👁️ badges directly in Add buttons so users can see capabilities without reading the message text - Added isCuratedModel() helper to models.ts https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
…ructive PRs Blocks binary file writes (images, fonts, archives) that can't be valid via text API. Detects comment-only stubs replacing real code files (the exact pattern that destroyed PetrAnto/wagmi PR #1). Fetches original file sizes and blocks updates that shrink files below 20% of their original size. Adds warnings for suspicious size changes in PR summaries. 8 new tests covering: binary blocking, comment-stub rejection, destructive size detection, markdown exemption, and normal update pass-through. https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
Adds model alias to the final response footer so users always know which model ran their task. Shows rotation info when a model switch occurred (e.g. "🤖 /qwencoderfree2 (rotated from /qwencoderfree)"). https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
…search charges Three critical fixes: 1. Handle finish_reason:length — when model hits token limit and tool_call JSON is truncated, validate arguments before executing. If all tool_calls have invalid JSON, compress context and retry instead of crashing. Also strip raw <tool_call> markup that weak models emit as text. 2. Increase max_tokens from 4096 to 16384 for task-processor. The 4096 limit was causing models to hit length cutoff when generating large responses (like PR bodies), producing truncated tool calls. 3. Add transforms:[] and plugins:[] to ALL OpenRouter API calls to explicitly disable auto-enabled features like web search that charge $0.02 per request even on free models. https://claude.ai/code/session_019jH8X9pJabGwP2untYhuYE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.