babalae/better-genshin-impact · error · Exception

路径追踪任务未完全走完,判定失败,触发异常!

Error message

路径追踪任务未完全走完,判定失败,触发异常!

What it means

Thrown after a Pathing task completes without reaching SuccessEnd, but only when the AutoRestart feature is enabled AND IsPathingFailureExceptional is true. This converts a soft pathing failure (the route didn't fully complete) into a hard exception so the auto-restart loop can trigger recovery. The interpolation of braces in the message is a bug — the string uses {pathingTask.SuccessEnd} without $ prefix interpolation in some builds.

Source

Thrown at BetterGenshinImpact/Core/Script/Group/ScriptGroupProject.cs:255

                return;
            }
            var pathingTask = new PathExecutor(CancellationContext.Instance.Cts.Token);
            pathingTask.PartyConfig = GroupInfo?.Config.PathingConfig;
            if (pathingTask.PartyConfig is null || pathingTask.PartyConfig.AutoPickEnabled)
            {
                TaskTriggerDispatcher.Instance().AddTrigger("AutoPick", null);
            }
            await pathingTask.Pathing(task);

            
            executionRecord.IsSuccessful = pathingTask.SuccessEnd;
            OtherConfig.AutoRestart autoRestart = TaskContext.Instance().Config.OtherConfig.AutoRestartConfig;
            if (!pathingTask.SuccessEnd)
            {
                TaskControl.Logger.LogWarning($"此追踪脚本未正常走完!");
                if (autoRestart.Enabled && autoRestart.IsPathingFailureExceptional && !pathingTask.SuccessEnd)
                {
                    throw new Exception($"路径追踪任务未完全走完,判定失败,触发异常!");
                }
            }

            if (task.FarmingInfo.AllowFarmingCount)
            {
                var successFight = pathingTask.SuccessEnd;
                var fightCount = 0;
               
                //未走完完整路径下,才校验打架次数
                if (!successFight)
                {
                    fightCount = task.Positions.Count(pos => pos.Action == ActionEnum.Fight.Code);
                    successFight = pathingTask.SuccessFight >= fightCount;
                    //判断为锄地脚本
                    if (task.FarmingInfo.PrimaryTarget!="disable")
                    {

                        if (autoRestart.Enabled

View on GitHub (pinned to a7cb36712d)

Solutions

  1. If you don't want auto-restart on pathing failure, disable IsPathingFailureExceptional in OtherConfig.AutoRestartConfig.
  2. Improve the pathing JSON route to handle obstacles or add waypoints.
  3. Ensure the game window is focused and unobstructed before running pathing tasks.
  4. Catch this exception at the scheduler level to implement custom recovery logic.
Defensive patterns

Strategy: try-catch

Try / catch

try
{
    await project.Run();
}
catch (Exception ex) when (ex.Message.Contains("路径追踪任务未完全走完"))
{
    TaskControl.Logger.LogWarning("Pathing failed, handling recovery: {Message}", ex.Message);
    // Implement custom recovery: retry, skip, or notify user
}

Prevention

When it happens

Trigger: Executing a Pathing-type ScriptGroupProject where the PathExecutor.Pathing(task) call completes but pathingTask.SuccessEnd is false, and the user's config has OtherConfig.AutoRestartConfig.Enabled=true and IsPathingFailureExceptional=true.

Common situations: Character got stuck during automated pathing, encountered an unexpected obstacle, or the route was interrupted. The game state changed (teleport, combat interruption) preventing full route completion. This is a deliberate design choice to make pathing failures restart-worthy.

Related errors


AI-assisted analysis of babalae/better-genshin-impact@a7cb36712d (2026-08-13). Data as JSON: /api/errors/a2803d285ccc71a8. Report an issue: GitHub.