When More Work Can Be Delegated, What Should Developers Decide?
Suppose you ask an agent to fix a slow list query. It can inspect code, identify bottleneck candidates, and suggest caching or indexes. A possible solution does not make every change acceptable.
Is faster response worth stale data? Can pagination change? Did the task authorize higher operating costs?
Delegating more requires defining these boundaries. You need not know every implementation in advance, but distinguish the desired result, behavior to preserve, and choices the agent may make.
The list-query task and prompts are illustrative. No repository investigation, performance measurement, or effectiveness comparison was conducted for this article.
1. Leave unknowns as investigation targets
You do not need to know the bottleneck first. Avoid presenting it as established before investigating. “The database is slow; add caching” fixes both cause and solution prematurely; latency may instead come from response transformation or another call.
| Vague request | Scoped investigation |
|---|---|
| Fix the slow list query | Identify requests and data conditions exhibiting delay, provide reproduction/measurement and supported causes. Stop at investigation and proposals for this stage. |
The second does not dictate a cause but defines a deliverable. The agent can propose measurement methods, performance targets, and alternatives. OpenAI's goal-writing guidance also suggests requesting and refining success criteria when they are initially unclear. Using Goals in Codex
Adopting those proposed goals remains a decision: check whether they reflect actual user inconvenience and realistic measurement conditions.
2. Separate preserved behavior from delegated implementation
Assume the list must preserve descending creation time, ascending ID for ties, existing page-number/page-size rules, response fields and meanings, and authorization/error behavior.
These are more actionable than “preserve existing behavior.” Internal function decomposition, variable naming, or duplicate-calculation removal can remain implementation choices within that boundary.
| Category | Decision in this example |
|---|---|
| Developer-defined outcome | Which user operation should become faster? |
| Invariants | Sorting, pagination, response, authorization, errors |
| Delegated choices | Investigation order, hypotheses, alternatives, implementation within scope |
| Decisions to revisit | Changes to user behavior, freshness, or operations |
| Completion evidence | Diff, behavior checks, comparable performance measurements, limitations |
Real work needs existing specifications and callers inspected; these are not universal list-API rules. State known constraints and leave unknown ones for investigation so the agent does not silently settle them.
3. An example investigation request
Investigate the slow list query and propose improvements.This stage covers investigation and proposals only.Identify affected requests/data conditions, reproducible measurement,current behavior, evidence for each cause candidate, open questions,alternatives and their effects, verification methods, and a supportedperformance-target proposal.Preserve created_at descending and id ascending for ties;existing pagination rules; response fields/meanings; authorization/errors.Read relevant code/docs and investigate in the allowed local test environment.Temporary measurement code and reproduction tests are allowed.Feature implementation, production-data changes, and deployment are excluded.Do not request approval again for each already allowed investigation action.Separate facts, hypotheses, and proposals.If measurement is unavailable, explain why; do not invent numbers.The developer specifies the stage, invariants, authorized actions, and outputs without presuming a cause or solution. Temporary measurement code is already allowed; discovering a possible fix does not authorize implementation or deployment.
Completing this stage means obtaining proposals and decision evidence, not completing a performance improvement.
4. Choose alternatives by the conditions they change
These are hypothetical proposals, not findings:
| Proposal | Question | Treatment in this example |
|---|---|---|
| Remove repeated calculation within one request | Are outputs and side effects equivalent? | Can proceed in an implementation stage authorizing local changes |
| Remove tie-breaking | Does it violate preserved order? | Reject under current contract |
| Introduce shared caching | Freshness, invalidation, cost, operational burden? | Decide scope after comparison |
| Add a database index | Write effects, storage, rollout and rollback? | Separate review here |
| Change pagination method | Existing callers and user flow? | Decide contract change separately |
Impact matters more than labels. Existing approval for caching may cover a change; a one-line edit can significantly alter response semantics or permissions.
Ask whether it fits authorization, changes visible results/caller expectations, adds operating cost or managed components, requires data recovery/deployment to reverse, and has sufficient decision evidence. Tool permission to execute a command is not evidence that the design choice is appropriate.
5. Do not repeatedly approve an already delegated implementation scope
After reviewing investigation and agreeing on targets and measurement, expand scope. The following prompt assumes those decisions exist and should refer precisely to them:
Implement against the agreed performance target and measurement conditions.Choose local implementation changes that preserve response, sorting,pagination, authorization, and error behavior. This includes relevant testimprovements, execution, and fixing defects in the change.Do not ask again for each step within that scope.Shared caching, database-schema changes, and public response-contractchanges are excluded. If needed, explain reasons, alternatives, impact,and rollback before proceeding with that part. Continue independentwork already within scope.Do not alter invariants or expected test values merely to hit the target.Report honestly if improvement is not established under agreed conditions.Provide the diff, behavior checks, before/after measurements, and gaps.Production deployment is excluded.This leaves implementation choices delegated and revisits decisions only when new impacts require acceptance. Removing tie order or permission checks to meet a target does not complete the original request.
OpenAI's long-running-work examples also separate goals, constraints, deliverables, and completion criteria; their document structure and execution style need not be copied into every task. Run long horizon tasks with Codex
6. Distinguish investigation, implementation, and proven improvement
| Stage | Evidence | Not yet established |
|---|---|---|
| Investigation complete | Reproduction, current state, supported causes and alternatives | Improved performance |
| Implementation complete | Scoped changes and behavior checks | Unmeasured performance effects |
| Improvement confirmed | Agreed before/after comparison and invariants | Effects in unchecked production conditions |
| Production rollout | Separately defined deployment/operational checks | Production success from local tests alone |
A target needs request type, data scale, environment, and measurement method, not only a number. Easier data or changed measurement conditions may no longer test the same target. If agreed measurement cannot run, record the blocker and next action rather than relabeling it complete.
This article has no measurements. It defines what evidence is needed to choose, not which alternative is faster.
7. Which decisions remain with the developer?
Even when investigation and recommendations are delegated, priorities remain: response speed versus freshness, acceptable operating burden, lowering a target versus broadening scope. Product requirements, user expectations, costs, and operations shape these choices. An agent can compare and recommend, but the delegating party should specify accepted conditions.
Result wanted this time:Behavior that must remain:Choices/actions delegated without further approval:Conditions requiring a scope decision:Evidence needed for completion:Unknown answers can remain investigation targets. Distinguish them from choices already authorized. Once scope is set, acceptance needs evidence; the next article covers judging code you did not write.
Report an error or share feedback
Open a draft with this article’s title and URL. Review the message and recipient before sending.
Open email draftIf no email app opens, copy these details into your usual email service.
Related posts
AI Using AI Coding Agents Well: Design the Delegation Before Comparing Tools
Turn a hypothetical session-expiration notice into a specification, acceptance criteria, and verification evidence before comparing coding agents.
Today I Learned 2026-10-06 Practical Claude Code Commands for Developers
A situation-based guide to Claude Code planning, context, recovery, diff, and review commands, checked against official documentation on October 24, 2026.