dsh-infini-goal: Endless Goals Need Pacing

dsh-infini-goal reworks the official DSH goal into a long-running objective with no round cap, a minimum interval, and quiet windows. This is why pacing comes before endlessness, how continuation state lives in the Session, what the model may and may not do, and what running indefinitely actually costs.

I once left a goal running overnight and came back to a stack of nearly identical turns. Each one looked, reported that nothing had changed, and immediately started another. Nothing was broken; the instruction was simply being followed at the speed of an idle agent. I had paid for a night of activity and made no progress.

DSH's official dsh-goal already handles the "keep going" part. What it does not handle is tempo. The driver starts another round the moment the agent goes idle, with nothing in between. Rounds are capped (maxGoalRounds, 256 by default), and a long goal that reaches the cap cannot resume. Recovery is the other rough edge: the official armed/disarmed state lives in the process, so restoring or forking a Session disarms it and a human has to wake it up again.

dsh-infini-goal changes those parts. It removes the round cap, writes continuation into the Session, and adds a minimum interval and quiet windows. This is written against v0.2.1. "Endless" here means no preset round count, not that a goal should run forever, and the article includes what it costs.

Fix the pacing before going endless

The official goal's weakness is not that it has a cap. It is that the cap is the only brake. Idle triggers the next round, and a round that repeats the previous conclusion looks exactly like progress to the scheduler. A limit of 256 does not slow the loop down; it decides how long the waste may last before everything stops, and it stops a genuinely long piece of work at the same moment.

So this project is not 256 replaced with infinity. It has to answer three questions at once: why the goal is still there, when the next round may start, and when it must not start at all.

Continuation lives in the Session

There is no maxGoalRounds now. roundsStarted counts the rounds that have begun and keeps counting. A goal stays active until it is completed, paused, blocked, or cleared. The formal phase has four values: active, paused, blocked, complete. cleared is not a fifth one. Clearing appends a tombstone, the current goal becomes null, and the round counters go back to zero.

Every change is an ignorable plugin:infini-goal/change Session plugin record. Replay checks the version, the fields, the allowed transitions, the goal id and revision, the round sequence, and the timestamps; it does not accept whatever JSON happens to be in the log as the current state. Automatic rounds carry a source, and roundsStarted only advances when that source matches the current goal and revision. The records travel with the Session through resume, fork, and transport. The browser reads the same infiniGoal projection, so the status bar and the driver cannot quietly disagree.

Durable active makes "continue after recovery" the default. It has a side effect: a forked child carries the goal history and keeps going too. Pause before forking if that is not what you want. A deployment can set autoContinueOnStart to false; existing active goals are then durably paused at startup or Agent creation and wait for a human resume. Durable is the important word — it is written to the log, not just held in memory.

A minimum interval and quiet windows

The first brake is minIntervalMs: two automatic rounds must start at least that far apart. One minute by default; the accepted range is a second to thirty days. The first round does not wait. It starts when the agent is idle and no quiet window is in the way; later triggers count from the previous start. This is aimed squarely at the reply-then-trigger-again loop. It does not know whether a round made progress.

The second brake is quietWindows, written in local wall time, with IANA time zones, ISO weekdays, and midnight crossing. The weekday filter applies to the day the window starts. Start is inclusive, end is exclusive. Windows form a union. A configuration that covers every local hour and would therefore never allow an automatic round is rejected.

Deployment defaults along these lines give a one-minute floor, no automatic rounds between 22:00 and 06:00, and Asia/Shanghai as the zone:

- id: infini-goal
  name: '@yankeguo/dsh-infini-goal'
  config:
    defaultMinIntervalMs: 60000
    defaultQuietWindows:
      - days: [1, 2, 3, 4, 5, 6, 7]
        start: "22:00"
        end: "06:00"
    timezone: Asia/Shanghai

A quiet window gates automatic triggers only. It does not suspend the Session: messages, tools, and status all work, and ordinary conversation is not blocked. During the window the goal is still active; the next trigger is pushed to the end of the window, which is a different state from paused or blocked. When the window ends, the schedule picks up again.

Three tools, and none of them owns the goal

