feat: auto-publish server announcements on start (CEP-6)#78
Conversation
|
I went through this against the CEP-6 scope and the TS reference, and overall I think the structure here is solid. The synthetic initialize flow, the worker interception for the announcement sentinel, and especially the initialized-ordering guarantee all look well thought out. I do have one blocking correctness issue though: the auto-publish flow is dispatching I’d also tighten the PR description in two places for precision. First, saying this happens “on start” is a bit misleading, because the announcement task is actually spawned after startup from the worker side so the message loop is already running. Second, the current wording around the 10s wait sounds stricter than the implementation: the code waits up to 10s for initialize, but then proceeds gracefully with the capability-list dispatch even on timeout. One other recommendation: the current schema-to-kind mapping works, but it is still heuristic, based on field presence. That is probably fine for landing this slice, but it does not quite reach the explicit mapping/validation shape described in the issue or used in the TS implementation. I would be fine with that as follow-up work, but I think it’s worth calling out clearly as not being full parity yet. On tests, I think the new coverage is good around ordering and basic publication behavior. I would still like to see the resource templates request string covered as a regression point, since that is the easiest place for protocol drift to hide. So my recommendation would be: fix the resource templates method name before merge, adjust the PR wording around startup and timeout behavior, and treat the stronger schema-mapping parity as follow-up rather than implying issue-wide completion. |
f539af7 to
fda3e87
Compare
fixed the method name (resourceTemplates/list → resources/templates/list) and updated the test expectation. also noted the schema-to-kind mapping parity as a follow-up item. good catch on the protocol string! |
Part of CEP-6 implementation #76.
When is_announced_server: true, the transport auto-publishes all announcement events after startup - no manual calls needed.
What happens:
Worker routes responses with id == "announcement" to the announcement handler before the existing stateless sentinel check.
Critical ordering preserved: notifications/initialized is queued before signaling the Notify, so the worker sees initialized state before capability-list requests arrive.
Note: schema-to-kind mapping is currently field-presence based - explicit schema validation matching the TS SDK is tracked as follow-up in 4th PR.
10 new tests, 373 passing.