@junctionpanel/server 0.1.96 → 0.1.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -623,7 +623,7 @@ export class Session {
623
623
  if (event.agent.provider === 'codex') {
624
624
  this.scheduleProviderChildThreadRefresh();
625
625
  }
626
- if (event.agent.lifecycle === 'idle') {
626
+ if (event.agent.lifecycle === 'idle' && !event.agent.pendingRun) {
627
627
  this.drainMessageQueue(event.agent.id);
628
628
  }
629
629
  return;
@@ -6874,7 +6874,7 @@ export class Session {
6874
6874
  // If deliveryMode is 'queue' and the agent is currently running, enqueue the message
6875
6875
  if (msg.deliveryMode === 'queue') {
6876
6876
  const currentAgent = this.agentManager.getAgent(agentId);
6877
- if (currentAgent && currentAgent.lifecycle === 'running') {
6877
+ if (currentAgent && (currentAgent.lifecycle === 'running' || currentAgent.pendingRun)) {
6878
6878
  const queue = softQueuedMessages.get(agentId) ?? [];
6879
6879
  const queuedEntry = {
6880
6880
  id: msg.messageId ?? uuidv4(),
@@ -7043,7 +7043,7 @@ export class Session {
7043
7043
  if (!agent.capabilities.supportsTurnSteering || typeof agent.session.steer !== 'function') {
7044
7044
  throw new Error(`Agent ${agentId} does not support steering`);
7045
7045
  }
7046
- if (agent.lifecycle !== 'running') {
7046
+ if (agent.lifecycle !== 'running' && !agent.pendingRun) {
7047
7047
  throw new Error(`Agent ${agentId} is not currently running`);
7048
7048
  }
7049
7049
  const queue = softQueuedMessages.get(agentId);