Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions packages/core/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,7 @@ export type ProviderRetryReason =
| 'provider_unavailable'
| 'rate_limit'
| 'timeout'
| 'incomplete_stream'
| 'unknown';

/**
Expand Down
24 changes: 24 additions & 0 deletions packages/runtime-host/src/__tests__/protocol.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,34 @@ import {
TURN_MESSAGE_QUOTE_TEXT_MAX_LENGTH,
TURN_FAILURE_MESSAGE_MAX_BYTES,
decodeMessageContent,
decodeTurnProviderRetry,
TURN_SKILL_ID_MAX_COUNT,
TURN_SKILL_ID_MAX_LENGTH,
} from '../protocol/turn.js';

test('decodes the protocol-incomplete stream retry reason', () => {
assert.deepEqual(
decodeTurnProviderRetry({
phase: 'scheduled',
attempt: 2,
maxAttempts: 2,
delayMs: 1_000,
reason: 'incomplete_stream',
}),
{
phase: 'scheduled',
attempt: 2,
maxAttempts: 2,
delayMs: 1_000,
reason: 'incomplete_stream',
},
);
});

test('publishes a new compatibility epoch for protocol-incomplete retry progress', () => {
assert.ok(RUNTIME_HOST_COMPATIBILITY_EPOCH > 109);
});

describe('Runtime Host bootstrap protocol', () => {
test('accepts only authenticated-listener registration endpoints on IPv4 loopback', () => {
const registration = {
Expand Down
4 changes: 3 additions & 1 deletion packages/runtime-host/src/protocol/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export const RUNTIME_HOST_REGISTRATION_SCHEMA_VERSION = 1 as const;
export const RUNTIME_HOST_PROTOCOL_VERSION = 0 as const;
// Increment when the same protocol version no longer guarantees safe Client-Host
// interoperability. Mismatches are rejected before domain commands are admitted.
export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 112 as const;
export const RUNTIME_HOST_COMPATIBILITY_EPOCH = 113 as const;
// 113: Turn provider-retry progress may carry the `incomplete_stream` reason;
// older peers reject that closed-union value.
// 112: Owners can query the Host execution environment through an extensible,
// bounded resource-envelope contract. Older Hosts do not implement the query.
// 111: Client Capability tool schemas may use draft-07 tuple additionalItems.
Expand Down
1 change: 1 addition & 0 deletions packages/runtime-host/src/protocol/turn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ function requireProviderRetryReason(value: unknown): ProviderRetryReason {
value === 'provider_unavailable' ||
value === 'rate_limit' ||
value === 'timeout' ||
value === 'incomplete_stream' ||
value === 'unknown'
) {
return value;
Expand Down
Loading