Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cbf28ca
docs: record API review and approved repair decisions
NoHarry Nov 7, 2026
d30a227
fix(api): correct stability markers and the Java event log factory
NoHarry Nov 7, 2026
51d6961
fix(api): preserve saved thread options and independent budgets
NoHarry Nov 7, 2026
a021bff
refactor(api): separate runtime contracts from their implementation
NoHarry Nov 7, 2026
1c69921
refactor(api): internalize unused assembly and VFS helpers
NoHarry Nov 7, 2026
002ef07
docs(api): expose named conversation error codes
NoHarry Nov 7, 2026
b058b06
fix(runtime): finalize turns after execution cleanup
NoHarry Nov 7, 2026
8a4a7e0
fix(storage): redact tool JSON without altering conversation text
NoHarry Nov 7, 2026
8a0f3a1
fix(runtime): preserve steering identity and explicit question binding
NoHarry Nov 7, 2026
c388524
fix(runtime): separate turn identities from execution attempts
NoHarry Nov 7, 2026
d966ceb
fix(storage): recover damaged history without blocking deletion
NoHarry Nov 7, 2026
9ff6b17
fix(runtime): isolate item and question ids from provider call ids
NoHarry Nov 7, 2026
b22e347
fix(runtime): continue denied approvals and close cancelled history
NoHarry Nov 7, 2026
db91093
fix(runtime): preserve copied internal request identity defaults
NoHarry Nov 7, 2026
2c87252
feat(storage): delete complete thread event logs after draining writers
NoHarry Nov 7, 2026
c285c79
feat(api): provide structured notice presentation values
NoHarry Nov 7, 2026
b568513
feat(storage): delete SQLite and reliability session artifacts
NoHarry Nov 7, 2026
52d7ab4
fix(runtime): scope remembered approvals and record their source
NoHarry Nov 7, 2026
ed2f9b6
fix(runtime): delete complete conversation data across runtimes
NoHarry Nov 7, 2026
40b4184
fix(runtime): inherit child approval policies without waiting for a user
NoHarry Nov 7, 2026
027f2c8
docs(api): complete migration guidance and identity contracts
NoHarry Nov 7, 2026
c9efda2
test(runtime): migrate approval and question contracts to thread flows
NoHarry Nov 7, 2026
cd06bad
fix(runtime): drain child work before deleting its parent thread
NoHarry Nov 7, 2026
f25600d
test(runtime): verify tool policies and images through live approvals
NoHarry Nov 7, 2026
ed3e0a0
refactor(storage): separate turn snapshots and share image blobs
NoHarry Nov 7, 2026
bdbdb4b
fix(storage): count images and reasoning in model history limits
NoHarry Nov 7, 2026
bca6284
test(runtime): migrate workspace and interrupted history to thread turns
NoHarry Nov 7, 2026
55c7f28
fix(runtime): a new approval policy applies to the turn already running
NoHarry Nov 7, 2026
3fb1211
test(runtime): session scheduling through thread turns
NoHarry Nov 7, 2026
176a1e5
fix(runtime): resuming a thread without changes does not rewrite it
NoHarry Nov 7, 2026
4001878
fix(runtime): a call left waiting for approval by an earlier run reac…
NoHarry Nov 7, 2026
e6e15d4
fix(runtime): a turn with large images no longer empties the model hi…
NoHarry Nov 7, 2026
1c0c5d4
fix(storage): one unreadable run record or a failed log write no long…
NoHarry Nov 7, 2026
1bbcf64
fix(runtime): an approval nobody answers in time lets the turn go on
NoHarry Nov 7, 2026
dd69df5
fix(runtime): a web host approved in a turn is not asked again in tha…
NoHarry Nov 7, 2026
78c8db6
fix(storage): a JSON document inside a stored tool string stays valid…
NoHarry Nov 7, 2026
b70b9b1
docs: state the measured size of the 0.5.0 public API
NoHarry Nov 7, 2026
be6f9cc
docs: record the 0.5.0 wrap-up status for the next model
NoHarry Nov 7, 2026
40b311e
fix(runtime): close the gaps the pre-push review found in the wrap-up…
NoHarry Nov 7, 2026
3e9b212
docs: record the verified 0.5.0 wrap-up, follow-ups and next steps
NoHarry Nov 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ An embeddable agent runtime for Android and the JVM. Gradle project at the repos
| `samples/` | `quickstart-jvm`, `quickstart-android`, `minimal`, `extensions` (offline; its test runs in CI) (not published) |
| `buildSrc/` | `SourceRulesTask` |
| `tools/` | Python helpers and fixtures; `agent-runtime` tests read `tools/fixtures` |
| `docs/design/` | Designs for upcoming work; read the one that matches your task before changing the public API (`public-api-redesign.md`: the Thread / Turn / Item API replacing the current one in 0.5.0; section 9.3 approved on 2026-11-06; start from `public-api-redesign-handoff.md`) |
| `docs/design/` | Designs for upcoming work; read the one that matches your task before changing the public API (`public-api-redesign.md`: the Thread / Turn / Item API replacing the current one in 0.5.0; section 9.3 approved on 2026-11-06; start from `public-api-redesign-handoff.md`, then `public-api-redesign-review.md` (fixes required before releasing 0.5.0)) |

