@@ -2852,7 +2852,7 @@ describe("handleFeishuMessage command authorization", () => {
28522852 expect ( routeRequest . parentPeer ) . toEqual ( { kind : "group" , id : "oc-group" } ) ;
28532853 } ) ;
28542854
2855- it ( "keeps root_id as topic key when root_id and thread_id both exist" , async ( ) => {
2855+ it ( "prefers thread_id as topic key when root_id and thread_id both exist" , async ( ) => {
28562856 mockShouldComputeCommandAuthorized . mockReturnValue ( false ) ;
28572857
28582858 const cfg : ClawdbotConfig = {
@@ -2889,7 +2889,7 @@ describe("handleFeishuMessage command authorization", () => {
28892889 } > ( mockResolveAgentRoute , 0 , 0 ) ;
28902890 expect ( routeRequest . peer ) . toEqual ( {
28912891 kind : "group" ,
2892- id : "oc-group:topic:om_root_topic :sender:ou-topic-user" ,
2892+ id : "oc-group:topic:omt_topic_1 :sender:ou-topic-user" ,
28932893 } ) ;
28942894 expect ( routeRequest . parentPeer ) . toEqual ( { kind : "group" , id : "oc-group" } ) ;
28952895 } ) ;
@@ -3025,7 +3025,7 @@ describe("handleFeishuMessage command authorization", () => {
30253025 ) ;
30263026 } ) ;
30273027
3028- it ( "maps legacy topicSessionMode=enabled to root_id when both root_id and thread_id exist" , async ( ) => {
3028+ it ( "maps legacy topicSessionMode=enabled to thread_id when both root_id and thread_id exist" , async ( ) => {
30293029 mockShouldComputeCommandAuthorized . mockReturnValue ( false ) ;
30303030
30313031 const cfg : ClawdbotConfig = {
@@ -3058,7 +3058,7 @@ describe("handleFeishuMessage command authorization", () => {
30583058
30593059 expectResolvedRouteCall (
30603060 0 ,
3061- { kind : "group" , id : "oc-group:topic:om_root_legacy " } ,
3061+ { kind : "group" , id : "oc-group:topic:omt_topic_legacy " } ,
30623062 { kind : "group" , id : "oc-group" } ,
30633063 ) ;
30643064 } ) ;
@@ -3100,7 +3100,7 @@ describe("handleFeishuMessage command authorization", () => {
31003100 ) ;
31013101 } ) ;
31023102
3103- it ( "keeps topic session key stable after first turn creates a thread " , async ( ) => {
3103+ it ( "prefers the Feishu thread_id once a follow-up event includes it " , async ( ) => {
31043104 mockShouldComputeCommandAuthorized . mockReturnValue ( false ) ;
31053105
31063106 const cfg : ClawdbotConfig = {
@@ -3144,7 +3144,7 @@ describe("handleFeishuMessage command authorization", () => {
31443144 await dispatchMessage ( { cfg, event : secondTurn } ) ;
31453145
31463146 expectResolvedRouteCall ( 0 , { kind : "group" , id : "oc-group:topic:msg-topic-first" } ) ;
3147- expectResolvedRouteCall ( 1 , { kind : "group" , id : "oc-group:topic:msg-topic-first " } ) ;
3147+ expectResolvedRouteCall ( 1 , { kind : "group" , id : "oc-group:topic:omt_topic_created " } ) ;
31483148 } ) ;
31493149
31503150 it ( "hydrates missing native topic thread_id before routing starter events" , async ( ) => {
0 commit comments