Explicit, durable session goals. Only the slash/SDK user path creates or replaces an objective. The model can mark the active objective complete or blocked, but cannot resume, replace, cancel or increase its budget. Every mutation is a CAS on the persisted revision. A goal has no history and no reason: the transcript holds the earlier goals and the replies that explain each status. Completion is a model declaration supported by evidence, not an independent judge.
Explicit, durable session goals. Only the slash/SDK user path creates or replaces an objective. The model can mark the active objective complete or blocked, but cannot resume, replace, cancel or increase its budget. Every mutation is a CAS on the persisted revision. A goal has no history and no reason: the transcript holds the earlier goals and the replies that explain each status. Completion is a model declaration supported by evidence, not an independent judge.
(account! env started-goal usage)Attribute one loop response to the goal/version current when its request started. Includes empty/prose responses and the response whose tools complete the goal. Provider retries inside that request are not separate loop iterations. Tokens are statistics only. Active wall time includes tool execution.
Attribute one loop response to the goal/version current when its request started. Includes empty/prose responses and the response whose tools complete the goal. Provider retries inside that request are not separate loop iterations. Tokens are statistics only. Active wall time includes tool execution.
(check-goal env)(check-goal db sid)Internal read of the authoritative goal. Model readers use session['goal_status'].
Internal read of the authoritative goal. Model readers use session['goal_status'].
(context env)The goal key of the model session view, from one read of the goal. The model sees only the status: the objective is in the transcript, where the user set it.
The goal key of the model session view, from one read of the goal. The model sees only the status: the objective is in the transcript, where the user set it.
(continuation-prompt env)Neutral next-iteration input after an accepted progress reply while a goal remains active.
Neutral next-iteration input after an accepted progress reply while a goal remains active.
(control! db sid action)User-only pause/resume/cancel/clear. Resume never resets usage or expands a budget. Clear forgets the goal: it stops goal work, leaves model context, and clients hide it. The goal stays as a cleared record, because clients keep the highest goal revision that they saw. Clear is idempotent.
User-only pause/resume/cancel/clear. Resume never resets usage or expands a budget. Clear forgets the goal: it stops goal work, leaves model context, and clients hide it. The goal stays as a cleared record, because clients keep the highest goal revision that they saw. Clear is idempotent.
(finish-turn! env started-goal status)A cancelled or failed turn pauses only the goal/version it started with. The turn error in the transcript tells why it stopped.
A cancelled or failed turn pauses only the goal/version it started with. The turn error in the transcript tells why it stopped.
(halt-result env started-goal)Stop outstanding goal work at a request or tool boundary, without starting a model call.
Stop outstanding goal work at a request or tool boundary, without starting a model call.
(request-halt-result env started-goal)Enforce iteration budgets after the previous tools finish. A completed or blocked goal does not halt: the next model request writes the final reply. User stops and replacements still win.
Enforce iteration budgets after the previous tools finish. A completed or blocked goal does not halt: the next model request writes the final reply. User stops and replacements still win.
(resume-for-user-turn! env)Resume an existing paused/blocked goal for a new user message. Preserve usage and budget; no goal, exhausted or terminal goals and newer user controls are unchanged. The caller must exclude synthetic wakes, command-only turns and cancelled turns.
Resume an existing paused/blocked goal for a new user message. Preserve usage and budget; no goal, exhausted or terminal goals and newer user controls are unchanged. The caller must exclude synthetic wakes, command-only turns and cancelled turns.
(set-goal! db sid objective iteration-budget)Explicit user mutation. Replacing a goal creates a new identity and resets usage.
Explicit user mutation. Replacing a goal creates a new identity and resets usage.
(slash! ctx)Parse /goal with --budget N before or after the objective, or --pause/--resume/--cancel/--clear. N is in loop iterations. A leading -- on the objective preserves all following text. Accept iOS smart dashes in recognized flags, without rewriting the objective. Parse raw text so quotes and newlines in the user's objective stay intact.
Parse /goal with --budget N before or after the objective, or --pause/--resume/--cancel/--clear. N is in loop iterations. A leading -- on the objective preserves all following text. Accept iOS smart dashes in recognized flags, without rewriting the objective. Parse raw text so quotes and newlines in the user's objective stay intact.
(system-prompt env)The goal rules for the system prompt, or nil. Only a goal that the model sees in
session['goal_status'] adds them. A session without a goal, or with a complete,
cancelled or cleared goal, gets no goal rules: a later CLI or SDK task in that session
is an ordinary task.
The goal rules for the system prompt, or nil. Only a goal that the model sees in `session['goal_status']` adds them. A session without a goal, or with a complete, cancelled or cleared goal, gets no goal rules: a later CLI or SDK task in that session is an ordinary task.
(turn-halt-result env started-goal)Read-only stop check after a turn. Return the halt of the goal that the turn started with, or its new status when the turn completed or blocked it. A stopped goal starts no more provider work, also no title.
Read-only stop check after a turn. Return the halt of the goal that the turn started with, or its new status when the turn completed or blocked it. A stopped goal starts no more provider work, also no title.
(update-goal env status)Internal completion tool. Set the active goal to status 'complete' or 'blocked'. Complete means that every requirement is verified. Blocked means that, after the goal blocker audit, no useful authorized action remains without user input or an external change. Never lower the objective, and never mark blocked only to deliver a progress reply. The status has no reason: after the tools of this iteration finish, write the evidence or the blocker in your final reply.
Internal completion tool. Set the active goal to status 'complete' or 'blocked'. Complete means that every requirement is verified. Blocked means that, after the goal blocker audit, no useful authorized action remains without user input or an external change. Never lower the objective, and never mark blocked only to deliver a progress reply. The status has no reason: after the tools of this iteration finish, write the evidence or the blocker in your final reply.
(visible-status goal)The status of goal that a model may see, or nil when the goal directs no more work.
The status of `goal` that a model may see, or nil when the goal directs no more work.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |