Historical subscription replay is keyed to the subscriber session id rather than the job's recorded history. JobManager#publish_event, publish_result, and publish_error append envelopes under the submitter session id, while lib/arcp/runtime/session_actor.rb:240 through lib/arcp/runtime/session_actor.rb:242 replays @runtime.event_log.replay(@session_id, ...) for the observer session handling the subscribe request. A second session that calls subscribe_job(job_id: running.job_id, history: true, from_event_seq: 0) therefore gets no previous events even though the event log contains them under another session id.
Fix prompt: Rework event history lookup so job.subscribe history replay reads the requested job's event stream rather than the subscribing session's buffer. A minimal fix can index EventLog entries by job id in addition to the current session id, then have handle_subscribe replay from that job id while still enforcing SubscriptionManager#attach ownership checks. Add integration coverage where one client emits several events before a second client subscribes with history: true, and assert that the second client receives the prior events in order followed by live events and the terminal result.
Historical subscription replay is keyed to the subscriber session id rather than the job's recorded history.
JobManager#publish_event,publish_result, andpublish_errorappend envelopes under the submitter session id, whilelib/arcp/runtime/session_actor.rb:240throughlib/arcp/runtime/session_actor.rb:242replays@runtime.event_log.replay(@session_id, ...)for the observer session handling the subscribe request. A second session that callssubscribe_job(job_id: running.job_id, history: true, from_event_seq: 0)therefore gets no previous events even though the event log contains them under another session id.Fix prompt: Rework event history lookup so
job.subscribehistory replay reads the requested job's event stream rather than the subscribing session's buffer. A minimal fix can indexEventLogentries by job id in addition to the current session id, then havehandle_subscribereplay from that job id while still enforcingSubscriptionManager#attachownership checks. Add integration coverage where one client emits several events before a second client subscribes withhistory: true, and assert that the second client receives the prior events in order followed by live events and the terminal result.