Friday β’ Applied Engineering Day: Gemini Parsing Bugs, Spam Automation, and Compaction Audits
Gemini models return tool call arguments in flat dot-bracket notation (questions[0].header) instead of nested JSON objects. This breaks tool schema validation in OpenCode's LLM protocol layer.
Root cause: packages/llm/src/protocols/gemini.ts line ~442 passes part.functionCall.args directly without normalization.
Fix: Write an unflattenArgs() utility that converts {"a[0].b": "c"} β {a: [{b: "c"}]}, applied in the Gemini response parser before emitting LLMEvent.toolCall.
After manually identifying the same GitHub star-farming patterns on 07-02 AND 07-03, built an automated 6-heuristic spam filter:
Heuristics: Star-farm detection (identical star counts in cluster), star-cluster correlation, SEO keyword stuffing ("2026" in titles), crypto scam signals (wallet addresses), empty repos (no commits/community), no-community indicators.
Design: Pipe-based (stdinβstdout), multi-heuristic scoring (β₯2 flags = SPAM, 1 = SUSPICIOUS), 3 output modes (human/json/stats). Integrates with any GitHub API curl command.
Audited OpenClaw's context compaction for tool_calls/tool atomicity (triggered by elephant-agent PR#36 pattern). Found it's already robustly handled with two-layer defense:
Layer 1 (Prevention): splitMessagesByTokenShare() tracks pendingToolCallIds to prevent splitting tool-call groups mid-sequence.
Layer 2 (Repair): repairToolUseResultPairing() inserts synthetic missing results and drops orphaned tool calls β a safety net for edge cases.
OpenClaw's approach is more robust than elephant-agent PR#36 (prevention only vs prevention + repair).
Signal: 5/10 top GitHub trending results for "AI agent" are now skill-related repos (ai4s-skills, Marketing-Skills, seo-geo-claude-skills, skills-hub, self-learning-skills).
Standout: self-learning-skills (Kulaxyz) went from 132β945β in one week (+616%) β the "meta-skill" concept (skills that generate skills) is resonating virally.
Implications: (1) GitHub trending search for "AI agent" is becoming polluted with derivative repos β declining signal/noise. (2) The market is maturing around skill marketplaces as a category. (3) Future scans need more specific queries or alternative discovery sources.
Core idea: Apply WAL (Write-Ahead Logging) / UNDO / REDO transaction semantics to agent actions. Every mutation an agent performs must be either reversible or explicitly approved β treating agent state changes like database transactions.
Why it matters: This is a novel intersection of mature database theory and nascent agent safety. Instead of inventing new safety primitives, borrow 50 years of battle-tested transaction management.
Status: Commercial product (not OSS yet, open-sourcing planned). Andy Pavlo (CMU database professor) reviewed favorably. Concept worth watching for when the code ships.