Skip to content

Commit a6e2b43

Browse files
committed
Stabilize staging bot flows, enrichment failover, and command/test coverage
1 parent 94ad1b4 commit a6e2b43

32 files changed

Lines changed: 1977 additions & 84 deletions

.github/workflows/bot-deploy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,15 @@ jobs:
6666
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
6767
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
6868
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
69+
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
6970
HUGGINGFACE_INFERENCE_API_TOKEN: ${{ secrets.HUGGINGFACE_INFERENCE_API_TOKEN }}
71+
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
72+
FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
73+
JINA_API_KEY: ${{ secrets.JINA_API_KEY }}
74+
DRIFTBOT_API_KEY: ${{ secrets.DRIFTBOT_API_KEY }}
75+
LLAMA_CLOUD_API_KEY: ${{ secrets.LLAMA_CLOUD_API_KEY }}
76+
UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }}
77+
ASSEMBLYAI_API_KEY: ${{ secrets.ASSEMBLYAI_API_KEY }}
7078
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
7179
CLOUDFLARE_WORKERS_AI_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_AI_TOKEN }}
7280
CLOUDFLARE_ACCOUNT_API_TOKEN: ${{ secrets.CLOUDFLARE_ACCOUNT_API_TOKEN }}

.github/workflows/bot-tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@ jobs:
5454
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
5555
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
5656
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
57+
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
5758
HUGGINGFACE_INFERENCE_API_TOKEN: ${{ secrets.HUGGINGFACE_INFERENCE_API_TOKEN }}
59+
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
60+
FIRECRAWL_API_KEY: ${{ secrets.FIRECRAWL_API_KEY }}
61+
JINA_API_KEY: ${{ secrets.JINA_API_KEY }}
62+
DRIFTBOT_API_KEY: ${{ secrets.DRIFTBOT_API_KEY }}
63+
LLAMA_CLOUD_API_KEY: ${{ secrets.LLAMA_CLOUD_API_KEY }}
64+
UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }}
65+
ASSEMBLYAI_API_KEY: ${{ secrets.ASSEMBLYAI_API_KEY }}
5866
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
5967
CLOUDFLARE_WORKERS_AI_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_AI_TOKEN }}
6068
CLOUDFLARE_ACCOUNT_API_TOKEN: ${{ secrets.CLOUDFLARE_ACCOUNT_API_TOKEN }}

comicbot/config/default.bot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ generation:
1414
objective: explain-like-im-five
1515
output_language: en
1616
url_extractor: gemini
17+
url_extractor_gemini_model: gemini-3-flash-preview
18+
pdf_extractor: llamaparse
19+
pdf_extractor_unstructured_strategy: auto
20+
image_extractor: gemini
21+
image_extractor_gemini_model: gemini-2.5-flash
22+
image_extractor_openai_model: gpt-4.1-mini
23+
voice_extractor: assemblyai
24+
voice_extractor_assemblyai_model: best
1725
detail_level: low
1826
style_prompt: "clean comic panel art, readable characters, coherent scene progression"
1927

comicbot/src/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const BOT_ROOT = path.resolve(__dirname, '..');
77

88
loadEnvFiles([
99
path.join(BOT_ROOT, '.env'),
10+
path.join(REPO_ROOT, '.env.all'),
1011
path.join(REPO_ROOT, '.env.e2e.local'),
1112
path.join(REPO_ROOT, '.env.local')
1213
]);

engine/tests/providers-availability.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ describe('provider availability coverage', () => {
3131
delete process.env.CLOUDFLARE_ACCOUNT_ID;
3232
delete process.env.CLOUDFLARE_API_TOKEN;
3333
delete process.env.HUGGINGFACE_INFERENCE_API_TOKEN;
34+
delete process.env.COHERE_API_KEY;
3435
delete process.env.HUGGINGFACE_BASE_URL;
3536
});
3637