## Rules

Expand Down
234 changes: 186 additions & 48 deletions CHANGELOG.md

Large diffs are not rendered by default.

457 changes: 339 additions & 118 deletions agent-api/api/agent-api.api

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,32 @@

package cc.noharry.agent

import cc.noharry.agent.runtime.AgentRuntimeBuilder

/** An embeddable agent. Configure a model, then start or resume a conversation. */
/**
* An embeddable agent contract available from the `agent-api` artifact.
* The `agent-runtime` artifact supplies the `builder` companion extension for Kotlin hosts (import
* `cc.noharry.agent.builder`); Java hosts use `AgentRuntimeBuilder.create()` from that artifact.
*/
interface AgentRuntime : AutoCloseable {
/**
* Starts a conversation. With storage configured this writes the thread's small metadata file before returning,
* so an Android host calls it off the main thread.
*/
fun startThread(options: ThreadOptions = ThreadOptions()): AgentThread
/**
* Reopens saved model history and visible items when storage is configured. Without storage, history lives only
* in this runtime. Non-default options update the saved defaults used by future turns.
* in this runtime. Non-default options update the saved defaults used by future turns. With storage configured
* this reads the thread's small metadata file, and writes it only when the options change, before returning; an
* Android host calls it off the main thread.
*/
fun resumeThread(threadId: String, options: ThreadOptions = ThreadOptions()): AgentThread
suspend fun listThreads(): List<ThreadInfo>
/**
* Deletes saved history and invalidates all existing handles to this conversation, even if its id is reused.
* @throws IllegalStateException if called from that thread's active turn, including its completion hook.
* @throws IllegalStateException if called from that thread's active execution. Completion hooks run after execution is released.
*/
suspend fun deleteThread(threadId: String)
val diagnostics: RuntimeDiagnostics
override fun close()

companion object {
@JvmStatic fun builder(): AgentRuntimeBuilder = AgentRuntimeBuilder.create()
}
companion object
}
20 changes: 16 additions & 4 deletions agent-api/src/main/kotlin/cc/noharry/agent/AgentThread.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ interface AgentThread {
fun runStreamed(input: TurnInput, options: TurnOptions = TurnOptions()): Flow<ThreadEvent>
suspend fun run(text: String, options: TurnOptions = TurnOptions()): TurnResult = run(TurnInput.text(text), options)
fun runStreamed(text: String, options: TurnOptions = TurnOptions()): Flow<ThreadEvent> = runStreamed(TurnInput.text(text), options)
suspend fun steer(text: String): SteerResult
/** Queues ordinary input without answering any asynchronous question. */
suspend fun steer(text: String): SteerResult = steer(text, SteerOptions())
/**
* Answers the asynchronous question whose complete [Question.id] is supplied. The question must still be pending
* in the current turn; a stale, answered, or unknown id returns QUESTION_NOT_FOUND without posting input.
* Null preserves ordinary steering behavior. Implementations without explicit binding reject non-null ids.
* Null queues ordinary input without binding it to a question.
*/
suspend fun steer(text: String, answering: String?): SteerResult =
if (answering == null) steer(text) else SteerResult.QUESTION_NOT_FOUND
steer(text, SteerOptions(answering = answering))
/** Queues input for the active turn, including while it is waiting for tool approval. */
suspend fun steer(text: String, options: SteerOptions): SteerResult
/** Requests cancellation of the current turn; keep collecting to receive its interrupted terminal result. */
suspend fun interrupt()
suspend fun status(): ThreadStatus
Expand All @@ -25,4 +28,13 @@ interface AgentThread {
suspend fun items(afterTurnId: String? = null): List<ThreadItem>
}

enum class SteerResult { ACCEPTED, NOT_RUNNING, EMPTY_INPUT, QUEUE_FULL, QUESTION_NOT_FOUND }
/**
* [requestId] identifies this input within the active turn and is echoed on [ThreadItem.UserMessage]. Repeating
* the same id with different text or question returns REQUEST_ID_CONFLICT. Null creates an id automatically.
* [answering] is a complete [Question.id]; null always means ordinary input, even with unanswered questions.
*/
data class SteerOptions(val requestId: String? = null, val answering: String? = null) {
init { require(requestId == null || requestId.isNotBlank()) { "Steering request id must not be blank" } }
}

enum class SteerResult { ACCEPTED, NOT_RUNNING, EMPTY_INPUT, QUEUE_FULL, QUESTION_NOT_FOUND, REQUEST_ID_CONFLICT }
22 changes: 22 additions & 0 deletions agent-api/src/main/kotlin/cc/noharry/agent/NoticeDetails.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cc.noharry.agent

/**
* Structured notice values for host presentation. Hosts can localize [ThreadItem.Notice] without parsing its
* English fallback message. Fields unrelated to the notice's [NoticeKind] are null.
*/
data class NoticeDetails(
/** Retry ordinal, starting at one, for [NoticeKind.RETRY]. */
val attempt: Int? = null,
/** Backoff in milliseconds for [NoticeKind.RETRY]. */
val delayMillis: Long? = null,
/** Remaining model rounds for [NoticeKind.BUDGET_LOW]. */
val roundsRemaining: Int? = null,
/** Remaining tool calls for [NoticeKind.BUDGET_LOW]. */
val toolCallsRemaining: Int? = null,
/** Provider-history message count before [NoticeKind.COMPACTION]. */
val beforeMessageCount: Int? = null,
/** Provider-history message count after [NoticeKind.COMPACTION]. */
val afterMessageCount: Int? = null,
/** Selected workspace identifier for [NoticeKind.WORKSPACE_CHANGED]. */
val workspaceId: String? = null,
)
25 changes: 25 additions & 0 deletions agent-api/src/main/kotlin/cc/noharry/agent/RuntimeDiagnostics.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@file:OptIn(cc.noharry.agent.spi.ExperimentalAgentRuntimeApi::class)

package cc.noharry.agent

import cc.noharry.agent.spi.*
import cc.noharry.agent.spi.reliability.*

/**
* Advanced diagnostic records, separate from the stable conversation API.
* Conversation queries select the latest execution attempt for `(threadId, turnId)`. Returned raw records use
* `runId` for that execution's unique id, `sessionId` for the thread id and `requestId` for the public turn id.
* [querySessionEvents] accepts these raw identifiers and can query earlier attempts using their execution ids.
*/
@ExperimentalAgentRuntimeApi
interface RuntimeDiagnostics {
suspend fun getRunState(threadId: String, turnId: String): RuntimeRunSnapshot?
suspend fun getRuntimeResult(threadId: String, turnId: String): RuntimeResult?
suspend fun getRuntimeHandoff(threadId: String, turnId: String): RuntimeHandoff?
suspend fun getRuntimeEvidence(evidenceId: String): RuntimeEvidence?
suspend fun getRuntimeTraceEvents(threadId: String, turnId: String): List<RuntimeTraceEvent>
suspend fun querySessionEvents(query: SessionEventQuery): List<SessionEvent>
suspend fun replaySessionEvents(threadId: String, turnId: String): List<SessionEvent>
suspend fun getSessionEventLogHealth(threadId: String, turnId: String): SessionEventLogHealth
fun subscribeSessionEvents(threadId: String, listener: (SessionEvent) -> Unit): AutoCloseable
}
9 changes: 8 additions & 1 deletion agent-api/src/main/kotlin/cc/noharry/agent/ThreadItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ sealed interface ThreadItem {
val input: List<InputPart>,
val steer: Boolean = false,
override val status: ItemStatus = ItemStatus.COMPLETED,
/** The steering request id supplied by the host, or generated by the runtime; null for turn input. */
val requestId: String? = null,
) : ThreadItem

data class AgentMessage(
Expand Down Expand Up @@ -46,7 +48,8 @@ sealed interface ThreadItem {
val output: String? = null,
override val status: ItemStatus = ItemStatus.IN_PROGRESS,
val network: NetworkActivity? = null,
val approvedBy: ApprovalPolicy? = null,
/** How this call was approved; null when no approval was granted or no gate was needed. */
val approvedBy: ApprovalSource? = null,
) : ThreadItem

data class WebSearch(
Expand Down Expand Up @@ -74,11 +77,13 @@ sealed interface ThreadItem {
val kind: NoticeKind,
val message: String,
override val status: ItemStatus = ItemStatus.COMPLETED,
val details: NoticeDetails = NoticeDetails(),
) : ThreadItem

data class Error(
override val id: String,
override val turnId: String,
/** A [TurnErrorCodes] or provider/tool failure code. */
val code: String,
val message: String,
val recoverable: Boolean,
Expand All @@ -88,6 +93,8 @@ sealed interface ThreadItem {

enum class ItemStatus { IN_PROGRESS, COMPLETED, FAILED, DECLINED }
enum class MessagePhase { COMMENTARY, FINAL }
/** The origin of a granted approval, independent of the thread's current approval policy. */
enum class ApprovalSource { USER, REMEMBERED, AUTOMATIC }
enum class NoticeKind { RETRY, COMPACTION, BUDGET_LOW, WORKSPACE_CHANGED }

/** Metadata about a network tool; payloads remain on the tool item. */
Expand Down
42 changes: 42 additions & 0 deletions agent-api/src/main/kotlin/cc/noharry/agent/TurnErrorCodes.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package cc.noharry.agent

/**
* Conversation-level codes returned in [TurnError] and [ThreadItem.Error]. Provider and tool failures may also use
* the codes in [cc.noharry.agent.spi.reliability.RuntimeErrorCode]. Hosts should retain a fallback for unknown codes.
*/
object TurnErrorCodes {
/** The selected model or runtime configuration does not accept image input. */
const val IMAGE_INPUT_UNSUPPORTED = "IMAGE_INPUT_UNSUPPORTED"
/** The caller interrupted an admitted turn. */
const val INTERRUPTED = "INTERRUPTED"
/** An unexpected execution failure prevented the turn from completing. */
const val TURN_FAILED = "TURN_FAILED"
/** Execution ended without producing a terminal result. */
const val MISSING_TURN_RESULT = "MISSING_TURN_RESULT"
/** A non-queuing request encountered another active turn in the same thread. */
const val THREAD_BUSY = "THREAD_BUSY"
/** The conversation was deleted while this turn was queued or executing. */
const val THREAD_DELETED = "THREAD_DELETED"
/** The selected question is not an unanswered question in the current conversation or turn. */
const val QUESTION_NOT_FOUND = "QUESTION_NOT_FOUND"
/** Conversation data could not be loaded or saved; a result may be unavailable after restarting. */
const val STORAGE_FAILED = "STORAGE_FAILED"
/** The referenced attachment is absent or failed integrity verification. */
const val ATTACHMENT_NOT_FOUND = "ATTACHMENT_NOT_FOUND"
/** The referenced attachment has an unsupported media type. */
const val ATTACHMENT_MEDIA_UNSUPPORTED = "ATTACHMENT_MEDIA_UNSUPPORTED"
/** A text attachment is not valid UTF-8. */
const val ATTACHMENT_INVALID_TEXT = "ATTACHMENT_INVALID_TEXT"
/** The per-thread queue has reached its configured limit. */
const val SESSION_QUEUE_FULL = "SESSION_QUEUE_FULL"
/** The shared queue has reached its configured limit. */
const val RUNTIME_BUSY = "RUNTIME_BUSY"
/** The runtime was closed before the queued turn could execute. */
const val RUNTIME_CLOSED = "RUNTIME_CLOSED"
/** A required approval was not received before its deadline; a tool result carries this code while the turn continues. */
const val CONFIRMATION_EXPIRED = "CONFIRMATION_EXPIRED"
/** A tool's approval was denied; a tool result can carry this code while the turn continues. */
const val CONFIRMATION_DENIED = "CONFIRMATION_DENIED"
/** A pending tool approval was canceled without executing the tool. */
const val CONFIRMATION_CANCELLED = "CONFIRMATION_CANCELLED"
}
16 changes: 13 additions & 3 deletions agent-api/src/main/kotlin/cc/noharry/agent/TurnInput.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,23 @@ sealed interface InputPart {
data class Attachment(val ref: SessionAttachmentRef) : InputPart
}

/** Defaults for a thread. A null model uses the runtime's configured model. */
/**
* Defaults for a new thread, or a patch when resuming one. Null fields retain saved values on resume; for a new
* thread they use runtime defaults (ASK for approvals). Use [reset] to clear individual saved overrides explicitly.
*/
data class ThreadOptions(
val threadId: String? = null,
val model: ModelRef? = null,
val workspace: String? = null,
val scene: String? = null,
val instructions: String? = null,
val approvalPolicy: ApprovalPolicy = ApprovalPolicy.ASK,
val approvalPolicy: ApprovalPolicy? = null,
val reset: Set<ThreadOption> = emptySet(),
)

/** Saved overrides that can be cleared independently while resuming a thread. Explicit values take precedence. */
enum class ThreadOption { MODEL, WORKSPACE, SCENE, INSTRUCTIONS }

/** Overrides for one turn. A caller-supplied turn id is the idempotency key. */
data class TurnOptions(
val turnId: String? = null,
Expand Down Expand Up @@ -70,7 +77,10 @@ data class Usage(
val cacheWriteTokens: Int = 0,
)

/** Stable machine-readable code with a human-readable explanation. */
/**
* Machine-readable [code] with a human-readable explanation. See [TurnErrorCodes] for conversation failures and
* [cc.noharry.agent.spi.reliability.RuntimeErrorCode] for provider/tool codes; custom providers may add their own.
*/
data class TurnError(val code: String, val message: String, val recoverable: Boolean = false)

/** Complete snapshot of one turn. A waiting turn has a [pending] question. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package cc.noharry.agent.spi
/**
* Whether a final answer only says what the agent is about to do ("I'll now look that up") instead of answering. Such an
* answer goes back to the model once for a real one, and fails the run if the next is no better. The runtime's own
* check knows English and Chinese phrasings; a host whose users write another language, or whose answers are short
* check recognizes English phrasings; a host whose users write another language, or whose answers are short
* confirmations the check would mistake, supplies its own, also to the runtimes it builds for subagents.
*
* It is called on the run's thread, possibly several times for one answer and for runs at once: keep it quick, without
* side effects and safe to call concurrently. One that throws fails the run.
*/
@ExperimentalAgentRuntimeApi
fun interface NarrationCheck {
fun isNarration(answer: String): Boolean

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ data class RuntimeObserverActionPreflight(
)

data class RuntimeContextRequest(
/** Unique execution-attempt id; it can change when a public turn is retried after process loss. */
val runId: String,
/** Public conversation id ([cc.noharry.agent.AgentThread.id]). */
val sessionId: String,
/** Public turn id ([cc.noharry.agent.TurnResult.turnId]), scoped to [sessionId]. */
val requestId: String,
val scene: String?,
val input: String,
Expand All @@ -65,8 +68,11 @@ data class RuntimeContextRequest(

@ExperimentalAgentRuntimeApi
data class RuntimeTurnInput(
/** Unique execution-attempt id; it can change when a public turn is retried after process loss. */
val runId: String,
/** Public conversation id ([cc.noharry.agent.AgentThread.id]). */
val sessionId: String,
/** Public turn id ([cc.noharry.agent.TurnResult.turnId]), scoped to [sessionId]. */
val requestId: String,
val scene: String?,
val input: String,
Expand All @@ -79,8 +85,11 @@ data class RuntimeTurnInput(

@ExperimentalAgentRuntimeApi
data class RuntimeCompletedTurn(
/** Unique execution-attempt id; it can change when a public turn is retried after process loss. */
val runId: String,
/** Public conversation id ([cc.noharry.agent.AgentThread.id]). */
val sessionId: String,
/** Public turn id ([cc.noharry.agent.TurnResult.turnId]), scoped to [sessionId]. */
val requestId: String,
val scene: String?,
val inputDigest: String,
Expand Down
18 changes: 3 additions & 15 deletions agent-api/src/main/kotlin/cc/noharry/agent/spi/RuntimeHooks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ package cc.noharry.agent.spi
import cc.noharry.agent.spi.reliability.RuntimeErrorCode
import cc.noharry.agent.TurnResult

/** Default per-hook timeout used by hook registrations. */
const val DEFAULT_HOOK_TIMEOUT_MILLIS: Long = 5_000L

/**
* Host hook API for observing and controlling runtime tool use.
*/
Expand Down Expand Up @@ -53,8 +50,11 @@ data class ToolUseResult(

/** Context passed to host hooks and policy rules. */
data class HookContext(
/** Public conversation id ([cc.noharry.agent.AgentThread.id]). */
val sessionId: String,
/** Unique execution-attempt id; it can change when a public turn is retried after process loss. */
val runId: String,
/** Public turn id ([cc.noharry.agent.TurnResult.turnId]), scoped to [sessionId]. */
val requestId: String,
val approvedConfirmation: Boolean = false,
)
Expand All @@ -65,18 +65,6 @@ enum class HookFailurePolicy {
FAIL_OPEN,
}

/** Host hook registration with a matcher, per-hook timeout, and failure policy. */
data class RuntimeHookRegistration(
val hook: RuntimeHook,
val matcher: ToolMatcher = ToolMatcher.All,
val timeoutMillis: Long = DEFAULT_HOOK_TIMEOUT_MILLIS,
val failurePolicy: HookFailurePolicy = HookFailurePolicy.FAIL_CLOSED,
) {
init {
require(timeoutMillis > 0) { "timeoutMillis must be positive." }
}
}

/** Matcher used to decide whether a hook registration observes a tool call. */
fun interface ToolMatcher {
fun matches(call: ToolUse): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package cc.noharry.agent.spi
* It is called for every failed tool result, on several threads at once when tools run in parallel: keep it quick,
* without side effects and safe to call concurrently. One that throws is taken as no.
*/
@ExperimentalAgentRuntimeApi
fun interface ServiceAnswerCheck {
fun isServiceAnswer(resultJson: String): Boolean

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:OptIn(cc.noharry.agent.spi.ExperimentalAgentRuntimeApi::class)

package cc.noharry.agent.spi

/**
Expand All @@ -10,8 +12,11 @@ package cc.noharry.agent.spi
data class SessionEvent(
val schemaVersion: Int,
val eventId: String,
/** Public conversation id ([cc.noharry.agent.AgentThread.id]). */
val sessionId: String,
/** Unique execution-attempt id; it can change when a public turn is retried after process loss. */
val runId: String,
/** Public turn id ([cc.noharry.agent.TurnResult.turnId]), scoped to [sessionId]. */
val requestId: String,
val sequence: Long,
val recordedAtEpochMillis: Long,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
@file:OptIn(cc.noharry.agent.spi.ExperimentalAgentRuntimeApi::class)

package cc.noharry.agent.spi

/**
* Input for appending one event; identity, sequence, and timestamp are log-owned.
*/
data class SessionEventAppend(
/** Public conversation id ([cc.noharry.agent.AgentThread.id]). */
val sessionId: String,
/** Unique execution-attempt id; it can change when a public turn is retried after process loss. */
val runId: String,
/** Public turn id ([cc.noharry.agent.TurnResult.turnId]), scoped to [sessionId]. */
val requestId: String,
val type: SessionEventType,
val payload: SessionEventPayload = SessionEventPayload.Empty,
Expand Down
Loading
Loading