Skip to content

feat(core): run tasks from resource events - #1176

Open
dcramer wants to merge 6 commits into
codex/resource-event-catalog-mainfrom
codex/core-event-tasks
Open

feat(core): run tasks from resource events#1176
dcramer wants to merge 6 commits into
codex/resource-event-catalog-mainfrom
codex/core-event-tasks

Conversation

@dcramer

@dcramer dcramer commented Jul 31, 2026

Copy link
Copy Markdown
Member

Built on #1191, which replays the plugin resource-event catalog reviewed in #1184 directly onto main. Junior core persists event tasks that execute a durable instruction whenever an enabled plugin publishes a matching normalized resource event. The Slack tools search the runtime plugin catalog and create, list, update, or delete tasks for the current channel or DM. One task may select multiple event types, and multiple tasks may match the same resource.

Plugins only own webhook verification, event normalization, and catalog registration. Core owns configured tasks and matching. Every match starts an independent top-level Slack job through the existing agent-dispatch path; its state-backed idempotency key combines the task with the provider event key so webhook retries do not execute the same task twice. SQL stores only configured tasks: presence means the task exists, and deletion removes the row. There is no active/deleted status, pause state, tombstone, or separate run-history system.

Event tasks use the creator's connected credentials by default when the stored work needs user-bound access. Anyone in the same Slack destination can manage the task, while only the original creator can enable creator credential use; another actor changing executable instructions or the trigger clears that delegation. GitHub issue guidance supports one issue or repository-wide issue activity and multiple selected issue states in one task.

A code TODO records the remaining circuit-breaker work for runaway event loops rather than imposing an arbitrary execution quota in this change.

Refs #1174

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Aug 2, 2026 6:17pm

Request Review

Comment thread packages/junior/src/chat/event-tasks/store.ts Outdated
Comment thread packages/junior/src/chat/tools/event-tasks.ts Outdated
Comment thread packages/junior/src/chat/event-tasks/ingest.ts
Comment thread packages/junior/src/chat/tools/event-tasks.ts Outdated
Comment thread packages/junior/migrations/0014_normal_kat_farrell.sql Outdated
Comment thread packages/junior/src/chat/tools/event-tasks.ts Outdated
Comment thread packages/junior/src/chat/event-tasks/ingest.ts Outdated
Comment thread packages/junior/src/chat/tools/event-tasks.ts Outdated
Comment thread packages/junior/src/chat/tools/event-tasks.ts Outdated
Comment thread packages/junior/src/chat/event-tasks/ingest.ts
Comment thread packages/junior/src/chat/event-tasks/ingest.ts Outdated
@dcramer
dcramer force-pushed the codex/core-event-tasks branch from f867633 to 005cf8e Compare August 2, 2026 04:28
@dcramer
dcramer force-pushed the codex/resource-event-catalog branch from a23f94b to db2d33c Compare August 2, 2026 04:31
@dcramer
dcramer force-pushed the codex/core-event-tasks branch from 005cf8e to 167edf3 Compare August 2, 2026 04:32
@dcramer
dcramer force-pushed the codex/resource-event-catalog branch from db2d33c to 7aee0d0 Compare August 2, 2026 05:06
@dcramer
dcramer force-pushed the codex/core-event-tasks branch from 167edf3 to d839b87 Compare August 2, 2026 05:06
@dcramer
dcramer changed the base branch from codex/resource-event-catalog to main August 2, 2026 05:34
@dcramer
dcramer force-pushed the codex/core-event-tasks branch from d839b87 to c1c466d Compare August 2, 2026 05:34
@dcramer
dcramer changed the base branch from main to codex/resource-event-catalog August 2, 2026 05:34
Base automatically changed from codex/resource-event-catalog to codex/fix-participation-elaboration-eval August 2, 2026 15:36
@dcramer
dcramer force-pushed the codex/core-event-tasks branch from c1c466d to 11cf12d Compare August 2, 2026 15:39
Comment thread packages/junior/src/chat/event-tasks/ingest.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f6ef4ea. Configure here.

Comment thread packages/junior/src/chat/tools/update-event-task.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant