[Grid agent] Implement public-chat and instant-message interaction behavior #123

Closed
opened 2026-08-17 19:31:35 +00:00 by hugo · 1 comment
Owner

Objective

Implement realistic public-chat and one-to-one instant-message interaction using the same normalized conversation pipeline while preserving their different trust and lifetime rules.

Inbound behavior

  • Subscribe through native AgentManager chat and IM events. Ignore self echoes, typing/status noise, unsupported dialog kinds, malformed/oversized messages, duplicate delivery, and muted senders according to documented rules.
  • In public chat, respond when the agent is explicitly addressed by name/mention, receives a direct greeting/question within a bounded nearby context, or is completing its own pending interaction. Do not answer every ambient line. Authorized residents still cannot issue commands in public.
  • One-to-one IM uses the 24-hour session and policy role derived from the sender UUID. Unauthorized IM behaves like informational public chat; authorized IM may request allow-listed commands.
  • Queue fairly per avatar, cap global concurrent inference, debounce rapid message fragments, preserve order, and emit a brief busy/failure response only when useful. A slow sender or model must not block grid lifecycle events.

Outbound behavior

  • Generate concise in-world responses with configured maximum length, split only on UTF-8 boundaries according to grid limits, and rate-limit chat/IM independently.
  • Prevent accidental mention floods, chat loops with bots, duplicate responses after reconnect, and reflection of control/audit data into world chat.
  • Associate every response with the triggering event/session and record delivery success or failure. Never leak prompts, tool schemas, authorization lists, endpoint data, or secrets.
  • Publish an attention request when replying to nearby public speakers; physical turning is implemented by the presence issue.

Acceptance criteria

  • Fake-grid tests cover mentions, aliases, ambient chat, authorized-public command denial, authorized/unprivileged IM, expiry integration, Unicode splitting, duplicate/self suppression, fairness, rate limits, model timeout, disconnect, and reconnect.
  • A malicious message cannot alter authorization or cause a non-allow-listed tool to execute.
  • Public informational queries and the separately policy-gated LSL request intent are routed correctly.
  • Shutdown/reconnect leaves no subscribed handler or pending outbound message duplicated.

Dependencies

Depends on lifecycle, sessions, LLM transport, and policy. It does not itself implement LSL delivery or world movement.

## Objective Implement realistic public-chat and one-to-one instant-message interaction using the same normalized conversation pipeline while preserving their different trust and lifetime rules. ## Inbound behavior - Subscribe through native `AgentManager` chat and IM events. Ignore self echoes, typing/status noise, unsupported dialog kinds, malformed/oversized messages, duplicate delivery, and muted senders according to documented rules. - In public chat, respond when the agent is explicitly addressed by name/mention, receives a direct greeting/question within a bounded nearby context, or is completing its own pending interaction. Do not answer every ambient line. Authorized residents still cannot issue commands in public. - One-to-one IM uses the 24-hour session and policy role derived from the sender UUID. Unauthorized IM behaves like informational public chat; authorized IM may request allow-listed commands. - Queue fairly per avatar, cap global concurrent inference, debounce rapid message fragments, preserve order, and emit a brief busy/failure response only when useful. A slow sender or model must not block grid lifecycle events. ## Outbound behavior - Generate concise in-world responses with configured maximum length, split only on UTF-8 boundaries according to grid limits, and rate-limit chat/IM independently. - Prevent accidental mention floods, chat loops with bots, duplicate responses after reconnect, and reflection of control/audit data into world chat. - Associate every response with the triggering event/session and record delivery success or failure. Never leak prompts, tool schemas, authorization lists, endpoint data, or secrets. - Publish an attention request when replying to nearby public speakers; physical turning is implemented by the presence issue. ## Acceptance criteria - [ ] Fake-grid tests cover mentions, aliases, ambient chat, authorized-public command denial, authorized/unprivileged IM, expiry integration, Unicode splitting, duplicate/self suppression, fairness, rate limits, model timeout, disconnect, and reconnect. - [ ] A malicious message cannot alter authorization or cause a non-allow-listed tool to execute. - [ ] Public informational queries and the separately policy-gated LSL request intent are routed correctly. - [ ] Shutdown/reconnect leaves no subscribed handler or pending outbound message duplicated. ## Dependencies Depends on lifecycle, sessions, LLM transport, and policy. It does not itself implement LSL delivery or world movement.
hugo added this to the 14 - metacrate grid agent milestone 2026-08-17 19:31:35 +00:00
hugo added the enhancement label 2026-08-17 19:31:35 +00:00
Author
Owner

Implemented in commit 26fd2bf.

This adds the complete bounded public-chat and one-to-one IM pipeline: native AgentManager subscriptions and egress, normalized malformed/self/muted/status/object/duplicate suppression, alias/mention/direct-nearby/pending public admission, public command denial, 24-hour IM memory, UUID-derived authorization, intent-specific capability filtering, fair per-avatar debounce queues, global inference limits, independent channel rate limits, UTF-8 grid splitting, generation-fenced delivery, reflection/mention/secret controls, content-free delivery observations, attention requests, and exact subscription/task shutdown.

Focused verification:

  • 10 interaction fake-grid unit cases passed (mentions, aliases, ambient/direct/pending public chat, auth routing, expiry, Unicode, rate limits, fairness, timeout, malformed/oversized input, disconnect/reconnect, egress safety and reflection)
  • conversation_memory, dependency_policy, llm_transport (14 cases, including unknown tool non-execution), policy_gateway (3 cases), and session_supervisor integrations all passed
  • cargo clippy -p metacrate-grid-agent --all-targets -- -D warnings passed
  • rustdoc with warnings denied, example configuration validation, explicit Linux target check, formatting/diff checks, and cargo deny all passed
  • live-grid code passed feature-enabled type checking and clippy against the exact native API surface; two full libremetaverse feature builds reached that generated crate and were SIGKILLed by this runners memory ceiling without a Rust diagnostic

No credentials or .env content were read or committed.

Implemented in commit 26fd2bf. This adds the complete bounded public-chat and one-to-one IM pipeline: native AgentManager subscriptions and egress, normalized malformed/self/muted/status/object/duplicate suppression, alias/mention/direct-nearby/pending public admission, public command denial, 24-hour IM memory, UUID-derived authorization, intent-specific capability filtering, fair per-avatar debounce queues, global inference limits, independent channel rate limits, UTF-8 grid splitting, generation-fenced delivery, reflection/mention/secret controls, content-free delivery observations, attention requests, and exact subscription/task shutdown. Focused verification: - 10 interaction fake-grid unit cases passed (mentions, aliases, ambient/direct/pending public chat, auth routing, expiry, Unicode, rate limits, fairness, timeout, malformed/oversized input, disconnect/reconnect, egress safety and reflection) - conversation_memory, dependency_policy, llm_transport (14 cases, including unknown tool non-execution), policy_gateway (3 cases), and session_supervisor integrations all passed - cargo clippy -p metacrate-grid-agent --all-targets -- -D warnings passed - rustdoc with warnings denied, example configuration validation, explicit Linux target check, formatting/diff checks, and cargo deny all passed - live-grid code passed feature-enabled type checking and clippy against the exact native API surface; two full libremetaverse feature builds reached that generated crate and were SIGKILLed by this runners memory ceiling without a Rust diagnostic No credentials or .env content were read or committed.
hugo closed this issue 2026-08-17 23:12:13 +00:00
Sign in to join this conversation.