fix(plan): preserve strategy_decisions_json in error_details during execute and report actual actor mode #10945
Merged
hamza.khyari
merged 3 commits from 2026-04-30 15:13:29 +00:00
bugfix/executor-error-details-overwrite into master
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
auto/needs-reevaluation
controller-managed
overdue
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Needs Feedback
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
Controller deferred this PR; awaiting Phase 6+ scope-evaluator or operator re-enablement.
Auto-agents controller manages this PR/issue (see tools/controller/deploy/RUNBOOK.md). Remove this label to abandon controller management.
PR blocked by an open issue dependency. Operator must close the dep (or remove the dependency link) before the merge driver can act. Auto-cleared by merge_drive when no open deps remain.
Most recent merge cycle hit CI timeout. Driver excludes this PR while last merge_cycle row is < 30 min old; label persists thereafter as visible history.
Currently being processed by an implementer worker.
Currently being processed by the merge driver.
Currently being processed by a reviewer worker.
Merge driver heartbeat stale; pipeline halted. Closed automatically on next clean tick.
Detected master commit violating the strict merge invariant. Tracked as an issue (not a PR label); kept here for label completeness.
In-cycle escalation: most recent attempt ran at the Tier 0 slot (`tier-0`). Slot's model defined in .opencode/models/tiers.yaml.
In-cycle escalation: most recent attempt ran at the Tier 1 slot (`tier-1`). Slot's model defined in .opencode/models/tiers.yaml.
In-cycle escalation: most recent attempt ran at the Tier 2 slot (`tier-2`). Slot's model defined in .opencode/models/tiers.yaml. Gated behind IMPLEMENTER_ESCALATION_TIER2_ENABLED.
In-cycle escalation: most recent attempt ran at the Tier -1 slot (`tier-min`). Slot's model defined in .opencode/models/tiers.yaml. Suffix is ``-min`` (not ``--1``) so the Forgejo UI reads naturally.
Tracking issues used by the AI Automation system for agents to communicate and report.
Rebase conflict needs LLM conflict-resolver.
Failing CI needs implementer attention.
Documenting a driver incident or rollback.
Reviewer has APPROVED this PR and no later REQUEST_CHANGES is outstanding. The merge driver requires this label to even consider a PR for merging. Set by the reviewer worker on APPROVE; cleared on REQUEST_CHANGES.
Train repeatedly lost master-tempo races. Driver excludes via merge_cycle until cooldown elapses; label persists as visible history.
Revert PR backing out an invariant violation. Fast-tracked through the merge driver.
Sentinel PR duplicated from upstream into a personal fork by tools/duplicate_prs_to_fork.py for pipeline testing. Lives only in the fork; the canonical pipeline never sees it.
No implementer activity for N days. Flagged for human review. Auto-cleared on next push to head branch.
Repeatedly fails on current master (>= 3 ci-fail-on-rebased-sha releases in 12 h). Excluded from driver until human triage.
A ticket in a blocked state and unable to complete until some other task is completed first.
Bounty
$100
A bounty of $100 for any open-source contributor who provides a MR that solves this issue
Bounty
$1000
A bounty of $1000 for any open-source contributor who provides a MR that solves this issue
Bounty
$10000
A bounty of $10000 for any open-source contributor who provides a MR that solves this issue
Bounty
$20
A bounty of $20 for any open-source contributor who provides a MR that solves this issue
Bounty
$2000
A bounty of $2000 for any open-source contributor who provides a MR that solves this issue
Bounty
$250
A bounty of $250 for any open-source contributor who provides a MR that solves this issue
Bounty
$50
A bounty of $50 for any open-source contributor who provides a MR that solves this issue
Bounty
$500
A bounty of $500 for any open-source contributor who provides a MR that solves this issue
Bounty
$5000
A bounty of $5000 for any open-source contributor who provides a MR that solves this issue
Bounty
$750
A bounty of $750 for any open-source contributor who provides a MR that solves this issue
MoSCoW
Could have
Could have feature in order to satisfy the epic/legendary.
MoSCoW
Must have
Must have feature in order to satisfy the epic/legendary.
MoSCoW
Should have
Should have feature in order to satisfy the epic/legendary.
There are questions in the ticket that can not be completed until the project owner provides clarity.
Points
1
1 man-hours worth of work for an expert with no learning curve.
Points
13
13 man-hours worth of work for an expert with no learning curve.
Points
2
2 man-hours worth of work for an expert with no learning curve.
Points
21
21 man-hours worth of work for an expert with no learning curve.
Points
3
3 man-hours worth of work for an expert with no learning curve.
Points
34
34 man-hours worth of work for an expert with no learning curve.
Points
5
5 man-hours worth of work for an expert with no learning curve.
Points
55
55 man-hours worth of work for an expert with no learning curve.
Points
8
8 man-hours worth of work for an expert with no learning curve.
Points
88
88 man-hours worth of work for an expert with no learning curve.
Priority
Backlog
This ticket has backlogged priority and is not to be worked on yet
Priority
CI Blocker
Critical priority issue that blocks CI/CD pipeline and prevents PR merges
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
When an epic or legendary is in review it must be signed off by owner, tech lead, and scrum master before being marked as completed.
When an epic or legendary is in review it must be signed off by owner, tech lead, and scrum master before being marked as completed.
When an epic or legendary is in review it must be signed off by owner, tech lead, and scrum master before being marked as completed.
A ticket for learning a tool or technology that is needed to be able to do future planning and design.
State
Completed
The ticket has been fully implemented, completed, and merged with the source code. This label should only be applied once a ticket is closed.
State
Duplicate
A ticket that represents the same content as an existing ticket.
State
In Progress
A ticket that is actively being developed.
State
In Review
A ticket that has had some code completed to implement but is waiting to pass peer review and is not yet merged in.
State
Paused
This ticket's work started but wasn't finished. It's on hold (likely in a feature branch) and will be resumed later, either due to a blocker or a delay.
State
Unverified
All new tickets start in this state. A developer may set it to show the ticket is unverified. This means we haven't agreed to work on it. It will either move to a verified state or be closed as wontdo.
State
Verified
The issue has been verified by a developer as legitimate. It will be worked on and verified tickets are now considered part of the backlog.
State
Wont Do
This ticket has been decided it wont be done. This may mean the bug has been determined to not be real (cant verify) or the feature is one we have decided we dont want to adopt.
Type
Automation
Any edits or discussion about the AI automated coding system.
Type
Bug
Something that doesnt work as intended.
Type
Discussion
Anytime a ticket represents a discussion about a subject and doesnt fall into one of the other categories.
Type
Documentation
An error or improvement needed in the documentation.
Type
Epic
Any first tier epic. That is, an epic which contains only issues as children and will not have sub-epics.
Type
Feature
Some new functionality not present.
Type
Legendary
A type of Epic which will contain other Epics.
Type
Refactor
A code change that restructures existing code without changing its external behavior.
Type
Support
Someone needs help using the project.
Type
Task
A generic task that doesnt fit into the other type categories.
Type
Testing
Work exclusively focusing on fixing or expanding testing.
Projects
Clear projects
No project
Assignees
aditya (Aditya Chhabra)
aleenaumair (Aleena Umair)
brent.edwards (Brent Edwards)
CoreRasurae (Luis Mendes)
drew (Drew Morris)
eugen.thaci (Eugen Thaci)
freemo (Jeffrey Phillips Freeman)
HAL9000 (HAL 9000)
HAL9001 (HAL9001)
hamza.khyari (Hamza Khyari)
hurui200320 (Rui Hu)
justin.morris
khird (Kyle Hird)
org.cleveragents
Clear assignees
Notifications
Due Date
No due date set.
Blocks
#10874 fix(plan): executor overwrites error_details destroying strategy_decisions_json and hardcodes mode as stub
cleveragents/cleveragents-core
Reference: cleveragents/cleveragents-core#10945
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "bugfix/executor-error-details-overwrite"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes three bugs in
PlanExecutor._run_execute_with_stub(now renamed_run_execute_with_actor):Changes
type(self._execute_actor).__name__instead of hardcoded"stub"_run_execute_with_stub→_run_execute_with_actorTesting
Closes #10874
da216fc09dto9b8d98848atest
Code Review Report - PR #10945 (bugfix/executor-error-details-overwrite)
Related Issue: #10874 (#10874)
Branch: bugfix/executor-error-details-overwrite onto master
Commit: 9b8d9884 fix(plan): preserve strategy_decisions_json in error_details during execute and report actual actor mode
Summary
This PR correctly addresses the three bugs described in #10874:
The merge pattern (dict(old).update(new)) is applied consistently in both the success and failure paths of _run_execute_with_actor. The mode field now correctly reports the actual actor class name.
Two global review cycles were performed covering: bugs, test quality, naming consistency, performance, and security. Below are all findings organized by category and severity.
FINDINGS
BUG: _build_decisions swallows unexpected errors in bare except clause
Severity: Medium | Category: Bug Detection (pre-existing, not introduced by this PR)
_build_decisions (lines 839-846) deserializes strategy_decisions_json and calls StrategyDecision.model_validate(d). ValidationError is caught by bare
except Exceptionat line 846, then silently falls back to parsing definition_of_done.While the fallback is intentional, bare
except Exceptionalso swallows unexpected errors (memory issues, recursion depth). Consider narrowing the exception scope to known error types (json.JSONDecodeError, pydantic.ValidationError).Location: src/cleveragents/application/services/plan_executor.py:846
Recommendation: Follow up in a related issue; out of scope for this PR but the retry path depends on _build_decisions.
TEST FLAW: Feature file section headers still reference obsolete _run_execute_with_stub naming
Severity: Low | Category: Naming Consistency
The plan_executor_coverage.feature file has 5 locations still referencing _run_execute_with_stub (the section comment at line 333, and scenario titles at lines 336, 344, 352, 361). The step-comment in plan_executor_coverage_steps.py:906 was correctly updated. Feature file should be updated for consistency.
Location: features/plan_executor_coverage.feature:333-368
TEST FLAW: Failing-execute mock uses bare MagicMock without spec
Severity: Low | Category: Test Quality / Fragility
In executor_error_details_steps.py line 138, the failing-execute scenario creates a bare MagicMock() without spec. The succeeding-execute scenario (line 119) correctly uses MagicMock(spec=ExecuteStubActor). Inconsistent approach means the failing scenario would silently pass even if ExecuteStubActor's execute() signature changes. Both should use spec.
Location: features/steps/executor_error_details_steps.py:138
TEST: New feature has no orchestration entry point
Severity: Low | Category: Test Quality
features/executor_error_details.feature uses the @executor-error-details tag with steps in features/steps/ (Behave auto-loads). No master/conductor feature or entry point references this new feature. It may be missed by orchestration/test-runner tools. Consider adding it to a master feature if applicable.
Location: features/executor_error_details.feature
NAMING: Docstring wording imprecise
Severity: Low | Category: Naming Consistency
Line 1012 docstring says "Execute using the configured execute actor with optional retry." The retry is specifically controlled by error_recovery.max_retries. No functional impact.
Location: src/cleveragents/application/services/plan_executor.py:1012
PRE-EXISTING: _run_execute_with_runtime still uses old dict-literal pattern
Severity: Low | Category: Code Consistency (pre-existing)
_run_execute_with_runtime (lines 924-1006) still uses
plan.error_details = {key: value}at lines 956 and 999, which does NOT preserve prior error_details. For full consistency, runtime mode should also use the merge pattern. Out of scope for this PR but worth tracking.Location: src/cleveragents/application/services/plan_executor.py:956, 999
NOT FOUND (verified across 2 global cycles)
All 6 review findings have been addressed across the 3 commits:
except Exceptionin_build_decisions(json.JSONDecodeError, ValidationError)_run_execute_with_stubspec=ExecuteStubActorErrorRecoveryService.max_retries_run_execute_with_runtimeuses dict-literal (inconsistent)features/*.featurefilesAll 71 related scenarios pass (55 executor coverage + 4 new error_details + 12 error recovery). Lint and typecheck clean.
— @hamza.khyari
3be2e3d933toa18b4da775Review Summary -- PR #10945
Closes #10874: Fix three bugs in PlanExecutor error handling during execute phase.
Issue verification:
10-Category Checklist Results:
CORRECTNESS --
SPECIFICATION ALIGNMENT --
TEST QUALITY --
TYPE SAFETY --
READABILITY --
PERFORMANCE --
SECURITY --
CODE STYLE --
DOCUMENTATION --
COMMIT AND PR QUALITY --
Non-blocking observations:
Verdict: APPROVED -- All three bugs correctly fixed, tests adequately cover changes, CI green, no blocking issues.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Review Summary for PR #10945 — fix(plan): preserve strategy_decisions_json in error_details (#10874)
Issues:
All three bugs reported in #10874 are correctly fixed:
error_details merge — Previously plan.error_details = {...} replaced the entire dict, destroying strategy_decisions_json stored by run_strategize. Now the code does existing = dict(plan.error_details or {}); existing.update({...}); plan.error_details = existing, preserving stored strategy decisions across the execute phase.
Actual actor mode — Previously mode: "stub" was hardcoded in 3 places. Now mode reflects type(self._execute_actor).name, so LLMExecuteActor, ExecuteStubActor, etc. are accurately reported.
Method rename — _run_execute_with_stub to _run_execute_with_actor correctly reflects that the method runs whatever actor is configured, not just the stub.
Review checklist results:
Suggestion (non-blocking):
_run_execute_with_runtime still uses replacement (not merge) for error_details. This means plans executed in runtime mode with a prior strategize phase will also lose strategy_decisions_json. This is a pre-existing issue separate from this PR but worth following up on.
Verdict: APPROVED - All blockers fixed, all checklist categories pass, CI is fully green (14/14 passing).
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
a18b4da775to86e1cdf6aeRe-Review of PR #10945
Issue #10874: executor overwrites error_details destroying strategy_decisions_json and hardcodes mode as stub.
Prior feedback status: No REQUEST_CHANGES reviews with comments found. Full review conducted.
All three bugs from issue #10874 fixed:
Review against checklist:
CI: All 14 checks passing.
Verdict: APPROVED
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Summary
Reviewed PR #10945 (
fix(plan): preserve strategy_decisions_json in error_details during execute and report actual actor mode). This is a clean, well-scoped bug fix addressing issue #10874.Issues addressed:
Overwrites error_details entirely — Fixed. Both the success path (line 1046 area) and the failure path (line 1115 area) now merge error_details via
dict(existing).update({...})instead of outright replacement.strategy_decisions_jsonis preserved.Hardcodes mode as "stub" — Fixed. All three occurrences (lines 1049, 1113, 1122) replaced with
type(self._execute_actor).__name__. The log message was also cleaned up (removed the parenthetical "(stub)").Method misnamed — Fixed.
_run_execute_with_stubrenamed to_run_execute_with_actoreverywhere. No residual references in any Python file.Test quality:
4 new Behave BDD scenarios across two scenarios per execute path (success/failure), verifying both preservation of
strategy_decisions_jsonand actual-mode reporting. Step definitions are well-structured with clear Gherkin naming using theeedprefix for readability. Good use of mocks for the lifecycle service and execute actor.CI:
All 14 CI checks pass (lint, typecheck, security, unit_tests, integration_tests, e2e_tests, coverage, build, docker, helm, status-check). All green.
Overall:
Acceptable with minor suggestions below. No blocking issues.
@@ -331,3 +331,3 @@# ------------------------------------------------------------------# PlanExecutor._run_execute_with_stub - error recovery / retry# PlanExecutor._run_execute_with_actor - error recovery / retryNon-blocking: Comment still references
_run_execute_with_stub(line 333:# PlanExecutor._run_execute_with_stub - error recovery / retry). Consider updating to_run_execute_with_actorfor consistency, though this is a comment so not blocking. Suggestion: update for documentation clarity.This PR is a clean, well-scoped bug fix addressing issue #10874. All three reported issues are correctly resolved:
CI: All 14 checks passing. 4 new Behave scenarios cover both success and failure execution paths.
Non-blocking suggestion: update the leftover comment in plan_executor_coverage.feature (line 333) that still references the old method name.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Re-Review Summary -- PR #10945
Closes #10874: Fix three bugs in PlanExecutor error handling during execute phase.
Prior Feedback Resolution
All 6 findings from CoreRasurae REQUEST_CHANGES review have been addressed:
except Exception→Narrowed ✅ Changed to(json.JSONDecodeError, ValidationError)_run_execute_with_stubupdated toactorspec=on mock ✅ AddedMagicMock(spec=ExecuteStubActor)ErrorRecoveryService.max_retries_run_execute_with_runtimeFull Review Checklist
1. CORRECTNESS ✅ — All 3 bugs fixed across all 4 code paths (runtime success/failure, actor success/failure). Merge pattern handles None initial state.
2. SPECS ALIGNMENT ✅ — error_details is shared state across phases; preserving it during execute is correct per spec.
3. TEST QUALITY ✅ — 4 new BDD scenarios cover success/failure × preservation/mode. All 71 scenarios pass (55 + 4 + 12).
4. TYPE SAFETY ✅ — Fully annotated. No
# type: ignore.dict[str, Any] | Nonetypes correct.5. READABILITY ✅ — Merge pattern is clear and idiomatic. Method rename is accurate.
6. PERFORMANCE ✅ — Shallow dict copy of a few string fields. No new allocations or loops.
7. SECURITY ✅ — No new secrets, injection vectors, or unsafe patterns.
8. CODE STYLE ✅ — SOLID principles followed. Consistent with existing patterns. ruff compliant.
9. DOCUMENTATION ✅ — Method docstring expanded. Step file has module-level docs.
10. COMMIT AND PR QUALITY ✅ — 3 atomic commits. First line matches Metadata exactly. Labels, milestone, and dependency direction all correct.
CI Status
14/14 checks passing: lint, typecheck, security, unit_tests, integration_tests, e2e_tests, coverage, build, docker, helm, push-validation, quality, status-check, benchmark-publish.
Verdict: APPROVED — All three bugs correctly fixed, all prior feedback addressed, tests adequate, CI green, no blocking issues.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker
Implementation Attempt — Tier 0: qwen — No fixes neededAnalysis completed on the merged PR:- PR state: closed, successfully merged to master- All CI checks: 14/14 passing- All review findings from CoreRasurae REQUEST_CHANGES have been addressed- Multiple APPROVED reviews present, no open REQUEST_CHANGESThe PR is already in completion state. No changes needed.---Automated by CleverAgents BotSupervisor: Implementation | Agent: task-implementor