Skip to content

Runtime Control Frame Metadata

This page defines fixed metadata for the runtime.control frames. Multi-value fields use the Runtime Control Value Registries.

Control Request Metadata

Used by CANCEL and ABORT.

OffsetFieldTypeRequiredMeaning
0operation_idu64YesTarget operation. 0 means session-level control.
8control_sequenceu64YesMonotonic sequence within the sender.
16reason_codeu16YesSee reason_code in the value registries.
18source_roleu8YesSee role codes in the value registries.
19flagsu8YesSee flag masks in the value registries.
20diagnostic_bytesu32NoOptional diagnostic body length.
24reservedu64YesMust be zero.

Scheduling Metadata

Used by PRIORITY_UPDATE, DEADLINE, and EXPIRE_AT.

OffsetFieldTypeRequiredMeaning
0operation_idu64YesTarget operation.
8control_sequenceu64YesMonotonic sequence within the sender.
16priority_classu16For PRIORITY_UPDATENew priority class.
18priority_deltai16NoRelative priority adjustment.
20deadline_unix_msu64For DEADLINE / EXPIRE_ATNon-zero absolute Unix deadline or expiration timestamp in milliseconds; 0 is invalid/unset.
28flagsu32YesSee flag masks in the value registries.

Supersede Metadata

Used by SUPERSEDE.

OffsetFieldTypeRequiredMeaning
0old_operation_idu64YesOperation whose late result may be dropped.
8new_operation_idu64YesReplacement operation.
16control_sequenceu64YesMonotonic sequence within the sender.
24drop_reason_codeu16YesSee drop_reason_code in the value registries.
26flagsu16YesSee flag masks in the value registries.
28diagnostic_bytesu32NoOptional diagnostic body length.

Budget Metadata

Used by BUDGET_UPDATE.

OffsetFieldTypeRequiredMeaning
0operation_idu64YesTarget operation or 0 for session-level budget.
8compute_budget_unitsu64NoCompute units under the negotiated cost model.
16memory_budget_bytesu64NoMemory budget.
24bandwidth_budget_bytesu64NoTransport budget.
32token_budgetu32NoToken budget when applicable.
36flagsu32YesSee flag masks in the value registries.

BUDGET_UPDATE carries enforceable remaining-consumption ceilings, not advisory scheduling hints. The receiver applies the update to its work for the identified operation. An operation_id of 0 updates the session default for operations admitted after the update; already-admitted operations change only when targeted by their non-zero operation id.

The update has the following normative semantics:

  1. Exactly one of the replace and increment flag bits must be set. Setting both or neither is a semantic error even though the fixed metadata layout remains structurally decodable.
  2. A zero numeric field leaves that budget dimension unchanged. Under replace, each non-zero field replaces the remaining ceiling. Under increment, each non-zero field increases the remaining ceiling; overflow is an error.
  3. compute_budget_units uses the cost model accepted through CAPABILITY_NEGOTIATION. A receiver must not advertise compute-budget support without a concrete cost model.
  4. memory_budget_bytes limits additional live memory owned for the operation after the update. bandwidth_budget_bytes limits NNRP payload bytes emitted by the receiver for the operation after the update. token_budget uses the active profile's token unit; for openai-compatible/1, it limits generated output tokens after the update is accepted.
  5. Every non-zero budget is a hard ceiling. The receiver must stop, drop, or complete within the ceiling. It may degrade only when the submitted budget policy permits that degradation and a compatible DEGRADE_PROFILE has been accepted. Degradation never relaxes the active ceiling.
  6. Exceeding a ceiling must produce a terminal RESULT_DROP_REASON with drop_reason_code=budget_exceeded, or a profile terminal event followed by the same observable terminal reason when the profile requires one.

Progress Metadata

Used by PROGRESS.

OffsetFieldTypeRequiredMeaning
0operation_idu64YesOperation being reported.
8progress_sequenceu64YesMonotonic progress sequence.
16stage_codeu16YesSee stage_code in the value registries.
18percent_x100u16No0..10000; 0xffff means unknown.
20object_idu64NoRuntime object attached to this progress event.
28body_bytesu32NoOptional progress payload length.

Partial Result Metadata

Used by PARTIAL_RESULT.

OffsetFieldTypeRequiredMeaning
0operation_idu64YesOperation being reported.
8result_sequenceu64YesMonotonic result sequence.
16object_idu64NoReferenced runtime object.
24delta_sequenceu64NoObject delta sequence.
32body_bytesu32NoInline body length.
36flagsu32YesSee flag masks in the value registries.

Pressure Metadata

Used by BACKPRESSURE and CREDIT_UPDATE.

OffsetFieldTypeRequiredMeaning
0scope_idu64YesSession or operation scope.
8credit_windowu64For CREDIT_UPDATENew send window.
16pressure_levelu16For BACKPRESSURESee pressure_level in the value registries.
18pressure_reasonu16NoSee pressure_reason in the value registries.
20retry_after_msu32NoSender should wait before sending more.
24flagsu32YesSee flag masks in the value registries.
28reservedu32YesMust be zero.

Capability Metadata

Used by CAPABILITY_NEGOTIATION and DEGRADE_PROFILE.

OffsetFieldTypeRequiredMeaning
0profile_idu16YesProfile being negotiated.
2capability_countu16YesNumber of capability entries in the body.
4cost_model_idu16NoSee cost_model_id in the value registries.
6preference_ranku16NoLower value means stronger preference.
8limit_bytesu64NoAggregate byte limit for the profile.
16limit_unitsu64NoAggregate compute or token limit.
24body_bytesu32YesCapability entry body length.
28flagsu32YesSee flag masks in the value registries.

The capability body is a compact binary sequence. It is not JSON and does not contain an outer array or object envelope. Each entry has this layout:

OffsetFieldTypeMeaning
0token_bytesu16Capability token byte length; must be non-zero.
2tokenASCII byte spanCanonical registered capability token.

Entries are packed back to back without padding. The following rules are normative:

  1. capability_count equals the number of packed entries and body_bytes equals their exact total byte length. A zero count requires an empty body; a non-zero count requires a non-empty body.
  2. Tokens use the canonical lowercase ASCII spelling from the active capability registry. Unknown, malformed, empty, or private tokens are rejected unless a separately negotiated extension registry explicitly permits them.
  3. Tokens appear once each, sorted by ascending unsigned byte order. Duplicate or non-canonical ordering is a semantic error.
  4. profile_id, cost_model_id, preference_rank, limit_bytes, limit_units, and flags form one offer that applies to every token in the body. Different costs or limits require separate CAPABILITY_NEGOTIATION frames.
  5. A receiver answers with the same encoding and only the subset it accepts. An empty accepted set uses capability_count=0 and body_bytes=0; a hard requirement with no accepted token must also produce a typed capability-mismatch error.

Route Hint Metadata

Used by ROUTE_HINT and EXECUTION_HINT.

OffsetFieldTypeRequiredMeaning
0operation_idu64YesOperation being routed.
8route_idu32NoPreferred route.
12executor_classu16NoSee executor_class in the value registries.
14affinity_classu16NoSee affinity_class in the value registries.
16deadline_unix_msu64NoRoute-level deadline.
24body_bytesu32NoOptional hint body length.
28flagsu32YesSee flag masks in the value registries.

Trace Context Metadata

Used by TRACE_CONTEXT.

OffsetFieldTypeRequiredMeaning
0trace_idu64YesTrace identifier, mirrored in the common header when possible.
8span_idu64YesCurrent span.
16parent_span_idu64NoParent span.
24stage_codeu16NoSee stage_code in the value registries.
26flagsu16YesSee flag masks in the value registries.
28body_bytesu32NoOptional trace attribute body length.

TRACE_CONTEXT has two frozen correlation scopes:

  • header.frame_id == 0 updates session-scoped trace context.
  • A non-zero header.frame_id updates the operation bound to that submitted frame. The frame id MUST name an active operation and MUST equal the FRAME_SUBMIT frame id recorded for that operation.

The metadata intentionally does not repeat operation_id. A role-level SDK accepts an optional operation identity and resolves it through the active operation_id / frame_id pair before encoding the common header. It MUST NOT allocate an unrelated frame id for TRACE_CONTEXT. Receivers MUST reject a non-zero unknown or mismatched frame id. When the common-header trace_id is non-zero, it MUST equal TraceContextMetadata.trace_id.

Result Drop Metadata

Used by RESULT_DROP_REASON.

OffsetFieldTypeRequiredMeaning
0operation_idu64YesDropped operation or result.
8result_sequenceu64NoDropped result sequence.
16drop_reason_codeu16YesSee drop_reason_code in the value registries.
18source_roleu8YesSee role codes in the value registries.
19flagsu8YesSee flag masks in the value registries.
20diagnostic_bytesu32NoOptional diagnostic body length.
24reservedu64YesMust be zero.

Recoverable Error Metadata

Used by ERROR_RECOVERABLE.

OffsetFieldTypeRequiredMeaning
0error_codeu32YesError code in the active error registry.
4error_scopeu32YesConnection, session, or frame scope.
8recovery_actionu16YesSee reason_code in the value registries.
10source_roleu8YesSee role codes in the value registries.
11flagsu8YesSee flag masks in the value registries.
12retry_after_msu32NoSuggested retry delay; 0 means no explicit delay.
16related_session_idu32NoRelated session identifier.
20related_frame_idu32NoRelated frame or operation identifier low bits.
24related_view_idu32NoRelated view identifier.
28diagnostic_bytesu32NoOptional diagnostic body length.

Retry After Metadata

Used by RETRY_AFTER.

OffsetFieldTypeRequiredMeaning
0scope_idu64YesSession or operation scope; 0 means connection.
8control_sequenceu64YesMonotonic sequence within the sender.
16retry_after_msu32YesMinimum retry delay in milliseconds.
20jitter_msu32NoOptional jitter window in milliseconds.
24reason_codeu16YesSee reason_code in the value registries.
26source_roleu8YesSee role codes in the value registries.
27flagsu8YesSee flag masks in the value registries.
28diagnostic_bytesu32NoOptional diagnostic body length.

NNRP Documentation