--- name: erp-session-runtime description: Use when an authorized ERP task needs login, human captcha completion, live-session continuity, condition-based waiting, or safe browser/profile recovery. --- # ERP Session Runtime ## Role This Skill handles session state around ERP execution. It does not decide the business route, create a task, or repeat a save after a login redirect. It coordinates the existing session guard, live-session manager, task lock, and interactive-login tools. ## Login and captcha If the ERP page requires login, pause the business operation and ask the operator to complete the captcha and login in the same exact ERP automation window. Keep the shared browser context/session alive so the already authorized task can continue after the page becomes ready. Never permit cookie copy, bypass captcha, inject a cookie, or fabricate a logged-in state. After human login, verify the target protected ERP page and the main workspace, not just a page title or branding string. A login page after submit is a session failure, not evidence that the order failed or succeeded; reconcile task/registry state before retrying. ## Waiting and continuity Use condition-based waits such as waitForCondition and existing session readiness checks. Wait for the required form fields, ERP functions, success evidence, and protected-page state. Do not use fixed sleep 200 or another arbitrary fixed sleep as a proof that a slow ERP page is ready. Use the configured shared live session and task lock. Do not start a second Chrome profile against the same live profile. Keep the same window/context when the operator completes login. ## Safe recovery When the exact automation window has been closed by the operator and the session manager reports a recoverable startup condition, allow one bounded retry. Revalidate the task and duplicate state before that retry. Do not retry an uncertain submit merely because a browser was reopened. For profile-lock conditions, identify the exact profile owner and follow the session manager's safe close/reconnect path. Never kill Chrome globally and never delete SingletonLock or a profile-lock file as a shortcut. If the owner cannot be established, return blocked and escalate. ## Result mapping - login required: pause and request same-window human login. - session ready: continue the existing task under the shared lock. - recoverable exact-window closure: one retry after revalidation. - login redirect after save or ambiguous submit: use execution_uncertain and reconcile before retry. - persistent lock, browser closure, or unknown page: blocked with the operator action required.