Managing tasks an AI agent discovers mid-work
Managing tasks an AI agent discovers mid-work: record each as a new linked task, mark it required or optional and never widen the current task silently.
Managing tasks an AI agent discovers mid-work comes down to one rule: record the discovery as a new, linked task and keep it out of the current one. Agents find things constantly. While adding a VAT line to an invoice, an agent notices that the CSV export rounds money with a different helper, that a test fixture is out of date and that a function name is misleading. Left alone, it will often fix some of them on the spot. The current task then grows without anyone deciding it should, the diff mixes unrelated changes and the review gets harder. The opposite failure is just as common: the agent mentions the problem in its chat output, the session ends and the finding is lost. The four steps below keep every finding without letting it change what the current task is allowed to do. They work with any agent and any task tracker. For keeping the resulting backlog tidy, see backlog hygiene for AI projects.
Step 1: Ask the agent to report, not fix
Put an explicit instruction in the task or the agent's standing instructions: 'If you find work outside this task, do not do it. List it under Discovered in your report.' Then ask for a fixed shape for each item, so findings are comparable and easy to turn into tasks.
A useful shape has five parts. What: 'CSV export uses its own rounding instead of cents()'. Where: 'src/export/csv_rows.py, line 41'. Why it matters: 'export totals can differ from checkout totals by one cent'. Blocking: whether this task cannot be honestly completed without it, yes or no. Evidence: the test, log line or code that shows it.
The instruction does not need to be clever. Its job is to give the agent a legitimate place to put its observation, so fixing it in place stops looking like the only helpful option. Pair it with a declared scope, as described in keeping agents within scope, so a fix that slips through shows up as an out-of-scope path in the diff.
Step 2: Classify each finding as required or optional
Required means the current task cannot be completed honestly without it. If the VAT line depends on a rounding bug being fixed first, the finding is a prerequisite. Record it as a dependency: the current task now depends on the new one and should not be marked complete until the new task is done, or it should be split so the part that does not need the fix can finish.
Optional means the finding is worth doing but the current task is complete without it. The misleading function name is optional. Record it as a related link, so someone reading either task later can find the other, with no effect on whether the current task can complete.
The classification is a judgment, and agents get it wrong in both directions. They mark cosmetic issues as blocking, and they miss real prerequisites because they did not run the check that would have shown them. Review the classification when you review the task. A wrong 'required' blocks work for no reason; a wrong 'optional' lets a task complete on top of a known problem, which is how a fix breaks another feature.
Step 3: Look for an existing task before creating one
Before creating a new task, search for one that already covers the finding. Search by file path first, because paths are stable: 'csv_rows.py' finds earlier tasks about the export far more reliably than prose does. Then search by the key nouns: 'rounding', 'cents', 'export'.
Expect the search to miss things. Two agents describe the same problem in different words ('unify money rounding' versus 'export totals off by a cent'), and keyword search will not connect them. A quick human look at the candidate list is worth more than an extra automated pass. If an equivalent task exists, link the finding to it and add the new evidence there instead of creating a duplicate.
Duplicates are expensive with agents in particular. Two tasks for the same fix can both be picked up, producing two competing changes in the same file. That is one of the common causes behind an agent repeating work that was already done.
Step 4: Create the task without permission to run
A new task created from a discovery should start in a planning state with no execution scope. It is a proposal. It needs its own scope and its own approval before any agent works on it, exactly like a task you wrote yourself. This matters most for unattended work: if a runner can pick up any ready task, a discovery becomes work that nobody approved. Keep discovered tasks off the list of tasks a run is authorized to take, as covered in limits for unattended runs.
Write the records in a safe order. Create the new task first, then add the dependency from the current task to it. If the process is interrupted between the two writes, the worst case is an unlinked new task, which is easy to spot. The reverse order can leave the current task depending on a task that was never written.
Finally, never widen the current task to absorb the discovery after the fact. If you decide the fix belongs in this change, edit the scope deliberately, approve it again and note why.
HOW BRAIN FLUID DOES IT
In the current v1.8.5 candidate, you create cards and edit their details on the board [C1a], keep dependency and blocker details with project planning [N03], and a card edit does not automatically grant execution permission [N09]. In development builds after v1.8.5, a card-bound session can report discovered work through controlled card operations, with findings written to the card [D1]. In those development builds, discovered work becomes a new TODO card with no execution scope, linked to its origin as a required dependency or a related memory link [D2]. In development builds, the child card is written before the parent dependency, and completing a child changes the parent's eligibility without completing it or starting a session [D2]. In the development build tests, the new work was identified by the test script, not a live agent, and duplicate checks are lexical, not semantic [D2]. In a small native rehearsal on a development build, the follow-up card stayed TODO while the original card reached DONE [D1].
- C1a Board and card actions
- Create project cards, edit their details, and track work through the board. Evidence: Owner-observed creation and moves; source-reviewed editing
- N03 Planning and My Work
- Keep assignee, reviewer, due-date, blocker and dependency details with project planning, and use My Work to focus attention. Evidence: Implemented; source and plan records
- N09 Execution grants
- Keep proposed card scope separate from approved execution authority. Evidence: Implemented; final authority/revocation tests retained
- D1 Card workflow reporting (development build)
- In development builds after v1.8.5, a card-bound coding session can report start, progress, blockers, readiness, completion, reopening and discovered work through controlled card operations, with findings and next steps written to the card. Evidence: Development build (1.8.5 workflow RC2, October 30, 2026): 9 packaged workflow tests; Claude Code 2.1.314 and Codex CLI 0.164.0 each completed a small rehearsal on a disposable workspace. Not in the v1.8.5 candidate.
- D2 Linked follow-up work (development build)
- In development builds, work discovered mid-task becomes a new TODO card with no execution scope, linked to its origin as a required dependency or a related memory link. Evidence: Development build (workflow RC2, October 30, 2026): packaged lifecycle tests, scripted reports. Not in the v1.8.5 candidate.
QUESTIONS
- Should an AI agent fix bugs it finds outside its task?
- Generally no. Ask it to report the bug with the file, the evidence and whether the current task depends on it, then create a separate task. Fixing in place mixes unrelated changes into one diff, skips scoping and approval for the fix, and makes the review harder. The exception is a fix the current task cannot work without, and that should be a deliberate scope change.
- What is the difference between a required and an optional follow-up task?
- A required follow-up is a prerequisite: the original task cannot be honestly completed until it is done, so it becomes a dependency. An optional follow-up is useful but independent: it gets a related link and has no effect on whether the original task can complete. Getting this wrong either blocks work needlessly or lets a task complete on a known problem.
- How do I stop an agent from creating duplicate tasks?
- Make it search before it creates. File paths are the most reliable search key, followed by the main nouns of the problem. Expect keyword matching to miss duplicates phrased differently, and have a person glance at likely candidates. When an equivalent task exists, link the finding and add the evidence there.
RELATED GUIDES
RELATED HARNESS PAGES
BRAIN FLUID AI HARNESS
COMING SOON
Verified against the v1.8.5 development candidate (October 30, 2026 build) (reviewed October 30, 2026)
Free Windows software, not released yet. The download opens on the product page when the release is approved, with nothing to sign up for.