Skip to main content

Report a notice to a session

POST 

/session/notices

Records a notice from outside Peen, such as a webhook, a CI run, or an operator, against the session named by X-Session-ID. The notice is stored with source api, sent to live clients as a notice.created feed frame, and delivered to the model as quoted, untrusted data, never merged into the system prompt. This is the only REST operation that can start a turn.

delivery decides when the model sees it:

  • queue (the default) delivers it at the session's next turn or tool boundary.
  • wake also starts a turn when the session is idle and a handler for the notice's type exists at .agents/events/<type>.md in a harness layer. A handler that sets its own delivery overrides the notice's. A wake is refused, and the notice stays queued, while a turn runs or after the session reached its hourly wake limit.

Errors:

  • 400 VALIDATION_FAILED: the body is missing or malformed; type is not one to eight dot-separated lowercase segments (each a letter followed by letters or digits) of at most 128 characters; type starts with a reserved prefix (job., agent., turn.); summary is empty or longer than PEEN_MAX_EVENT_SUMMARY_BYTES (default 4096 bytes); or data encodes to more than PEEN_MAX_EVENT_DATA_BYTES (default 65536 bytes).
  • 404 SESSION_NOT_FOUND: the session does not exist.

Request​

Responses​

The notice was recorded. The body is the stored notice.

Response Headers
    X-Session-ID

    The session this response belongs to. For session-scoped requests it echoes the X-Session-ID request header; for POST /sessions/open and POST /sessions/system it is the session that was opened or created.

    X-Request-ID

    The request's correlation ID. When the request carried an X-Request-ID header holding a UUID, Peen echoes it; otherwise Peen generates a new UUID. The controller log records the same value for this request.