Skip to content

Commit cb9a063

Browse files
committed
ref(core): remove event task status projection
1 parent 49e24da commit cb9a063

7 files changed

Lines changed: 12 additions & 18 deletions

File tree

packages/docs/src/content/docs/extend/github-plugin.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ When `GITHUB_WEBHOOK_SECRET` is configured, GitHub tools can return subscribable
135135
pull request and issue resources. Junior can use those resources in two ways. A
136136
temporary resource watch sends matching updates back to the current Slack
137137
thread. A durable event task runs a stored instruction whenever its selected
138-
events occur and remains active for the Slack channel until someone deletes it.
138+
events occur and remains configured for the Slack channel until someone deletes
139+
it.
139140

140141
Both forms run headlessly as Junior, not as the webhook sender. Resource watches
141142
use the plugin's scoped installation credentials. Event tasks make their
@@ -159,7 +160,7 @@ Supported GitHub webhook deliveries become these Junior resource events:
159160
`pull_request.merged` and `pull_request.closed_unmerged` complete a temporary
160161
pull request watch after Junior accepts the event. Other watch events remain
161162
active until the watch expires or is cancelled. Event tasks do not complete
162-
after a terminal event; they remain active until deleted.
163+
after a terminal event; they remain configured until deleted.
163164

164165
Issue events can target one issue with `owner/repo#number` or every issue in a
165166
repository with `owner/repo`. Webhook events use normal queued delivery. They do
@@ -271,7 +272,7 @@ expected follow-up in the original conversation.
271272
- Deployment metadata is available but Junior never offers to watch it: `GITHUB_WEBHOOK_SECRET` is missing. Set it, redeploy, and run `github_getDeployment` again.
272273
- GitHub webhook delivery returns `401`: the webhook secret in GitHub App settings does not match `GITHUB_WEBHOOK_SECRET`, or GitHub did not send `X-Hub-Signature-256`. Update the app webhook secret and retry the delivery.
273274
- GitHub webhook delivery returns `202 Ignored`: the delivery was signed correctly but does not map to a supported deployment, pull request, or issue event. Use one of the configured event types above.
274-
- GitHub delivery succeeds but no Slack follow-up appears: confirm the destination has an active resource watch or event task for the same identifier and event type. A successful webhook alone does not create either one.
275+
- GitHub delivery succeeds but no Slack follow-up appears: confirm the destination has a resource watch or event task for the same identifier and event type. A successful webhook alone does not create either one.
275276
- Missing repository context: Junior could not determine which repository to use. Include `owner/repo` directly in the GitHub request, or configure a default GitHub repository for that thread, and retry.
276277
- A `403` response that says to use `github_createIssue` or `github_createPullRequest` is a Junior routing denial, not evidence of missing App permissions. Retry with the named tool.
277278
- Private OAuth prompt for a human-identity operation such as a pull request review: the actor has not authorized the GitHub App yet, or the stored user-to-server token expired. Complete the private authorization prompt; do not paste personal access tokens into the chat or sandbox.