@@ -41,6 +42,7 @@ describe('provider availability coverage', () => {
4142
process.env.CLOUDFLARE_ACCOUNT_ID = 'cf-acc';
4243
process.env.CLOUDFLARE_API_TOKEN = 'cf-key';
4344
process.env.HUGGINGFACE_INFERENCE_API_TOKEN = 'hf-key';
45+
process.env.COHERE_API_KEY = 'co-key';
4446

4547
const fetchMock = vi.fn(async (url) => {
4648
const u = String(url);
@@ -65,6 +67,9 @@ describe('provider availability coverage', () => {
6567
if (u.includes('router.huggingface.co/hf-inference/models/')) {
6668
return jsonResponse({ generated_text: 'huggingface ok' });
6769
}
70+
if (u === 'https://api.cohere.com/v2/chat') {
71+
return jsonResponse({ message: { content: [{ text: 'cohere ok' }] } });
72+
}
6873
return jsonResponse({ message: `unexpected ${u}` }, 404);
6974
});
7075
global.fetch = fetchMock;
@@ -75,7 +80,8 @@ describe('provider availability coverage', () => {
7580
{ provider: 'openai', model: 'gpt-4o-mini', expected: 'openai ok' },
7681
{ provider: 'openrouter', model: 'openai/gpt-4o-mini', expected: 'openrouter ok' },
7782
{ provider: 'cloudflare', model: '@cf/meta/llama-3.1-8b-instruct', expected: 'cloudflare ok' },
78-
{ provider: 'huggingface', model: 'mistralai/Mistral-7B-Instruct-v0.2', expected: 'huggingface ok' }
83+
{ provider: 'huggingface', model: 'mistralai/Mistral-7B-Instruct-v0.2', expected: 'huggingface ok' },
84+
{ provider: 'cohere', model: 'command-r-plus', expected: 'cohere ok' }
7985
];
8086

8187
for (const row of rows) {

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"test:telegram:r2-real": "vitest run -c telegram/vitest.config.js telegram/tests/r2-crash-log.e2e.test.js telegram/tests/image-r2.e2e.test.js",
4646
"test:telegram:full-stack": "vitest run -c telegram/vitest.config.js telegram/tests/full-stack.interfaces.e2e.test.js",
4747
"test:telegram:predeploy": "node telegram/scripts/predeploy-check.js",
48+
"test:vendor:preflight": "set PREDEPLOY_SKIP_TESTS=true&& node telegram/scripts/predeploy-check.js",
49+
"test:vendor:matrix:local": "node telegram/scripts/vendor-local-matrix.js",
4850
"test:render": "npm run test:telegram",
4951
"test:render:local": "npm run test:telegram:local",
5052
"test:render:gemini-real": "npm run test:telegram:gemini-real",

scripts/validate-secrets.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ const PROFILES = {
4444
'GEMINI_API_KEY',
4545
'OPENAI_API_KEY',
4646
'OPENROUTER_API_KEY',
47+
'GROQ_API_KEY',
4748
'HUGGINGFACE_INFERENCE_API_TOKEN',
49+
'COHERE_API_KEY',
50+
'FIRECRAWL_API_KEY',
51+
'JINA_API_KEY',
52+
'DRIFTBOT_API_KEY',
53+
'LLAMA_CLOUD_API_KEY',
54+
'UNSTRUCTURED_API_KEY',
4855
'CLOUDFLARE_ACCOUNT_ID',
4956
'CLOUDFLARE_WORKERS_AI_TOKEN',
5057
'CLOUDFLARE_ACCOUNT_API_TOKEN',
@@ -67,7 +74,14 @@ const PROFILES = {
6774
'GEMINI_API_KEY',
6875
'OPENAI_API_KEY',
6976
'OPENROUTER_API_KEY',
77+
'GROQ_API_KEY',
7078
'HUGGINGFACE_INFERENCE_API_TOKEN',
79+
'COHERE_API_KEY',
80+
'FIRECRAWL_API_KEY',
81+
'JINA_API_KEY',
82+
'DRIFTBOT_API_KEY',
83+
'LLAMA_CLOUD_API_KEY',
84+
'UNSTRUCTURED_API_KEY',
7185
'CLOUDFLARE_ACCOUNT_ID',
7286
'CLOUDFLARE_WORKERS_AI_TOKEN',
7387
'CLOUDFLARE_ACCOUNT_API_TOKEN',

telegram/config/default.render.lang-he.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ generation:
1818
style_name: Classic
1919
style_description: clean illustrated art, readable characters, coherent scene progression
2020
style_prompt: clean illustrated art, readable characters, coherent scene progression
21+
url_extractor: jina
22+
url_extractor_gemini_model: gemini-3-flash-preview
23+
pdf_extractor: llamaparse
24+
pdf_extractor_unstructured_strategy: auto
25+
image_extractor: gemini
26+
image_extractor_gemini_model: gemini-2.5-flash
27+
image_extractor_openai_model: gpt-4.1-mini
28+
voice_extractor: assemblyai
29+
voice_extractor_assemblyai_model: best
30+
auto_enrich_short_story_prompts: true
31+
short_prompt_word_threshold: 10
32+
enrichment_provider: wikipedia
33+
enrichment_fallback_provider: gemini
34+
max_context_items: 5
35+
max_enrichment_chars: 800
36+
include_sources: true
2137
consistency: true
2238
panel_watermark: true
2339
debug_prompts: false

telegram/config/default.render.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,22 @@ generation:
1515
objective_name: "Explain Like I Am Five"
1616
objective_description: "Use simple words, short sentences, and relatable examples suitable for a young audience."
1717
output_language: auto
18-
url_extractor: gemini
18+
url_extractor: jina
19+
url_extractor_gemini_model: gemini-3-flash-preview
20+
pdf_extractor: llamaparse
21+
pdf_extractor_unstructured_strategy: auto
22+
image_extractor: gemini
23+
image_extractor_gemini_model: gemini-2.5-flash
24+
image_extractor_openai_model: gpt-4.1-mini
25+
voice_extractor: assemblyai
26+
voice_extractor_assemblyai_model: best
27+
auto_enrich_short_story_prompts: true
28+
short_prompt_word_threshold: 10
29+
enrichment_provider: wikipedia
30+
enrichment_fallback_provider: gemini
31+
max_context_items: 5
32+
max_enrichment_chars: 800
33+
include_sources: true
1934
consistency: true
2035
panel_watermark: true
2136
debug_prompts: false

telegram/scripts/postdeploy-sanity.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ async function main() {
199199
const args = parseArgs(process.argv.slice(2));
200200
const envOnly = parseBool(args['env-only'] || process.env.BOT_SECRETS_ENV_ONLY);
201201
loadEnvFiles([
202+
path.join(repoRoot, '.env.all'),
202203
path.join(repoRoot, '.env.local'),
203204
path.join(repoRoot, '.env.e2e.local'),
204205
path.join(repoRoot, 'comicbot/.env'),

0 commit comments

Comments
 (0)