AgentSession

Record the outcome of reviewing a finished test-authoring session

Records what the user decided about a finished test_authoring session, flipping it to the reviewed outcome: accepted when they kept the authored work, closed when they discarded it. A status write only, unless the caller opts into delete_test alongside closed — see that field. Nothing is ever deleted implicitly, and no branch is deleted at all. Valid for creation and edit sessions alike. Granted only from completed or needs_attention, enforced inside the write transaction; every other status is a 409, including an already-reviewed session, so a repeated call is rejected rather than silently succeeding. Session-level like merged (the cloud instance keeps its own status) and terminal: a reviewed session cannot be resumed, reviewed again, spawned on, or have its status rewritten through updateAgentSession. The conversation is retained either way, so a closed task can be regenerated from it.

post/agentSession/{id}/review

Path parameters

idstring required

The ID of the agent session

Request body

outcome'accepted' | 'closed' required

What the user decided about a finished authoring task. accepted keeps the authored work; closed discards the task. Neither deletes anything on its own; a caller closing a task can additionally ask for its test to be deleted via delete_test. Both are terminal session-level statuses — see AgentInstanceStatus, whose values these mirror.

delete_testboolean

(Optional) Delete the test this session saved, as part of closing it. Valid only with the closed outcome; sending it with accepted is a 400. The caller must hold write access to journeys in the session's workspace, the same permission deleting the test directly would need. The test is identified from the session (startup_params.test_id, else its one remote Test artifact) rather than named by the caller, and only a test the session itself authored is deletable — established from authoring_mode and from the test having been created after the session began, either of which refusing on its own. A session with no saved test, several with nothing to single one out, or one it did not author, and a test that cannot be deleted, are each a 409 with nothing closed — as is the session itself changing between the target being resolved and the close. The TEST is deliberately not version-pinned: a concurrent edit to it does not block the deletion, which removes the test rather than a particular version of it. Nothing else is deleted — flows cascade as they do for any test deletion, and the branch is untouched.

Response

The agent session, now holding the reviewed outcome

idstring required

The id of the agent session

workspace_idstring required

The id of the workspace

created_timeinteger required

The timestamp of the agent session creation in epoch milliseconds

created_by_idstring required

The id of the user who created the agent session

last_updated_timeinteger required

The timestamp of the agent session last update in epoch milliseconds

last_updated_by_idstring required

The id of the user who last updated the agent session

agent_type'test_authoring' | 'test_creation_planning' | 'test_planning' | 'agent_review' | 'app_summary' | 'test_run_analysis' | 'test_recovery' | 'runtime_recovery_summary_agent' | 'plan_run_analysis' | 'deployment_analysis' | 'workspace_results_analysis' | 'results_auto_analysis' | 'workspace_assistant' | 'app_modeling' | 'app_modeling_run' | 'file_assertion' | 'test_impact' | 'test_impact_shadow' | 'repair_notes' required
is_trialboolean required

Whether this agent session is associated with a trial account

parent_session_idstring

The id of the parent agent session

initiating_request_idstring

A unique identifier for the request that initiated this agent session. If set, this must be globally unique and requests to create a new agent session with the same initiating_request_id will fail.

instance_idsstring[]

IDs of all cloud instances created for this session (in chronological order). Empty for local-client-driven sessions.

instance_type'cloud' | 'local'

Indicates what kind of agent instance is driving a session. cloud means a server-managed cloud instance owns the lifecycle (created via the cloudInstance endpoints). local means a local client (e.g. mabl CLI) is driving the session via updateAgentSession.

latest_instance_status'queued' | 'running' | 'needs_attention' | 'completed' | 'failed' | 'terminated' | 'terminating' | 'rate_limited' | 'skipped' | 'merged' | 'accepted' | 'closed' | 'resuming' | 'none'

