fix(agent): rename internal phase in_progress → domain.TaskPhaseExecution#4
Merged
Conversation
…cution
Fixes dormant phase-lookup bug in claude/gemini/code subagents. agentlib.findPhase
uses strict equality, so default:"execution" + NewPhase("in_progress", ...)
fails when CLI fires the default. Worked in prod only because the executor
always emits explicit PHASE env, but breaks any local CLI invocation that
relies on the default.
Adopts pr-reviewer's pattern of using the typed domain.TaskPhaseExecution
constant for both phase registration and NextPhase strings.
Bumps vault-cli from v0.64.3 to v0.67.5 (TaskPhaseExecution added in v0.65.1).
There was a problem hiding this comment.
auto-approve disabled for this repo, review submitted as comment
Based on the review, here's my consolidated report:
Consolidated Report
Must Fix (Critical)
None. The rename of "in_progress" → domain.TaskPhaseExecution is correctly implemented across all three agents.
Should Fix (Important)
agent/code/pkg/steps/steps.go:76,116,167—errors.Wrapfused without format specifiers. Pre-existing issue in the same file, not introduced by this diff.
Nice to Have (Optional)
agent/gemini/pkg/factory/factory.go:91-100— Incidental multi-line reformatting ofNewParseStep[...]call. Not required by the logic change.
Positive Observations
- All three agents (claude, code, gemini) consistently use
domain.TaskPhaseExecutionfrom vault-cli - Factory functions remain clean composition with no business logic
- Dependency update to vault-cli v0.67.5 provides the
domain.TaskPhaseExecutionconstant - Proper string conversion at type boundary:
string(domain.TaskPhaseExecution)
Automated Checks
- LICENSE: Missing at repo root (pre-existing, not introduced by this diff)
- make precommit: Could not run due to sandbox restrictions on
/tmppaths
{
"verdict": "approve",
"summary": "The rename of internal phase 'in_progress' to domain.TaskPhaseExecution is correctly implemented across all three agent services (claude, code, gemini). Factory patterns are fully compliant, and the dependency update to vault-cli v0.67.5 is appropriate. No issues introduced by this diff require blocking approval.",
"comments": [
{
"file": "agent/code/pkg/steps/steps.go",
"line": 76,
"severity": "major",
"message": "Should Fix: errors.Wrapf used without format specifiers - use errors.Wrap instead"
},
{
"file": "agent/code/pkg/steps/steps.go",
"line": 116,
"severity": "major",
"message": "Should Fix: errors.Wrapf used without format specifiers - use errors.Wrap instead"
},
{
"file": "agent/code/pkg/steps/steps.go",
"line": 167,
"severity": "major",
"message": "Should Fix: errors.Wrapf used without format specifiers - use errors.Wrap instead"
},
{
"file": "agent/gemini/pkg/factory/factory.go",
"line": 91,
"severity": "nit",
"message": "Nice to Have: Incidental multi-line reformatting of NewParseStep call not required by logic change"
}
],
"concerns_addressed": [
"correctness: NextPhase transition uses string(domain.TaskPhaseExecution) - confirmed consistent in agent/code/pkg/steps/steps.go:82",
"correctness: ParseStep default parameter changed from 'in_progress' to string(domain.TaskPhaseExecution) - confirmed consistent in agent/gemini/pkg/factory/factory.go:91-99"
]
}Pre-existing major findings from pr-reviewer-agent verdict on PR #4 — errors.Wrapf was called without format specifiers in all three Run methods. Functionally equivalent to errors.Wrap; using the correct constructor keeps the lint clean and matches the rest of the codebase.
There was a problem hiding this comment.
Now let me compile the final report and verdict JSON.
PR Review: fix(agent): rename internal phase in_progress → domain.TaskPhaseExecution
Must Fix (Critical)
None.
Should Fix (Important)
- vault-cli version bump unverified: vault-cli bumped v0.64.3 → v0.67.5 across all three agents. The delta was not explicitly audited for security-relevant changes between versions.
Nice to Have (Optional)
- Pre-existing test gap:
agent/code/pkg/steps/steps.gohas zero test coverage (the business logic for the math agent is entirely untested). This is a pre-existing gap, not introduced by this PR, but worth addressing. - Same errors.Wrapf pattern in gemini steps:
agent/gemini/pkg/steps/steps.golines 75 and 123 have the sameerrors.Wrapf→errors.Wrapissue this PR fixed inagent/code/pkg/steps/steps.go. Out of scope for this PR but worth a follow-up.
Concerns Addressed
- correctness:
errors.Wrapf→errors.Wrapin steps.go — confirmed correct by go-quality review - correctness:
domain.TaskPhaseExecutionconstant is a type-safe mechanical substitution for"in_progress"literal — no behavioral change - correctness: replace directive reformatting from single-line to multi-line block — cosmetic only, verified equivalent by go-quality review
Verdict
{
"verdict": "approve",
"summary": "Clean refactoring that replaces string literal 'in_progress' with the type-safe domain.TaskPhaseExecution constant across three agent services. The errors.Wrap fix (Wrapf without format args) is correct. Factory patterns are fully compliant. The vault-cli version bump (v0.64.3 → v0.67.5) was not explicitly audited for security delta — recommend verifying separately before merging.",
"comments": [
{
"file": "agent/claude/go.mod",
"line": 17,
"severity": "major",
"message": "Should Fix: vault-cli bumped v0.64.3 → v0.67.5. The security delta between these versions was not audited in this PR. Verify the upgrade is safe before merging, or document the rationale for the version jump."
},
{
"file": "agent/code/go.mod",
"line": 17,
"severity": "major",
"message": "Should Fix: vault-cli bumped v0.64.3 → v0.67.5. The security delta between these versions was not audited in this PR. Verify the upgrade is safe before merging, or document the rationale for the version jump."
},
{
"file": "agent/gemini/go.mod",
"line": 17,
"severity": "major",
"message": "Should Fix: vault-cli bumped v0.64.3 → v0.67.5. The security delta between these versions was not audited in this PR. Verify the upgrade is safe before merging, or document the rationale for the version jump."
},
{
"file": "agent/code/pkg/steps/steps.go",
"line": 1,
"severity": "nit",
"message": "Nice to Have: No test coverage exists for this file (pre-existing gap, not introduced by this PR). The math agent logic (PlanStep, ExecuteStep, VerifyStep) is entirely untested. Consider adding a table-driven test suite."
},
{
"file": "agent/gemini/pkg/steps/steps.go",
"line": 75,
"severity": "nit",
"message": "Nice to Have: Same errors.Wrapf pattern that this PR fixed in agent/code/pkg/steps/steps.go — errors.Wrapf(ctx, err, \"marshal result\") has no format args and should be errors.Wrap. Out of scope for this PR but worth fixing in a follow-up."
}
],
"concerns_addressed": [
"correctness: errors.Wrapf → errors.Wrap in steps.go confirmed correct by go-quality review",
"correctness: domain.TaskPhaseExecution constant matches 'in_progress' literal exactly — mechanical type-safe substitution",
"correctness: replace directive reformatting is cosmetic only — multi-line block is functionally equivalent to single-line",
"security: vault-cli bump NOT audited — raised as Should Fix comment"
]
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent/{claude,gemini,code}subagentsagentlib.findPhaseuses strict equality —default:"execution"+NewPhase("in_progress", ...)fails when CLI fires the defaultPHASEenv; breaks any local CLI invocation relying on the defaultmaintainer/agent/pr-reviewer: typeddomain.TaskPhaseExecutionconstant for phase registration + NextPhase stringsTaskPhaseExecutionconstant added in v0.65.1)Test plan
make precommitinagent/claudemake precommitinagent/geminimake precommitinagent/code