Set the session's goal, replacing any existing one [write]

Changed on

Work starts immediately — no separate message is needed, and sending one is not how a goal begins. Criteria are optional: omitted, they are derived from the objective so completion is always judged against an explicit list, which the response returns and PATCH can correct. A criterion given as { text, command } is decided by running the command in the session's workspace (exit 0 = met) instead of by the grader. A person's message always outranks the loop: while a turn is running the goal waits, and takes the turn after it. Grading is a model call billed to the session; with an empty wallet deriving criteria is refused with 402 insufficient_credits. Setting a goal stops the run the goal it replaces had started.

post/sessions/{id}/goal

Request

  • Base URL
    https://api.agentsky.dev/v1
  • URL
    https://api.agentsky.dev/v1/sessions/{id}/goal
  • Auth
    HTTP bearer

Path parameters

idstring required

The session id

Headers

Idempotency-Keystring

Dedupes a retry of this mutation. The same key with a different body is refused with 409 idempotency_conflict.

Request body

objectivestring required

What the agent should work toward, in the user's words

max_iterationsinteger nullable

Self-started turns this goal may take before it stops. Omitted = 20; null = no iteration ceiling

max_no_progressinteger nullable

Consecutive turns without a tool call before stopping. Omitted = 3; null = no no-progress ceiling

max_tokensinteger nullable

Token ceiling for this goal: uncached input plus output, counted from the goal's start

max_duration_minutesinteger nullable

Wall-clock ceiling from the goal's start, extended by any time it spends paused

Response

Created

Changes

    • breaking

      added to the / response property oneOf list for the response status

    • breaking

      the / response's property type changed from object to no type for status

    • warning

      removed the optional property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • info

      added the new optional request property

    • info

      request property list-of-types was widened by adding types null to media type application/json

    • info

      added the optional property / to the response with the status

    • info

      added to the / response property allOf list for the response status

    • info

      removed subschema #1 from the / response property oneOf list for the response status