fix(openai): hybrid continuation 소유 순서를 바로잡는다
This commit is contained in:
parent
59d07723ca
commit
ffd2c82f48
1 changed files with 34 additions and 34 deletions
|
|
@ -59,6 +59,23 @@ func (s *Server) joinPresetChatIngress(r *http.Request, dispatch routeDispatch,
|
|||
if err != nil {
|
||||
return presetIngressResult{}, fmt.Errorf("invalid preset continuation payload: %w", err)
|
||||
}
|
||||
if s.lightFlows != nil {
|
||||
snap, disposition, matched, err := s.lightFlows.consumeChat(ownerEdgeID, principalRef, rawBody, contLineage, s.requestCoordinator)
|
||||
if matched {
|
||||
if err != nil {
|
||||
return presetIngressResult{}, fmt.Errorf("light continuation rejected: %w", err)
|
||||
}
|
||||
if disposition.Terminal != nil {
|
||||
s.artifactFrontiers.remove(disposition.RequestID, ownerEdgeID)
|
||||
runMeta["iop_logical_request_id"] = disposition.RequestID
|
||||
return presetIngressResult{Terminal: disposition.Terminal}, nil
|
||||
}
|
||||
if err := s.applyLightDisposition(snap, disposition, runMeta, dispatch.Preset.ID); err != nil {
|
||||
return presetIngressResult{}, err
|
||||
}
|
||||
return presetIngressResult{Light: disposition}, nil
|
||||
}
|
||||
}
|
||||
if s.artifactFrontiers != nil {
|
||||
snap, disposition, matched, err := s.artifactFrontiers.consumeChat(
|
||||
ownerEdgeID, principalRef, rawBody, contLineage, s.requestCoordinator, s.lightFlows,
|
||||
|
|
@ -91,23 +108,6 @@ func (s *Server) joinPresetChatIngress(r *http.Request, dispatch routeDispatch,
|
|||
return presetIngressResult{Artifact: disposition}, nil
|
||||
}
|
||||
}
|
||||
if s.lightFlows != nil {
|
||||
snap, disposition, matched, err := s.lightFlows.consumeChat(ownerEdgeID, principalRef, rawBody, contLineage, s.requestCoordinator)
|
||||
if matched {
|
||||
if err != nil {
|
||||
return presetIngressResult{}, fmt.Errorf("light continuation rejected: %w", err)
|
||||
}
|
||||
if disposition.Terminal != nil {
|
||||
s.artifactFrontiers.remove(disposition.RequestID, ownerEdgeID)
|
||||
runMeta["iop_logical_request_id"] = disposition.RequestID
|
||||
return presetIngressResult{Terminal: disposition.Terminal}, nil
|
||||
}
|
||||
if err := s.applyLightDisposition(snap, disposition, runMeta, dispatch.Preset.ID); err != nil {
|
||||
return presetIngressResult{}, err
|
||||
}
|
||||
return presetIngressResult{Light: disposition}, nil
|
||||
}
|
||||
}
|
||||
snap, err := s.requestCoordinator.consumeContinuationByLineage(ownerEdgeID, principalRef, contLineage)
|
||||
if err != nil {
|
||||
return presetIngressResult{}, fmt.Errorf("preset continuation rejected: %w", err)
|
||||
|
|
@ -210,6 +210,23 @@ func (s *Server) joinPresetAnthropicIngress(r *http.Request, dispatch routeDispa
|
|||
if err != nil {
|
||||
return presetIngressResult{}, fmt.Errorf("invalid preset continuation payload: %w", err)
|
||||
}
|
||||
if s.lightFlows != nil {
|
||||
snap, disposition, matched, err := s.lightFlows.consumeAnthropic(ownerEdgeID, principalRef, rawBody, contLineage, s.requestCoordinator)
|
||||
if matched {
|
||||
if err != nil {
|
||||
return presetIngressResult{}, fmt.Errorf("light continuation rejected: %w", err)
|
||||
}
|
||||
if disposition.Terminal != nil {
|
||||
s.artifactFrontiers.remove(disposition.RequestID, ownerEdgeID)
|
||||
metadata["iop_logical_request_id"] = disposition.RequestID
|
||||
return presetIngressResult{Terminal: disposition.Terminal}, nil
|
||||
}
|
||||
if err := s.applyLightDisposition(snap, disposition, metadata, dispatch.Preset.ID); err != nil {
|
||||
return presetIngressResult{}, err
|
||||
}
|
||||
return presetIngressResult{Light: disposition}, nil
|
||||
}
|
||||
}
|
||||
if s.artifactFrontiers != nil {
|
||||
snap, disposition, matched, err := s.artifactFrontiers.consumeAnthropic(
|
||||
ownerEdgeID, principalRef, rawBody, contLineage, s.requestCoordinator, s.lightFlows,
|
||||
|
|
@ -242,23 +259,6 @@ func (s *Server) joinPresetAnthropicIngress(r *http.Request, dispatch routeDispa
|
|||
return presetIngressResult{Artifact: disposition}, nil
|
||||
}
|
||||
}
|
||||
if s.lightFlows != nil {
|
||||
snap, disposition, matched, err := s.lightFlows.consumeAnthropic(ownerEdgeID, principalRef, rawBody, contLineage, s.requestCoordinator)
|
||||
if matched {
|
||||
if err != nil {
|
||||
return presetIngressResult{}, fmt.Errorf("light continuation rejected: %w", err)
|
||||
}
|
||||
if disposition.Terminal != nil {
|
||||
s.artifactFrontiers.remove(disposition.RequestID, ownerEdgeID)
|
||||
metadata["iop_logical_request_id"] = disposition.RequestID
|
||||
return presetIngressResult{Terminal: disposition.Terminal}, nil
|
||||
}
|
||||
if err := s.applyLightDisposition(snap, disposition, metadata, dispatch.Preset.ID); err != nil {
|
||||
return presetIngressResult{}, err
|
||||
}
|
||||
return presetIngressResult{Light: disposition}, nil
|
||||
}
|
||||
}
|
||||
snap, err := s.requestCoordinator.consumeContinuationByLineage(ownerEdgeID, principalRef, contLineage)
|
||||
if err != nil {
|
||||
return presetIngressResult{}, fmt.Errorf("preset continuation rejected: %w", err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue