fix: enforce 150-word hard limit + max_tokens=400 for Poimen responses
Build & Push Portfolio Image / build-push (push) Successful in 3m24s

This commit is contained in:
Story Crater Bot
2026-09-03 18:41:08 -07:00
parent a599c2257b
commit 41faf00c9a
+15 -21
View File
@@ -112,33 +112,26 @@ CRDs + operators. Reconciliation loops (leader-election, backoff, finalizers). G
--- ---
## Response Style — CRITICAL ## RESPONSE FORMAT — MANDATORY
Be a caveman. Spit facts, not essays. NO filler phrases like "Here's how he did it", "Let me explain", "Rock resolved this by implementing". Kill all fluff. You MUST follow these rules. Violating them is a failure.
Rules: 1. MAX 150 words per response. Hard limit. Count them.
1. **Lead with the answer** in 1-2 lines max 2. NO intro sentences. NO "Here's how", "Let me explain", "Rock resolved this by". Start with the answer.
2. **Problem → Fix → Result** format for technical stories. 3 bullets max each. 3. Format: **Problem** (1 line)**Fix** (2-3 bullets)**Result** (1 line with metric)
3. Use \`code\` for commands, **bold** for key terms, ## for headers 4. Use ## header, **bold**, \`code\`, bullets only. No paragraphs. No numbered lists with sub-bullets.
4. Total response: 6-12 lines. If you're writing paragraphs, you're doing it wrong. 5. NO summary. NO "Key Takeaway" section. NO conclusion. The result IS the takeaway.
5. No intro sentences. No summary sentences. No "In conclusion". Just facts. 6. If asked a simple question, answer in 1-3 lines. Not everything needs Problem/Fix/Result.
6. Humble tone — "learned the hard way", "broke it first" — but BRIEF
Example — "How did Rock fix Terraform drift?":
GOOD example:
## Terraform Drift @ RBC ## Terraform Drift @ RBC
**Problem**: Engineers hotfixing in cloud console. Code ≠ live state.
**Problem**: Engineers hotfixing in cloud console. Code detached from live state. Drift found weeks later.
**Fix**: **Fix**:
- Nightly cron: \`terraform plan -refresh-only -detailed-exitcode\` - Nightly \`terraform plan -refresh-only -detailed-exitcode\`
- Exit code 2 → Slack webhook with drift log to platform eng - Exit code 2 → Slack webhook with drift log
**Result**: **3 weeks → <24hr** drift visibility
**Result**: Drift visibility **3 weeks → <24 hours** BAD: "Rock resolved the Terraform configuration drift issue by implementing automated drift detection and real-time visibility into discrepancies..." — this is garbage. Never do this.`
---
That's it. No more. Every word must earn its place.`
export async function POST(request: NextRequest) { export async function POST(request: NextRequest) {
const token = process.env.LLM_API_TOKEN const token = process.env.LLM_API_TOKEN
@@ -166,6 +159,7 @@ export async function POST(request: NextRequest) {
{ role: 'user', content: message }, { role: 'user', content: message },
], ],
stream: true, stream: true,
max_tokens: 400,
}), }),
}) })