Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

NOTE: all releases may include dependency updates, not specifically mentioned

UNRELEASED

- fix: check topic actor status before publishing events [#918](https://github.com/hypermodeinc/modus/pull/918)

## 2025-06-25 - Runtime v0.18.2

- fix: validate inference history is valid json [#916](https://github.com/hypermodeinc/modus/pull/916)
Expand Down
6 changes: 6 additions & 0 deletions runtime/actors/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ func PublishAgentEvent(ctx context.Context, agentId, eventName string, eventData
}

topicActor := _actorSystem.TopicActor()
if !topicActor.IsRunning() {
// If the topic actor is not running, we cannot publish the event.
// This can happen during shutdown if the topic actor is stopped before the agent actors.
logger.Warn(ctx).Str("event", eventName).Any("data", eventData).Msg("Topic actor is not running. Cannot publish event.")
return nil
}

// if the pid is in context, we're being called as a host function
if pid, ok := ctx.Value(pidContextKey{}).(*goakt.PID); ok {
Expand Down
Loading