*** Settings ***
Documentation    Regression test for issue #1025 (plan correct auto-resolve)
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}    ${CURDIR}/helper_plan_correct_isolated_resolve.py

*** Test Cases ***
Plan Correct Auto Resolves Active Plan In Isolated Environment
    [Documentation]    Verify ``plan correct`` resolves active plan without ``--plan``
    ...                when subprocess-like invocations share CLEVERAGENTS_HOME but
    ...                run from different working directories.
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    cwd=${WORKSPACE}    timeout=120s    on_timeout=kill
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    issue-1025-plan-correct-isolated-resolve-ok
