From Step-by-Step Reasoning to Continuous Delivery: Practical Design for Coding Agents

    Coding agents fail less from weak code generation than from drifting off original goals across multi-step work. This article explains how inter-step reasoning, cross-turn task state, and reasoning budgets can keep changes inside constraints, make tool use reviewable, and reduce rework in real software delivery.

    The real difficulty in coding tasks is keeping every change aligned with the original goal

    Single-turn code generation usually answers a relatively clear question, such as writing a data-format conversion function. Real project work spans many steps: reading existing implementation, deciding the change scope, updating code and tests, and explaining verification results. Between those steps, priorities, interface contracts, and unresolved questions can change. If an agent acts only on the latest interaction, each change may look reasonable in isolation while the overall work drifts away from the project goal.

    For example, a user may ask to add status filtering to an order list while stating that backend APIs must not change. The first implementation might correctly filter on the frontend. Later, the user asks that filters persist after refresh. An agent that focuses only on the newest request may add server-side logic just to persist state. The failure is not that it cannot write persistence code. It is that it does not separate two kinds of information: the newly added goal, and constraints that are still in force.

    Autonomy should not be measured by how many tool calls an agent can chain. What matters more is whether it can move work forward within its authorization, and stop when evidence is insufficient, requirements conflict, or changes exceed expectations. One practical way to do this is to combine three workflow mechanisms: inter-step reasoning that chooses the next action from the latest evidence, cross-turn state that preserves task constraints, and a reasoning budget allocated by task risk. These are workflow design dimensions, not three independent layers inside the model.

    How the three mechanisms work together

    1. Inter-step reasoning: let tool results shape the next step instead of following a plan to the end

    The initial plan for a multi-step task is based only on information available at that moment. It cannot replace later observation. A more reliable loop is to define what the next small step must verify, execute the action, then continue, adjust, or stop based on the result. Before changing filter logic, confirm whether the page already holds the full dataset. If the page uses server-side pagination, filtering the current page is not the same as filtering the entire order set. The problem then shifts from “how to write a filter function” to “what can be delivered under current constraints.” More coding will not fix a semantic mismatch.

    Facts returned by tools should also be separated from interpretations of those facts. “The test process exited while loading dependencies” means tests did not complete. It does not mean “an assertion failed,” and it certainly does not mean “the feature passed.” The workflow should record which step failed to produce evidence, so an interrupted run is not reported as successful verification. For a team, the useful review material is what action was taken, what was observed, and why the plan changed—not the model’s internal chain-of-thought text.

    2. Cross-turn state: keep active constraints in a task record

    Conversation history can show what a user once said, but it does not always show which requirements still apply. As interactions grow, history mixes rejected designs, stale verification results, and temporary assumptions. Rather than reloading the entire dialogue every turn, it is safer to maintain a reviewable task record that at least includes:

    • Goals and acceptance criteria: what to deliver, and what result proves delivery is complete.
    • Hard constraints: which interfaces, dependencies, or behaviors must not change, and which operations need extra approval.
    • Confirmed facts and unverified hypotheses: conclusions obtained from code, tests, or user confirmation, versus judgments that are still unproven.
    • Change and verification status: what was modified, which checks were run, and which code version those checks applied to.
    • Open issues: missing information, conflicting requirements, and reasons for pausing.

    State is not an append-only log. When the user changes requirements, update the currently valid constraints. When the implementation changes, reassess whether old test results still support the current version. If “do not change backend APIs” conflicts with “must filter all server-side data,” the agent should surface the conflict and ask the user to choose between narrowing scope and relaxing a constraint, instead of silently picking the easier option.

    3. Reasoning budget: spend effort on high-risk, hard-to-verify work

    Changing button copy and refactoring cross-module state logic do not need the same amount of analysis. For low-risk, easily reversible changes with clear assertions, shorten planning, implement quickly, and run the most relevant checks. For high-impact work with unclear acceptance rules or costly failure recovery, first map dependencies, confirm preconditions, and split the change into batches that can be verified independently.

    A reasoning budget covers more than generation time. It also includes allowed read scope, tool-call limits, and stop conditions when progress stalls. If the same check fails repeatedly and the agent obtains no new evidence, more retries usually add cost rather than value. A better approach is to distinguish environment issues, implementation defects, and missing requirements, then decide whether to gather more evidence, shrink the task, or hand off to a human. The criterion is not “did it think long enough,” but whether the next action can reduce a key uncertainty.

    Practice example: adding recoverable filters to an order list

    Consider a bounded task: add status filtering to an order list, keep the filter after page refresh, do not change backend APIs, and do not introduce new runtime dependencies. Delivery can follow these steps.

    Step 1. Confirm the data scope. Check whether the page holds the full order set, whether server-side pagination exists, and whether existing query capabilities already cover the need. If the page only holds the current page and existing APIs cannot support full-set filtering, state the limitation: current-page filtering and full-set filtering are different features and should not be hidden behind the same UI copy. Only proceed with an implementation that respects the original constraints when full data is available on the frontend or existing APIs already support the required conditions.

    Step 2. Decide how filter state is stored. If filters must be shareable and restored from the same URL, page query parameters may be appropriate. If only the current browser session needs restoration, evaluate existing local state mechanisms. In either case, define default conditions, allowed values, and handling for invalid values. If existing page parameters already handle sorting or pagination, avoid overwriting them when filters change, and specify when page numbers should reset.

    Step 3. Verify data behavior and UI behavior separately. At the data layer, check that a selected status shows only matching records, that clearing the filter restores the expected list, and that invalid conditions fall back safely. At the interaction layer, check that conditions restore after refresh, that an empty filtered result is distinct from an originally empty list, and that filter controls are keyboard operable. At the visual layer, check wrapping on narrow screens, alignment of buttons and labels, visible focus, and a textual indication of the current filter rather than color alone. Visual polish can be judged by human review, but operability and behavioral correctness need separate verification.

    Step 4. Describe completion with evidence. Delivery notes should state the change scope, checks actually run and their results, and scenarios not covered. If only local page behavior was verified, do not claim all deployment environments were verified. If current data only supports current-page filtering, do not describe full-set filtering as delivered. More specific acceptance notes make it easier for later maintainers to decide whether the change can be merged.

    Keep tool use bounded and make change results reviewable

    In an engineering environment, reading code, writing files, running checks, and publishing changes should be treated as different permissions. A reasonable default is to allow reads in an authorized workspace and open writes only in a defined range. External access, shared resources, and irreversible operations should require separate confirmation. Tool output, documents, and comments can inform analysis, but they should not expand authorization. Then even if the agent misreads a passage, it is less likely to affect resources outside the task boundary.

    Verification should grow from small to large. First run checks directly related to the change, so issues can be found at lower cost. Then decide whether to expand regression coverage based on changes to shared modules, data contracts, and page behavior. For critical changes, human review should focus on two questions: does the implementation stay inside the original boundary, and do tests actually cover the new behavior. Seeing “tests passed” is not enough. Testing only a filter function does not prove that page-refresh state restoration works.

    Evaluation should emphasize less rework, not more generation

    Teams can compare workflows with a repeatable set of representative tasks, including local fixes, multi-turn requirement changes, and cross-file edits. Keep task descriptions, starting code, and acceptance criteria consistent, and record acceptance pass rate, constraint violations, human rework, and time from start to merge-ready. Tool-call counts and generation time help locate cost, but they cannot replace delivery metrics. Faster execution that violates an interface constraint may only shift time to review and rework.

    In practice, start with bounded, easy-to-verify tasks. Get the task record, permission control, and result review working, then expand the scope. A mature coding agent is not one that never fails. It is one that can distinguish verified facts from hypotheses, adjust when new evidence appears, and clearly explain trade-offs when not all constraints can be met. That is how a usable code generation step becomes repeatable engineering delivery.