The agent wrote the code. Why does the project still need rework?
A draft feature turned into autosave and an SDK upgrade. How to prepare requirements, spot unrequested agent decisions and stop attempts that produce no new information.
- Published
- October 26, 2026
- Verified
- October 26, 2026
The agent wrote the code. Why does the project still need rework?
A small change is needed: someone filling in an application form wants to save it and finish later. The agent examines the project, adds storage, changes the form and runs the tests. Everything passes. Reopen the form, and the text is still there.
Then someone signs out, signs in with another account and sees the same draft. The save button has disappeared too: the agent decided autosave would be more convenient. And the new package required dependency updates, so the developer is now investigating a broken build instead of checking the form.
This is a hypothetical example involving an ordinary form. The agent was asked to add drafts and returned several product decisions and a changed development environment. The developer now has to work out which changes are necessary, which are acceptable and how long undoing the rest will take.
It is tempting to write “do not make things up; follow the requirements” one more time. But what exactly must the agent avoid inventing if some requirements were never written? And how can a team notice that the work has gone off course before rework costs more than the feature?
A draft is not yet a requirement
“Save it and finish later” sounds clear. Until the first question: later means after moving to another screen, closing the app or signing in on another phone? Should saving happen through a button or without the user's involvement? What happens to the application after sign-out?
Choosing a library answers none of these questions. Once the feature exists, however, behaviour chosen by the agent can easily be mistaken for something the team agreed on.
For this example, suppose the team has decided to save text fields locally through a button, restore them after restart for the same account and delete them on sign-out. Deletion might be unacceptable in another product: someone may expect to return to unfinished work after signing in again. Here, the team chose that behaviour beforehand.
The task description can be short:
Change the existing application form without changing its layout.
Save text fields through the “Save draft” button.
Show confirmation after a successful local write.
If the write fails, keep the entered text in the open form
and explain that the draft has not been saved.
After restart, restore the saved draft for the same account.
Delete that account's draft on sign-out.
Do not add autosave, server synchronisation or attachment storage.
First explain and obtain approval for any new dependency
or SDK upgrade.
There is no table schema or class name here yet. But it already explains why an otherwise elegant autosave implementation would be rejected: it changes how someone uses the form. It also explains why server synchronisation, even if implemented well, is outside this task.
The same description gives the team its test scenarios. Writing data and reading it back is not enough: write failure, process termination, sign-out and switching accounts remain. If a test creates a new storage object and retrieves the previous string, that does not yet establish that the app will restore the application after restart. Discovering the difference is particularly unpleasant after someone has trusted “Saved” and closed the app.
What the agent needs to know about the project
Even a detailed task does not explain an existing application's structure. Where does the current account come from? Which module already handles local data? Can the form access storage directly? Without those answers, an agent may build a second mechanism beside the one the team already uses.
These are questions about the project's architecture. There is no reason to invent the answers again for each task: refer to the module description, the relevant interface and an existing example. Keep the draft specification focused on behaviour and the conditions for accepting the work. The developer can then see what has been assigned without hunting for a product rule among test commands.
The agent also needs repository instructions: where to read requirements, how to build the project, which checks to run and what it may change on its own. Tools that support the format can use AGENTS.md for this. Appropriate instructions might be: “Use the project's existing storage approach. Explain the need for a new dependency first. If a check cannot run, report that instead of marking it complete.”
The next step is to confirm that the tool actually reads this file; how instructions are loaded depends on the environment. Also check whether the agent can access the right project version and designs, and run the required checks. Discovering missing access after an expensive run is doubly frustrating: the money is spent and the result still cannot be verified. Even a short connection check does not authorise an unapproved paid service call.
GitHub Spec Kit makes a similar sequence explicit: specification, technical plan, tasks. It helps organise preparation, but the resulting documents still need reading. If the agent invented draft deletion on sign-out, putting that assumption into neatly formatted Markdown does not turn it into the team's decision.
Duplicated requirements create another problem. A rule is updated in the specification today, while the agent instructions retain the old version. Tomorrow's implementation may depend on which file the agent finds first. Keep the rule in one place and link to it elsewhere. “Add synchronisation someday” should remain a proposal, not an extra task the agent decides to take on now.
When a question is actually needed
Now change one condition of the example: the team has not decided whether sign-out should delete the draft. The agent cannot find an answer in the requirements or existing implementation. That is a reasonable reason to ask the developer. How long user data is retained cannot be decided merely because one option is easier to implement.
“Please clarify the draft requirements” is a poor question. The developer must first work out what is missing. A more useful question is:
The requirements do not say what happens on sign-out, and the current code does not clear drafts. Should they be deleted or retained until the next sign-in? Deleting a draft discards the unfinished application; retaining it needs rules for how long it stays and who can read it. Meanwhile, I can implement the button and write-failure handling. I will leave sign-out cleanup and restoration after another sign-in until this is decided.
The message shows what has been examined, what remains unknown and what work can continue. The developer does not have to supervise every action to keep the agent from waiting unnecessarily.
Consider a different conflict: the design includes a button, while the task specifies autosave. Unless the team has already established which source takes precedence, implementation convenience cannot settle this. The conflict needs to be shown. Instructions in a downloaded example certainly cannot override the project's restrictions.
Questions about every file read or typo correction, however, quickly turn the assistant into another job. A step already covered by the task can proceed if it needs no new decision. A different SDK, a new service or additional spending for the draft feature calls for a pause before that particular change and an explanation of why it is needed. Other work need not stop with it.
A missing test device prevents testing on that device; it does not necessarily prevent completing the implementation. Pretending that the test passed is not an option. Neither is hiding a known defect or bypassing an access restriction to produce a reassuring report. The agent should refuse that method while preserving the option to continue the permitted work.
A working scenario instead of a completion percentage
The developer returns to a report listing changed classes, added tests and completed refactoring. All of that may have been necessary. But the important question remains unanswered: what happens to the entered text if writing fails?
The check for this part of the feature can be described like this:
Expected: entered text remains in the form after a write failure.
Check: open the form, fill in the fields, cause local storage
to reject the write, then press Save.
Accept: fields remain populated, no success is shown,
and the error is visible.
The description alone proves nothing. After execution, it needs the code version, the method used to cause the failure and the observed result. If the agent could not reproduce a storage error, the developer should learn that immediately. A screenshot of a success message does not help; it shows a different case.
Anthropic's account of long-running agents describes a related problem: an agent could change code and run individual tests without noticing that the complete feature failed. The authors added step-by-step checks through the interface. This was web development in a particular agent environment, not a ready-made guarantee for Flutter. The reason to consider that experience is practical: successful commands can obscure a user journey that still needs checking.
There is no need to wait for the final report. Once saving has been implemented, the chosen scenario can be checked before restoration, sign-out and several other changes are added. Testing a small, complete part is more useful than another “80 percent done”.
At least three cases deserve different responses. The agent refers to a library method missing from the installed version: check that version's source. It replaces a button with autosave: check the agreed behaviour. It moves interface elements: open the screen and compare it with the design at the same size and in the same state. Calling all of this hallucination is possible, but the fixes differ.
A particularly revealing moment is when the agent proposes changing the check instead of fixing the implementation. The test used to require retaining fields on failure; now it permits clearing them, and the code passes. A test can be wrong too. In that case, the explanation starts with the requirement it contradicts. If the check was weakened merely to accommodate the current code, the passing result was bought by abandoning promised behaviour.
When another attempt is one too many
The hypothetical build problem can develop quite logically. The new package does not fit, so the agent upgrades the SDK. Another part of the app stops building, so it replaces another dependency. Now adapters need rewriting. Each step has a plausible explanation, yet the draft still cannot be saved and returning the project to its previous state is getting harder.
A feature sometimes does require a platform upgrade. The difference is whether the need was established and agreed beforehand. A failure after an unapproved update does not establish that the entire app needs modernising.
Before making changes, run a relevant baseline check and retain its result. Did the build work? Did the form tests pass? Otherwise, the first failure can send the agent into repairing an old problem or blaming its own mistake on the project's condition.
A retry does not by itself establish a loop. An intermittent failure may need several attempts to reproduce. But there should be a reason to repeat: test another explanation, obtain missing data or establish that the failure really is intermittent. If the agent keeps reading the same files, adjusting parameters and promising “this time”, ask: what did the last attempt establish, and how will the next one differ?
The agent should ask itself this after a failure, not only answer an irritated developer later. “I checked the installed version; the method is absent. Next I will examine whether the existing interface supports the same operation” explains a continuation. “It did not work; I will try again” does not. These messages do not expose the model's internal reasoning, but they can reveal a lack of new results.
Agree on spending before work gets stuck. How long may the agent investigate without a working change? May it call paid services, how often and within what budget? When must it stop and show what it has learned? A small fix and research into an unfamiliar format need different answers. A universal “two failures, then stop” gets in the way.
“Watch your tokens” does not replace these agreements. If the tool does not expose usage, the agent has no reliable source for an exact count. Time, external-call counts and a predetermined review point remain available. Where the environment supports call limits, timeouts and access restrictions, configure those separately. A request not to overspend does not block the next call.
If there is no new information, or the budget is exhausted, continuing out of habit has little purpose. Preserve the error, show the changes and consider returning to the last verified state. Undo only the agent's own work, without wiping someone else's changes through a broad repository reset. Alternatively, leave the code intact and hand the developer the problem with a clear next step.
For this hypothetical situation, a stopping message could read:
The build passed before the update. The selected package requires a different SDK. Upgrading it introduced errors in a neighbouring module, which remain unresolved. I propose removing the added dependency and checking whether the draft can use the existing storage without upgrading the SDK.
There is a cause to examine and a proposal to discuss. The developer does not have to extract them from another promise to finish on the next attempt.
Time and money already spent do not make that next attempt free.
What to leave for the next agent
Even successful work can end badly if the next session starts by guessing. The repository contains changed files, the conversation contains several plans, and “the tests passed” refers to a version before the latest edits. The next agent must work out again what is complete and what can be relied on.
For the draft feature, a continuation note might say: saving is implemented; write failure was checked at a specified code version; restoration after process termination has not been checked; deletion on sign-out awaits a decision. Include check commands and links to requirements and files. Keep the note with the code and update it as work proceeds; an old successful run must not quietly validate new changes.
Anthropic's discussion of context engineering addresses selecting the information an agent needs within a limited context. For a project, the question is practical. The agent needs to know what has been decided now and where to find the details. An archive of every discussion, with accepted and rejected options mixed together, does not yet answer that.
With two agents working in parallel, the team must also establish whether they understand a shared operation in the same way. One builds the form, the other storage. The first shows “Saved” when the method returns. The second returns after queueing the write, without waiting for it to finish. Both may complete their parts, but the confirmation appears before anyone knows whether the data was saved.
Before dividing the work, agree on what method completion means, who changes the shared interface and who checks both parts together. If both need the same file, agree on the order of changes too. More agents do not remove those questions. Two favourable reviews help little if both reviewers accepted the same mistaken assumption.
One draft feature is enough to put project preparation to the test: another contributor opens the task description, finds the relevant module and repeats the check without reconstructing the entire conversation. If someone must explain again why the button cannot be removed and why text must survive a write failure, those rules still live in the developer's head.
For the person using the form, the outcome is less grand than a report of extensive work: save the application, return to it later, keep the text on failure and never see someone else's data. That was the reason for the change. Documents and agents are useful to the extent that they help deliver it, without first having to rebuild everything that accumulated around it.
ArkTelos Lab: engineering journal · official ArkTelos website
Channels: ArkTelos Lab EN · ArkTelos Lab RU · ArkTelos EN · ArkTelos RU
Result boundaries
- The draft feature, failures and agent messages form a hypothetical design scenario, not an executed experiment or a private incident. Spec Kit was not run, models were not compared, and spending or rework reductions were not measured. Recommendations do not guarantee model compliance.
Telegram edition