packages/junior-evals/evals/event-tasks/management.eval.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describeEval("Event Task Management", slackEvals, (it) => {
257257
pass: [
258258
"The assistant first identifies the issue event task created for this channel even though the request comes from another thread.",
259259
"The assistant updates that task to react only to issue reopenings and confirms the new behavior.",
260-
"The assistant then deletes the same event task and confirms it is no longer active.",
260+
"The assistant then deletes the same event task and confirms it no longer exists.",
261261
],
262262
fail: [
263263
"Do not create a replacement event task.",
@@ -272,7 +272,6 @@ describeEval("Event Task Management", slackEvals, (it) => {
272272
tasks: [
273273
expect.objectContaining({
274274
id: "evt_issue_state_summary",
275-
status: "active",
276275
triggerAvailable: true,
277276
}),
278277
],
@@ -346,7 +345,6 @@ describeEval("Event Task Management", slackEvals, (it) => {
346345
tasks: [
347346
expect.objectContaining({
348347
id: "evt_unavailable_issue_summary",
349-
status: "active",
350348
triggerAvailable: false,
351349
}),
352350
],

packages/junior/src/chat/event-tasks/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export async function deleteEventTask(
7171
return rows[0] ? parseTask(rows[0].task) : undefined;
7272
}
7373

74-
/** List active event tasks in one Slack workspace. */
74+
/** List event tasks in one Slack workspace. */
7575
export async function listEventTasksForTeam(
7676
db: JuniorDatabase,
7777
teamId: string,
@@ -84,7 +84,7 @@ export async function listEventTasksForTeam(
8484
return rows.map((row) => parseTask(row.task));
8585
}
8686

87-
/** Find every active task matching one normalized resource event. */
87+
/** Find every task matching one normalized resource event. */
8888
export async function findMatchingEventTasks(
8989
db: JuniorDatabase,
9090
event: ResourceEvent,

packages/junior/src/chat/event-tasks/tool-support.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const MAX_LISTED_EVENT_TASKS = 50;
2323
const compactEventTaskResultSchema = z
2424
.object({
2525
id: z.string().min(1),
26-
status: z.enum(["active", "deleted"]),
2726
task: z.string().min(1),
2827
namespace: z.string().min(1),
2928
identifier: z.string().min(1),
@@ -148,7 +147,7 @@ export function eventTaskMatchesDestination(
148147
);
149148
}
150149

151-
/** Load one active task only when it belongs to this Slack channel or DM. */
150+
/** Load one task only when it belongs to this Slack channel or DM. */
152151
export async function writableEventTask(
153152
context: ToolRuntimeContext,
154153
id: string,
@@ -222,11 +221,9 @@ function triggerAvailable(
222221
export function compactEventTask(
223222
task: EventTask,
224223
catalog: ResourceEventCatalog,
225-
status: "active" | "deleted" = "active",
226224
) {
227225
return compactEventTaskResultSchema.parse({
228226
id: task.id,
229-
status,
230227
task: task.task.text,
231228
namespace: task.trigger.namespace,
232229
identifier: task.trigger.identifier,
@@ -243,9 +240,8 @@ export function compactEventTask(
243240
export function eventTaskSuccess(
244241
task: EventTask,
245242
catalog: ResourceEventCatalog,
246-
status: "active" | "deleted" = "active",
247243
) {
248-
const details = { task: compactEventTask(task, catalog, status) };
244+
const details = { task: compactEventTask(task, catalog) };
249245
return {
250246
ok: true as const,
251247
status: "success" as const,

packages/junior/src/chat/tools/create-event-task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function createEventTaskTool(
3636
},
3737
executionMode: "sequential",
3838
description:
39-
"Create a durable event task that executes the supplied instruction for every matching resource event. Use for whenever-this-happens-do-X automation; ordinary watch, notify, or tell-me-when requests use watchResourceEvents instead. The task remains active for this Slack channel or DM until deleted and may use the creator's connected credentials. Prefer a subscribable tool result when available.",
39+
"Create a durable event task that executes the supplied instruction for every matching resource event. Use for whenever-this-happens-do-X automation; ordinary watch, notify, or tell-me-when requests use watchResourceEvents instead. The task remains configured for this Slack channel or DM until deleted and may use the creator's connected credentials. Prefer a subscribable tool result when available.",
4040
inputSchema: z
4141
.object({
4242
task: z.string().trim().min(1).max(4000),

packages/junior/src/chat/tools/delete-event-task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function createDeleteEventTaskTool(
3737
"Event task was not found in this Slack channel or DM.",
3838
);
3939
}
40-
return eventTaskSuccess(deleted, catalog, "deleted");
40+
return eventTaskSuccess(deleted, catalog);
4141
},
4242
});
4343
}

packages/junior/tests/integration/event-tasks.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,11 @@ describe("event tasks", () => {
422422
createListEventTasksTool(context(), {}),
423423
{},
424424
)) as {
425-
tasks: Array<{ id: string; status: string; triggerAvailable: boolean }>;
425+
tasks: Array<{ id: string; triggerAvailable: boolean }>;
426426
};
427427
expect(listed.tasks).toEqual([
428428
expect.objectContaining({
429429
id: created.task.id,
430-
status: "active",
431430
triggerAvailable: false,
432431
}),
433432
]);

0 commit comments

Comments
 (0)