The model sees three tools. get_infini_goal reads the goal and the next trigger plan, create_infini_goal creates one, and update_infini_goal edits, configures, pauses, resumes, completes, or blocks. A person can skip the model entirely with /infini-goal:

/infini-goal Fix every failing documentation check and keep CI green
/infini-goal interval 10m
/infini-goal quiet "Mo-Fr 22:00-06:00"
/infini-goal timezone Asia/Shanghai
/infini-goal status
/infini-goal pause
/infini-goal resume

The InfiniGoalBar above the composer shows phase, objective, round count, and either the interval or the quiet-wait, with pause, resume, and clear beside it. The buttons only submit the matching command. The interface reads a Session projection and there is no separate privileged Remote API. A completed or missing goal renders no bar at all.

Authority took the most thought. Creating a goal, editing it, changing its pacing, pausing, and resuming all require a direct human message in the current turn. The check reads Session events and root-agent identity, not the model's claim that it was allowed. complete and blocked have one extra source: an automatic round of the current goal can authorize them, so a long run can end itself. An automatic blocked report also has a default threshold of at least three rounds; a human block is not limited by it. The model cannot start or rewrite a goal on its own. Within the continuation it has already been given, it can report that the goal is done or stuck.

How it sits next to dsh-goal

The names do not collide. The official system uses get_goal, /goal, and GoalBar; this one uses *_infini_goal, /infini-goal, and InfiniGoalBar. Technically they can be installed together. The main bundle, by default, leaves only infini-goal as the goal interface.

Installing it adds five infini-goal rows and an ordinary bundle disable layer. The layer stops the official round driver and status bar, and filters the official command and tools out of the shipped agent presets. It does not copy a preset snapshot and it does not write a global patch into the profile. Every row can be toggled individually on the Plugins page; disable the whole bundle and the official goal comes back. The standalone @yankeguo/dsh-disable-goal-bundle is still there for profiles that only want the official goal off, without the rest. Do not run both bundles at once.

Install and compatibility

Install the main bundle into the desktop profile:

dsh plugin --profile desktop add @yankeguo/dsh-infini-goal-bundle

The project is yankeguo/dsh-infini-goal on GitHub, and the npm package is @yankeguo/dsh-infini-goal-bundle. This article covers v0.2.1, released under the MIT license. The plugins declare DSH >=0.2.2-rc.1 <0.3.0, and the status bar renders in the Web UI provided by the desktop app or dsh web.

v0.2.1 itself changed the release pipeline and the display metadata: staged publishing, plus Chinese and English descriptions for all eight packages. Functional behaviour is the same as 0.2.0, so what follows describes the current surface rather than a list of 0.2.1 features.

The bill, and the sharp edges

Every automatic round is a normal model turn, and it spends real tokens and quota. The minimum interval lowers the rate; it does not cap the total and it does not promise that a round is worth running. Once the round limit is gone, a verifiable objective, a clear completion condition, and a decision about when to pause matter more than any parameter.

Each Session has exactly one infini-goal, and the goal and its rounds belong to that Session. There is no sharing or aggregation across Sessions. Restore and fork continue by default, which is a thing to manage rather than enjoy: pause first if a fork would duplicate execution. The countdown in the status bar is computed locally each second and may drift visibly; the driver decides the actual trigger.

Quiet windows use the configured local time zone rather than an implicit server clock. They follow wall time across daylight saving, and the conservative envelope around a repeated wall time can extend a window by about an hour. Last, logs written by 0.1.0 are not migrated to the current plugin-record format. They need the documented one-time repair; it is not a detail to defer, because those Sessions will refuse to be interpreted.

When it is worth letting a goal continue

If a task fits in one turn, ordinary conversation is enough. If it needs a fixed number of follow-ups, the official goal's round cap is a simpler budget.

dsh-infini-goal fits the other case: the objective genuinely needs continued work, the completion condition is clear, and I still want pause, resume, and quiet hours. I do not read "endless goal" as removing the human. It removes an arbitrary round number and makes why to continue, when to continue, and when to stop explicit state. Running forever is the capability. Waiting, recovering, and being stoppable are what make it usable for long work.