From Voice Note to GitHub Issue: Building a LangGraph & Nomad Bot
You are walking your dog when inspiration hits: you finally understand what is breaking in production. You pull out your phone, open Telegram, and fire off a quick 30-second voice note: “Hey, in the payments repo we need to batch the reconciliation worker events using the new bulk endpoint, and make sure we update the Zod schema accordingly”.
What used to happen to that recording? It got buried in your “Saved Messages”. By Monday morning, you either forgot the idea entirely or opened a lazy one-line issue titled “improve reconciliation”, leaving your team (or future you) having to reverse-engineer which files actually needed touching.
To kill that friction for good, I built GitHub Issuer Bot: an autonomous Telegram bot that accepts text and voice notes, inspects the target repository’s actual code tree using the official GitHub CLI, and writes a structured issue complete with Conventional Commits title, exact file paths, and actionable checklists.

The Pitfalls of Monolithic Prompts and Naive Bots
When you try to hack this together with a simple Telegram webhook wired directly to an OpenAI API call, you immediately hit three hard engineering bottlenecks:
- Telegram’s Aggressive Webhook Timeouts: If your endpoint takes longer than 5 to 10 seconds, Telegram assumes failure and retries.
- Architecture Hallucinations: When a language model has no live visibility into your codebase, it makes up plausible-sounding paths like
src/services/payment.tswhen your actual file issrc/modules/billing/worker.ts. Hallucinated paths defeat the purpose of an actionable issue. - Loss of Conversational Context: Creating a technical issue often needs a quick clarification. If the bot asks “Which repository should I target?”, your follow-up reply must retain the original intent without forcing you to re-record your voice note.
Solving this required ditching the monolithic “one-shot prompt” in favor of an explicit cyclic agent graph with deterministic tool execution.
The 5 Architectural Pillars
The system was designed around one strict rule: never clone full repositories to disk, and never hallucinate a file path.
1. Decoupled Ingestion with Hono + grammY
The bot runs an ultra-lightweight HTTP server built on Hono and grammY. The webhook validates the secret token header, responds with an immediate 200 OK in under 2 milliseconds, and hands off the update to background processing:
app.post("/webhook/telegram", async (c) => {
const secretToken = process.env.TELEGRAM_SECRET_TOKEN;
if (secretToken && c.req.header("x-telegram-bot-api-secret-token") !== secretToken) {
return c.text("Unauthorized", 401);
}
try {
const update = await c.req.json();
if (!bot.isInited()) await bot.init();
// Fire-and-forget background processing to prevent Telegram webhook timeouts
void bot.handleUpdate(update).catch((err) => {
console.error("Error processing update:", err);
});
return c.text("OK");
} catch (err) {
return c.text("Bad Request", 400);
}
});
2. Nomad Deployment with Traefik Ingress
The service runs as a standard service job inside my homelab Nomad cluster, budgeted with a modest 300 MHz of CPU and 512 MB of RAM.
Ingress is managed by Traefik, which dynamically routes incoming traffic to the container port allocated by Nomad. Internal dependencies: native PostgreSQL running on my primary node (travolta) handles conversation checkpointer state, while a local Faster-Whisper container handles audio transcription.
3. Cyclic Agent Orchestration with LangGraph and DeepSeek
The reasoning engine is powered by LangGraph running on DeepSeek-V4.1-Flash-1017. DeepSeek provides fast inference, solid function-calling reliability, and low token costs.
The graph defines a feedback loop where the verifier node inspects state, invokes tools if information is incomplete, or prompts the user for clarification before dispatching:
export const graph = new StateGraph(StateAnnotation)
.addNode("verifier", verifierNode)
.addNode("tools", toolsNode)
.addNode("dispatch", dispatchNode)
.addEdge(START, "verifier")
.addConditionalEdges("verifier", shouldContinue, {
tools: "tools",
dispatch: "dispatch",
[END]: END,
})
.addEdge("tools", "verifier")
.addEdge("dispatch", END)
.compile({ checkpointer });
Thread state is persisted in PostgreSQL using PostgresSaver, allowing multi-turn conversations and smooth state cleanup via /clear.
4. Non-Invasive Repo Inspection with GitHub CLI (gh)
Rather than pulling hundreds of megabytes of Git history into memory, the agent’s inspection tools run gh api via execa authenticated with a Personal Access Token (PAT).
The agent traverses the remote tree to discover matching paths, reads architectural standards like AGENTS.md or .github/ISSUE_TEMPLATE/, and lists recent issues to guard against duplicates:
export const getRepoTreeTool = tool(
async ({ repo }, config) => {
const targetRepo = repo || config?.state?.repo;
const token = process.env.GH_PAT;
const { stdout } = await execa(
"gh",
["api", `repos/${targetRepo}/git/trees/HEAD?recursive=1`, "--jq", ".tree[].path"],
{ env: { ...process.env, GH_TOKEN: token } }
);
const files = stdout.split("\n");
return files.slice(0, 500).join("\n");
},
{
name: "get_repo_tree",
description: "Inspects the directory and file tree of the target repository.",
schema: z.object({ repo: z.string().optional() }),
}
);
5. Security Guardrails
A bot authorized to interact with private repositories requires strong defense in depth:
- Strict User Allowlist: Only user IDs listed in
ALLOWED_TELEGRAM_USERSare allowed to interact with the bot. Unauthorized messages are dropped silently. - Least-Privilege PAT: The GitHub token is strictly scoped to
contents: readandissues: write. - Indirect Prompt Injection Defense: Repository files (
AGENTS.md, source code) are treated as untrusted data inputs wrapped strictly within structured tool parameters, preventing embedded text instructions from hijacking the agent prompt.
Technical Trade-offs and Constraints
Production systems always involve trade-offs:
- Accumulated Latency vs. User Feedback: DeepSeek-V4.1-Flash-1017 delivers a Time-to-First-Token under 200 ms. However, transcribing a longer audio note and executing tools can bring end-to-end turnaround to 5–8 seconds. To keep the interaction responsive, the bot sends continuous typing actions to Telegram indicating what stage is executing.
- GitHub API Rate Limits: Although generous, recursive Git tree lookups consume REST API quota (5,000 req/hour per PAT). We defensively cap tree listings at 500 entries and truncate file content reads to 20 KB to not worry about this.
- Issue Idempotency: Telegram can retry webhook delivery on network hiccups. The graph guards against this by running
list_recent_issuesbefore creation and tracking the processed Telegram update ID in PostgreSQL.
Outcomes and Takeaways
Integrating this bot into my workflow eliminated the gap between having an idea and having an actionable task:
- Zero Mobile Friction: I can record a 20-second voice note while walking down the street and have a fully structured GitHub issue created in under 10 seconds, complete with verified code paths and Conventional Commits tagging.
- Specialized Tools over Giant Prompts: Pairing deterministic GitHub CLI tools with an explicit LangGraph state machine produces issues that are indistinguishable from those written carefully at a desktop workstation.