Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
fecd96b
fix(phone): a call is routed into a call of its own customer's
thesyncim Nov 24, 2026
cbc6a5c
test(phone): cover the caller's own session on another node
thesyncim Nov 24, 2026
895bbab
test(phone): a session id of the test's own
thesyncim Nov 24, 2026
493e046
fix(phone): claim a named call under one lock
thesyncim Nov 25, 2026
035d9d8
test(phone): whose a named call is
thesyncim Nov 25, 2026
2d20d67
fix(phone): the hold decides whose a session's call is
thesyncim Nov 25, 2026
3dba393
test(phone): a claim refused, unread or unanswered
thesyncim Nov 25, 2026
975e3c3
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
4c94ed3
fix(phone): claim named calls apart from other placements, and hold a…
thesyncim Nov 25, 2026
83a9dea
test(phone): a claim whose legs cannot be read
thesyncim Nov 25, 2026
92f1112
Merge origin/main into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
44f8c62
refactor(phone): one way to refuse a held call
thesyncim Nov 25, 2026
e4a9829
test(phone): only the connection of the hold goes deaf
thesyncim Nov 25, 2026
71c0364
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
8df99bc
test(phone): named call tests bound their waits and connections
thesyncim Nov 25, 2026
77d9767
test(phone): tests of claims made at once close their connections
thesyncim Nov 25, 2026
32dfe0c
Merge origin/main into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
f8f6726
Merge origin/main into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
8d737f1
Merge origin/main into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
34bc6a0
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
e6d272b
fix(phone): a wait on the directory ends in its own time, and what re…
thesyncim Nov 25, 2026
39ad9fb
test(phone): the redial test reaches every connection
thesyncim Nov 25, 2026
645fb01
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
1d31522
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
c91e64c
test(phone): a slow Redis is waited for, and a router that stops leav…
thesyncim Nov 25, 2026
ad25a29
Merge origin/main into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
36a8177
Merge origin/main into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
95723b6
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
7e417fd
test(phone): a call another shard answered is its customer's here too
thesyncim Nov 25, 2026
645b543
test(phone): import routing
thesyncim Nov 25, 2026
e5e2981
test(phone): a claim whose homes cannot be read, and fewer connection…
thesyncim Nov 25, 2026
6a8cc27
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
debdd51
fix(phone): a named call is claimed on the one connection its lock is…
thesyncim Nov 25, 2026
c1d2a6f
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
78eba8b
test(phone): named calls of one organization keep to its limit
thesyncim Nov 25, 2026
48832c6
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 25, 2026
5fd26d0
test(phone): a named call names its organization and keeps no leg who…
thesyncim Nov 25, 2026
146fe01
Merge remote-tracking branch 'origin/main' into fix/ai-3744-call-owner
thesyncim Nov 26, 2026
4340d41
phone move test's fake Stream apps names the deployment app; gofmt
thesyncim Nov 26, 2026
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
2 changes: 2 additions & 0 deletions acceleration/cmd/router/phonemove_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ func (a oneApp) ForAppRemoving(ctx context.Context, customer string, app int64)

func (a oneApp) Placed(context.Context, string) (int64, error) { return 0, nil }

func (a oneApp) DeploymentApp() int64 { return 0 }

// Without what the webhook needs to answer, nothing is moved and Twilio is asked nothing, so no
// number is pointed at a webhook that would refuse its calls.
func (s *PhoneMoveSuite) TestARouterThatCouldNotAnswerTheWebhookMovesNothing() {
Expand Down
2 changes: 1 addition & 1 deletion acceleration/internal/api/callhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func (s *Server) answerWithAgent(ctx context.Context, sessions *session.Manager,
}
spec := session.FromConfig(config)
// The number names each caller's call for the session answering it, as dispatch does.
spec.ID = callID
spec.ID, spec.MintedID = callID, true
spec.CallType, spec.CallID = callType, callID
spec.Text = false
spec.PersistConversation = true
Expand Down
1 change: 1 addition & 0 deletions acceleration/internal/api/callhooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ func (s *CallHooksSuite) TestAnArrivingCallToANumberWithAnAgentIsAnsweredByIt()
spec := found.Spec()
s.Equal("default", spec.CallType, "the agent joins the call the caller is in")
s.Equal(s.callID, spec.CallID)
s.True(spec.MintedID, "nobody chose the caller's call")
s.Equal(config, spec.ConfigID)
s.True(spec.PersistConversation, "the conversation is kept, as a worker's session keeps it")
s.Empty(spec.Caller.UserID, "a caller id is easy to fake, so it names no user")
Expand Down
6 changes: 3 additions & 3 deletions acceleration/internal/api/forward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ func (s *ForwardedSessionSuite) TestAMessageStampedWithItsCustomerIsNotCarriedTo
}
}

// Two customers may each run a session of one id, each on a node of its own: a request reaches
// the session of the caller's own customer, wherever it lands.
// Two customers in Stream apps of their own may each run a session of one id, each on a node of
// its own: a request reaches the session of the caller's own customer, wherever it lands.
func (s *ForwardedSessionSuite) TestARequestReachesTheSessionOfTheCallersCustomerOfAnIdTwoRun() {
id := s.utils.uuid()
other := s.data.backendOfAnotherApp()
other := s.backendInAppOfItsOwn()
mine := s.serverClient.createSession(CreateSessionRequest{Id: &id, Incognito: pointerTo(true), Llm: pointerTo("llm-flow")})
theirs := other.on(s.other).createSession(CreateSessionRequest{Id: &id, Incognito: pointerTo(true), Llm: pointerTo("echo/echo-model")})
third := s.otherNode()
Expand Down
3 changes: 3 additions & 0 deletions acceleration/internal/api/money.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/GetStream/Vision-Agents/acceleration/internal/policy"
"github.com/GetStream/Vision-Agents/acceleration/internal/routing"
"github.com/GetStream/Vision-Agents/acceleration/internal/session"
"github.com/GetStream/Vision-Agents/acceleration/internal/store"
"github.com/GetStream/Vision-Agents/acceleration/internal/streamapp"
)

Expand Down Expand Up @@ -110,6 +111,8 @@ func refusedRequest(err error) error {
return answer
}
switch {
case errors.Is(err, store.ErrCallUnchecked):
return errCallUnchecked
case errors.Is(err, session.ErrToolNotConfigured):
return toolNotConfigured(err)
case errors.Is(err, session.ErrNoMemory):
Expand Down
16 changes: 15 additions & 1 deletion acceleration/internal/api/phone.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,12 @@ func (s *Server) placePhoneCall(ctx context.Context, request *placePhoneCallRequ
return nil, err
}
if theirs {
return nil, conflict("session_id is taken")
return nil, errSessionTaken
}
call.SessionID = held
if s.directory != nil {
call.Holder = s.directory.CallHolder
}
}
if request.Body.RingTimeoutSeconds != nil {
if *request.Body.RingTimeoutSeconds < 0 {
Expand All @@ -435,6 +438,12 @@ func (s *Server) placePhoneCall(ctx context.Context, request *placePhoneCallRequ
if failure, over := tierLimitReached(err); over {
return nil, failure
}
if errors.Is(err, store.ErrCallTaken) {
return nil, errSessionTaken
}
if errors.Is(err, store.ErrCallUnchecked) {
Comment thread
thesyncim marked this conversation as resolved.
Resolved
return nil, errCallUnchecked
}
if errors.Is(err, dlc.ErrRefused) || errors.Is(err, phone.ErrDestinationRefused) {
return nil, forbidden(err.Error())
}
Expand Down Expand Up @@ -1007,6 +1016,11 @@ func phoneTags(tags *map[string]string) routing.Tags {
return routing.Tags(*tags)
}

var errSessionTaken = conflict("session_id is taken")

// errCallUnchecked refuses a session id whose call the router could not tell the customer of.
var errCallUnchecked = unavailable("could not tell whose call that session id is, try again")

var errNoTelephony = notConfigured("phone numbers are not available: no telephony configured")

// callApp is the Stream app a live call is in, which a human transferred into it has to be
Expand Down
Loading
Loading