@@ -2204,7 +2204,7 @@ test("deferred-upload sends revalidate agent authorization at the publish bounda
22042204 page,
22052205} ) => {
22062206 // A background media upload can hold the publish open for arbitrarily long —
2207- // authorization revoked during that window must still strip the p tag . This
2207+ // authorization revoked during that window must block publication . This
22082208 // pins the publish-boundary revalidation on the deferred path.
22092209 await installMockBridge ( page , {
22102210 deferredComposerUploads : true ,
@@ -2289,24 +2289,29 @@ test("deferred-upload sends revalidate agent authorization at the publish bounda
22892289 } ) ;
22902290
22912291 const outgoingContent = `@quinn hello\n } .mp4)` ;
2292- await expect
2293- . poll ( ( ) => readOutgoingMentionPubkeys ( page , outgoingContent ) )
2294- . not . toBeNull ( ) ;
2295- await expect
2296- . poll ( ( ) => readOutgoingMentionPubkeys ( page , outgoingContent ) )
2297- . not . toContain ( ALLOWLIST_RELAY_AGENT_PUBKEY ) ;
2292+ await expect (
2293+ page . getByText ( "Could not authorize a mentioned agent." , { exact : false } ) ,
2294+ ) . toBeVisible ( ) ;
2295+ expect ( await readOutgoingMentionPubkeys ( page , outgoingContent ) ) . toBeNull ( ) ;
2296+ await expect ( input ) . toHaveText ( "@quinn hello" ) ;
2297+ await expect (
2298+ page . getByTestId ( "composer-queued-media-attachment" ) ,
2299+ ) . toBeVisible ( ) ;
22982300 const commands = await readCommandLog ( page ) ;
22992301 expect ( commandCount ( commands , "revalidate_relay_agents" ) ) . toBe (
23002302 commandCount ( baselineCommands , "revalidate_relay_agents" ) + 2 ,
23012303 ) ;
2304+ expect ( commandCount ( commands , "start_managed_agent" ) ) . toBe (
2305+ commandCount ( baselineCommands , "start_managed_agent" ) ,
2306+ ) ;
23022307} ) ;
23032308
23042309test ( "sends that attach a mentioned agent revalidate at the publish boundary" , async ( {
23052310 page,
23062311} ) => {
23072312 // The awaited membership write for a non-member managed agent is a relay
23082313 // round-trip between the pre-side-effect authorization pass and the publish
2309- // — authorization revoked during that window must still strip the p tag .
2314+ // — authorization revoked during that window must block publication .
23102315 await installMockBridge ( page , {
23112316 managedAgents : [
23122317 {
@@ -2385,15 +2390,13 @@ test("sends that attach a mentioned agent revalidate at the publish boundary", a
23852390 window . __BUZZ_E2E__ . mock . relayAgentRevalidationRevokedPubkeys = [ pubkey ] ;
23862391 } , ALLOWLIST_RELAY_AGENT_PUBKEY ) ;
23872392
2388- await expect
2389- . poll ( ( ) => readOutgoingMentionPubkeys ( page , "@quinn @fizz hello" ) )
2390- . not . toBeNull ( ) ;
2391- const outgoingPubkeys = await readOutgoingMentionPubkeys (
2392- page ,
2393- "@quinn @fizz hello" ,
2394- ) ;
2395- expect ( outgoingPubkeys ) . toContain ( OUT_OF_CHANNEL_MANAGED_AGENT_PUBKEY ) ;
2396- expect ( outgoingPubkeys ) . not . toContain ( ALLOWLIST_RELAY_AGENT_PUBKEY ) ;
2393+ await expect (
2394+ page . getByText ( "Could not authorize a mentioned agent." , { exact : false } ) ,
2395+ ) . toBeVisible ( ) ;
2396+ expect (
2397+ await readOutgoingMentionPubkeys ( page , "@quinn @fizz hello" ) ,
2398+ ) . toBeNull ( ) ;
2399+ await expect ( input ) . toHaveText ( "@quinn @fizz hello" ) ;
23972400 const commands = await readCommandLog ( page ) ;
23982401 expect ( commandCount ( commands , "revalidate_relay_agents" ) ) . toBe (
23992402 commandCount ( baselineCommands , "revalidate_relay_agents" ) + 2 ,
@@ -2403,6 +2406,9 @@ test("sends that attach a mentioned agent revalidate at the publish boundary", a
24032406 expect ( commandCount ( commands , "update_managed_agent" ) ) . toBe (
24042407 commandCount ( baselineCommands , "update_managed_agent" ) ,
24052408 ) ;
2409+ expect ( commandCount ( commands , "start_managed_agent" ) ) . toBe (
2410+ commandCount ( baselineCommands , "start_managed_agent" ) ,
2411+ ) ;
24062412} ) ;
24072413
24082414test ( "sends that enroll agents into an active huddle revalidate at the publish boundary" , async ( {
@@ -2477,7 +2483,7 @@ test("a send held open by a no-write step still revalidates at the publish bound
24772483 // here the only thing separating the authorization pass from the publish is
24782484 // the huddle sync — which with no active huddle writes nothing to the relay
24792485 // — and the revocation is released with zero further hold. A revocation
2480- // landing in any admission-to-publish gap must strip the p tag ; this is the
2486+ // landing in any admission-to-publish gap must block publication ; this is the
24812487 // reviewer's sub-threshold probe of the since-removed elapsed-time bound,
24822488 // which deliberately accepted this very staleness.
24832489 await installMockBridge ( page , {
@@ -2551,12 +2557,11 @@ test("a send held open by a no-write step still revalidates at the publish bound
25512557 )
25522558 . toBeGreaterThan ( 0 ) ;
25532559
2554- await expect
2555- . poll ( ( ) => readOutgoingMentionPubkeys ( page , "@quinn hello" ) )
2556- . not . toBeNull ( ) ;
2557- await expect
2558- . poll ( ( ) => readOutgoingMentionPubkeys ( page , "@quinn hello" ) )
2559- . not . toContain ( ALLOWLIST_RELAY_AGENT_PUBKEY ) ;
2560+ await expect (
2561+ page . getByText ( "Could not authorize a mentioned agent." , { exact : false } ) ,
2562+ ) . toBeVisible ( ) ;
2563+ expect ( await readOutgoingMentionPubkeys ( page , "@quinn hello" ) ) . toBeNull ( ) ;
2564+ await expect ( input ) . toHaveText ( "@quinn hello" ) ;
25602565
25612566 const commands = await readCommandLog ( page ) ;
25622567 expect ( commandCount ( commands , "revalidate_relay_agents" ) ) . toBe (
@@ -3048,7 +3053,9 @@ test("a second mention while the first wake is in flight does not start the agen
30483053 await input . fill ( "Hey @fizz" ) ;
30493054 await expect ( dropdown . getByText ( "fizz" ) ) . toBeVisible ( ) ;
30503055 await input . press ( "Enter" ) ;
3051- await page . keyboard . type ( " do X" ) ;
3056+ await expect ( input . locator ( ".mention-chip" ) ) . toHaveText ( "fizz" ) ;
3057+ await page . keyboard . type ( "do X" ) ;
3058+ await expect ( input ) . toHaveText ( "Hey @fizz do X" ) ;
30523059 await page . getByTestId ( "send-message" ) . click ( ) ;
30533060 await expect (
30543061 page . getByTestId ( "message-row" ) . filter ( { hasText : "do X" } ) ,
@@ -3062,14 +3069,22 @@ test("a second mention while the first wake is in flight does not start the agen
30623069 await input . fill ( "Hey @fizz" ) ;
30633070 await expect ( dropdown . getByText ( "fizz" ) ) . toBeVisible ( ) ;
30643071 await input . press ( "Enter" ) ;
3065- await page . keyboard . type ( " also Y" ) ;
3072+ await expect ( input . locator ( ".mention-chip" ) ) . toHaveText ( "fizz" ) ;
3073+ await page . keyboard . type ( "also Y" ) ;
3074+ await expect ( input ) . toHaveText ( "Hey @fizz also Y" ) ;
30663075 await page . getByTestId ( "send-message" ) . click ( ) ;
30673076
30683077 // The second message publishes on its own — suppression is of the wake, not
30693078 // of the send; the composer is never gated on a pending start again.
30703079 await expect (
30713080 page . getByTestId ( "message-row" ) . filter ( { hasText : "also Y" } ) ,
30723081 ) . toBeVisible ( ) ;
3082+ expect ( await readOutgoingMentionPubkeys ( page , "Hey @fizz do X" ) ) . toContain (
3083+ IN_CHANNEL_MANAGED_AGENT_PUBKEY ,
3084+ ) ;
3085+ expect ( await readOutgoingMentionPubkeys ( page , "Hey @fizz also Y" ) ) . toContain (
3086+ IN_CHANNEL_MANAGED_AGENT_PUBKEY ,
3087+ ) ;
30733088 // One wake serves both messages: its replay floor predates the first
30743089 // message, and the floor is a lower bound, so one harness boot covers both.
30753090 expect ( commandCount ( await readCommandLog ( page ) , "start_managed_agent" ) ) . toBe (
0 commit comments