跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    rwese

    Agent Loop

    v6.0.0其他
    @frugally3683/agent-loop-plugin

    Minimal Task Continuation Plugin - Automatically continues sessions when incomplete tasks remain

    GitHub 星标

    1

    月装机量

    0

    近 7 天 11

    综合评分SCORE

    3.9

    生态多维模型

    最近提交

    7 个月前

    2026-01-20

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@frugally3683/agent-loop-plugin@6.0.0"]
    }

    opencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    Minimal task continuation plugin for OpenCode - automatically continues sessions when incomplete tasks remain.

    Overview

    This plugin provides task continuation functionality:

    1. Task Continuation: Automatically continues sessions when incomplete todos remain

    Perfect for:

    • Multi-step task execution with automatic continuation
    • Long-running agent workflows
    • Preventing premature session termination
    • Ensuring all tasks in a todo list are completed

    Installation

    npm install @frugally3683/agent-loop-plugin
    

    Usage

    import agentLoopPlugin from "@frugally3683/agent-loop-plugin"
    
    export default agentLoopPlugin
    

    Configuration

    The plugin can be configured with the following options:

    {
      countdownSeconds: 2,        // Seconds to wait before auto-continuation
      errorCooldownMs: 3000,      // Cooldown period after errors
      toastDurationMs: 900,       // Toast notification duration
      agent: "custom-agent",      // Agent name for continuation prompts
      model: "custom-model",      // Model name for continuation prompts
      logFilePath: "path/to/log", // Path to log file for debugging
    }
    

    Features

    • Automatic Continuation: Sessions automatically continue when incomplete tasks remain
    • User Message Handling: Cancels pending continuations when users send new messages
    • Error Handling: Graceful handling of session errors with cooldown periods
    • Recovery Support: Sessions can be marked as recovering to pause auto-continuation

    API

    Plugin Export

    import { agentLoopPlugin, createTaskContinuation } from "@frugally3683/agent-loop-plugin"
    

    Task Continuation API

    const continuation = createTaskContinuation(input, options)
    
    continuation.handler({ event }) // Handle session events
    continuation.cleanup() // Cleanup resources
    continuation.scheduleContinuation(sessionID) // Manually schedule continuation
    continuation.markRecovering(sessionID) // Mark session as recovering
    continuation.markRecoveryComplete(sessionID) // Mark recovery as complete
    continuation.cancel(sessionID) // Cancel pending continuation
    

    License

    MIT