A Legacy PHP Shipping Fix, With an Agent in the Terminal
The shipping override that turned zero into a charge
The ticket looks harmless: an invoice should allow free shipping, but entering a zero override restores the default shipping charge. The application runs PHP 7.4, mixes database access with invoice calculations, and has tests that mostly cover successful checkout.
This is a representative maintenance exercise, not a timed benchmark. I want to compare two workflows on the same change: working alone in the editor and terminal, and pairing with an agent. The acceptance criteria stay identical. A missing or null override uses the default charge. An explicit zero remains zero. A positive override remains unchanged.
The culprit is familiar: empty() treats zero as empty. Finding that expression is easy. Establishing everything that depends on its behavior is the actual job.
Repository reconnaissance: manual search beside agent exploration
Working alone, I start with git status, inspect composer.json, and search for shipping_override with rg. I trace the value from request parsing through persistence to invoice generation. Before running anything, I check whether the test bootstrap connects to a database or sends messages.
With an agent, I delegate that mapping, not the fix. My first instruction is specific: inspect the shipping override path, identify runtime constraints and existing tests, and propose a minimal change without editing files. Do not install dependencies, access external services, or run migrations.
The manual route gives me intimate knowledge of every file I open. The agent route can gather scattered references while I inspect the calculation itself. Its output is still a reading list, not evidence: I open the cited files and verify its claims. A plausible explanation of a nonexistent helper is worse than another minute with rg.
Regression tests: the same contract for both workflows
Before changing the condition, both routes need a failing test. I target the smallest calculation boundary that avoids booting the whole application. If extracting that boundary requires a substantial redesign, I stop and choose an existing integration seam instead.
- A missing override must preserve the configured default shipping charge.
- A null override must follow the existing default shipping behavior.
- An explicit zero override must produce a zero shipping charge.
- A positive override must remain unchanged in the final invoice.
Working alone, I write those cases and run the narrowest relevant test command. With an agent, I ask it to draft the cases using the repository's existing test framework and fixtures. I then inspect the assertions before execution. A test that duplicates the new conditional proves very little; it should assert the observable invoice amount.
The PHP patch: constrain the agent before accepting its diff
The manual fix replaces the truthiness check with an explicit missing-or-null decision. I preserve the existing money representation and input-validation rules. This ticket does not justify introducing floats, normalizing every numeric string, or modernizing the invoice subsystem.
The agent gets the same boundaries: PHP 7.4 compatibility, no dependency changes, no unrelated formatting, and no edits outside the calculation and its tests without approval. That prevents a tiny repair from arriving with newer syntax the production runtime cannot parse.
Then I review git diff, run the focused tests, and run the relevant broader suite. I also check the working tree for accidental fixture changes. Agent-generated code gets exactly the same scrutiny as my own tired-afternoon patch.
Model switching without rewriting the terminal workflow
For this pairing loop, Fluxo provides one key and one base URL, https://api.fluxorelay.com, across supported providers. It works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. I could use Claude Sonnet 5.5 for repository exploration and GPT-6.1 Sol for a second review, keeping their conclusions independently verifiable.
Billing follows real tokens, including cache reads and writes, with no monthly fee. That makes scoped prompts and selective context worth watching. Users also earn a referral share when people they invite pay; that is separate from whether a patch deserves approval.
Verdict: pair for reconnaissance, keep ownership of correctness
For a one-line PHP bug, working alone may be simpler. Agent setup and review are not free. Pairing becomes more useful when behavior is scattered across controllers, persistence, and invoice rendering: the agent can map those paths and draft regression coverage while I keep the contract in view.
My verdict is to pair, but narrowly: delegate exploration and drafts, never the definition of correct. If that fits your terminal workflow, consider creating a Fluxo account.