Engineering notes, 7 min read
I sleep. My agents keep working.
How I built an overnight engineering workflow at ngram with Slack and Codex, and what made its bug investigations useful by morning.
- 01Read the threadThe watcher checks whether the report is eligible for investigation.
- 02Trace the issueCodex follows the browser evidence, saved state, and logs.
- 03Prepare a changeThe agent works in an isolated checkout and records its tests.
- 04Review the handoffI check the evidence and decide whether the fix should ship.
“Did you check?” A teammate had reported a bug in Slack and left enough detail to get started. The thread sat there until I could come back, find the affected conversation, and pull up the logs. Hours could pass before I asked the first useful question.
At ngram we build software for creating and editing video. A single report can lead through a browser session, a saved project, an agent run, and an export job. Finding where the symptom began often takes longer than changing the code. That's the part of the work I wanted to start while I slept.
At the time, I kept Codex available on an Ubuntu machine on AWS and connected it to a Slack watcher. I wanted to wake up to a diagnosis I could check, a pull request I could review, or a specific decision the investigation needed. Getting a process to stay up overnight was straightforward. Explaining to it how I make those calls took longer.
Start where the team already reports bugs
Slack was already where teammates pasted conversation links and added details as they learned them. I kept intake there. A small Node process checked the approved sources roughly once a minute and saved checkpoints so it could pick up where it left off. The watcher could identify changed threads in code. It called Codex when deciding what to do with a thread required judgment.
The current thread mattered more than the line that woke the watcher up. A direct mention could invite a response. Some clearly bounded reports qualified under the intake rules even without a mention. If a teammate had already taken ownership, the watcher left the work with them unless someone explicitly asked for help.
A quick acknowledgement was useful, especially in a direct message. I wanted its wording to match what the system knew at the time. It could say it had received a report as soon as it saw it. It could say an investigation was underway once a Codex turn actually started. Keeping those two events separate later helped me understand why some threads went quiet.
Reconstruct the failure before opening a diff
I wrote the first steps of an investigation into a skill file. Start with the affected conversation or project version and the time of the report. Find out what the person expected to happen and what they actually saw. Resolve the affected user from the linked record, because the teammate posting in Slack may be reporting something on someone else's behalf.
PostHog events gave me a timeline of browser actions. A replay, when one was available, let me see whether the user hit an error, retried, or got stuck in a loading state. From there I checked the saved state in Supabase and followed the relevant application, Vercel, or agent execution logs. I used identifiers and timestamps across those checks. Two projects with nearly identical titles can point to entirely different runs.
Take a report that says an export never arrived. An export click shows the user tried. I want to know whether the server accepted the request, how the render ended, and whether the browser got as far as downloading the file. If the logs confirm a successful render and the download is the first part I can't account for, I know where to spend the next half hour.
Sometimes a recording had expired or capture rules had excluded the session. An empty analytics query went into the handoff as an evidence gap. The agent could still check the saved project and server logs, and tell me how far those records let it follow the request.
Give each investigation a place to continue
For a longer investigation, I paired the Slack thread with a Codex chat and a Git worktree, which gave it a separate checkout. Two reports could then move at the same time without their edits landing in the same working directory. The agent in that chat owned the implementation and tests so I could find the diagnosis, the diff, and the test results together.
The mapping earned its keep when someone replied after the investigation started. Suppose a teammate added that the problem only happened after editing the second scene. If the agent was working, the watcher sent the detail into the active turn. If the chat was idle, it resumed that same investigation. The agent kept the evidence it had already gathered and could revisit the right step of its diagnosis.
The skill files also set out how far the work could go. A factual question called for a verified answer. A bounded bug could move from investigation to a proposed fix. A broader feature needed a scope decision. Changes to repository settings and access permissions required approval. When someone had already given clear authorization for the same action, the workflow could keep going.
Make it possible to tell why the bot went quiet
I learned this by opening Slack threads where the bot had replied once and then gone silent. One request had never made it into a Codex turn. A follow-up on another investigation had failed to reach the agent. Sometimes a login or verification step blocked progress and the result never made it back to the thread. The watcher could be running through all of this.
I started tracking when the watcher discovered a request, when it dispatched the work, whether a follow-up reached the active investigation, and when it delivered a result. With those events I could find the last confirmed step on a quiet thread. An ended turn still needed a recorded outcome and a way to get that outcome back to the person who asked.
The workflow could retry a known startup failure when the evidence showed that no turn began. Once there was a chance the agent had already sent a reply or made a change, I wanted the uncertainty recorded for review. Repeating the action could leave someone with two answers or two versions of the same fix.
The server needed upkeep too. Worktrees and chats accumulated. We limited cleanup to completed, inactive work and rolled out changes to the watcher after review. If the standby machine had missed an update, it could catch up later. A persistent process is useful only if I can tell what version is running and what happened to the work it accepted.
What I wanted to see in the morning
For a fix, I wanted a pull request that explained what failed, which evidence established the cause, and what the tests covered. If a preview required a login the agent couldn't complete, I wanted the blocked step and the checks it did run. That let me decide whether to open the preview myself, ask for more evidence, or review the diff as it stood.
An unfinished investigation could still save time if the next action was clear. I could take over from the last confirmed result without restarting the investigation. I kept release decisions with a human and treated an investigation request as permission to do the investigative work. The usual reviews, checks, and authorization still applied before the code shipped.
What I'd build first today
I'd start with one approved Slack channel and one kind of bug report. I'd get the workflow to identify the right project, return a useful answer, and record how it got there. Then I'd give each investigation its own chat and checkout and test the cases that made the first version hard to trust. Can a new detail reach the agent halfway through a run? Can I recover from a failed startup without starting the work twice? Can I tell whether a reply was delivered after a connection drops?
The original Ubuntu host was already being retired when I wrote this. The pieces I'd reuse are the debugging instructions, the connection between a thread and its investigation, and the handoff that shows what happened. If those work for one kind of report, there is a concrete basis for taking on a second.
When I open my laptop, I still want to read the evidence and make the call about what ships. The difference is having something specific to review before I catch up on Slack.