The status of the latest agent instance driving a session. The same enum is used for cloud and local instances. Cloud-only values (queued, terminating, rate_limited, skipped) are set by the cloud instance lifecycle (start/terminate/end). Common values (running, needs_attention, completed, failed, terminated) are written by either cloud or local clients. merged is a session-level state applied after a completed authoring task's branch is merged into master (via the branch merge endpoint or the session's auto_merge setting); the underlying cloud instance stays completed. accepted and closed are session-level review outcomes for a finished authoring task, set only through the review endpoint; the underlying cloud instance keeps its own status. accepted records that the user kept the authored test. closed records that the user discarded it; the session's test is left in place unless the caller asked for it to be deleted (delete_test on the review request), no branch is deleted either way, and the session's conversation is retained so the task can be regenerated from it. Both are terminal in the same sense as merged — neither is resumable, and no lifecycle transition leaves them. resuming is a transient, server-set-only state on the session (no instance holds it) — the cloud TAA continuation flow flips a resumable session to resuming while it plans the answer, then to queued when the new instance spawns (or back to a resumable status on re-clarification, or failed on error). It is the concurrency guard, so a second answer to a resuming session is rejected. The session's instance_type field indicates which kind of instance owns the session. Use none in query parameters to match sessions without any status.

latest_termination_reason'execution_timeout' | 'stop_requested' | 'infra_shutdown' | 'dispatch_failed' | 'agent_stalled' | 'agent_error' | 'unknown'

The reason for terminating a cloud instance. 'infra_shutdown' covers any shutdown signal from the runtime environment (K8s pod eviction, Cloud Run instance cycling, etc.) — kept generic so it applies regardless of where the agent runs. 'dispatch_failed' means the instance never started — its start message failed to publish, or expired in the queue before any runner claimed it. 'agent_stalled' means the agent was still alive but stopped making progress, so a watchdog hard-killed it. 'agent_error' means the agent threw or exited unexpectedly while its work was still in flight.

agent_variantstring

The authoring-agent arm assigned to this session at creation time (values: generic or flexible). Records which test-authoring agent variant the runtime should use for the session. Only set for test_authoring sessions; unset for other agent types.

Changes

Changed in 8 of the 32 revisions of this API.613

    • ○

      added the optional property ///// to the response with the status

      response-optional-property-added

    • ○

      added the optional property ///// to the response with the status

      response-optional-property-added

    • ○

      added the optional property ///// to the response with the status

      response-optional-property-added

    • ○

      added the new optional request property

      new-optional-request-property

    • ○

      added the optional property ///// to the response with the status

      response-optional-property-added

  • 20cf4d2e9cb011See the full diff
    • ●

      added the new workspace_scope_changed enum value to the /////// response property for the response status

      response-property-enum-value-added

    • ○

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

      response-property-any-of-added

  • ae1104aba49e21See the full diff
    • ●

      added the new test_impact_shadow enum value to the response property for the response status

      response-property-enum-value-added

    • ●

      added the new test_impact_shadow enum value to the / response property for the response status

      response-property-enum-value-added

    • ○

      added to the response property anyOf list for the response status

      response-property-any-of-added

  • daadc556ff0d13See the full diff
    • ●

      added the new PlanRun enum value to the ////// response property for the response status

      response-property-enum-value-added

    • ○

      added the media type application/json for the response with the status

      response-media-type-added

    • ○

      added the optional property ///// to the response with the status

      response-optional-property-added

    • ○

      added the optional property ///// to the response with the status

      response-optional-property-added

  • e5b6d95d50a122See the full diff
    • ●

      added the new AgentSession enum value to the ////// response property for the response status

      response-property-enum-value-added

    • ●

      added the new DeploymentEvent enum value to the ////// response property for the response status

      response-property-enum-value-added

    • ○

      added the optional property ////// to the response with the status

      response-optional-property-added

    • ○

      added the optional property ///// to the response with the status

      response-optional-property-added

    • ○

      endpoint added

      endpoint-added