Skip to content

feat(webhook-listener): inject issue context on label bootstrap#147

Merged
SteveJRobertson merged 2 commits into
mainfrom
146-inject-issue-context-on-bootstrap
Jun 4, 2026
Merged

feat(webhook-listener): inject issue context on label bootstrap#147
SteveJRobertson merged 2 commits into
mainfrom
146-inject-issue-context-on-bootstrap

Conversation

@SteveJRobertson

Copy link
Copy Markdown
Owner

Summary

Closes #146

Fixed webhook listener's bootstrap label handler to inject issue title and body as initial context. When an issue is labeled with a whitelisted label (e.g., type: chore), the po agent now receives the issue title and body as an initial human message instead of starting with an empty message history.

Changes

apps/webhook-listener/src/routes/webhook.ts

  • Extended LabeledEventPayloadSchema to include title: z.string() and body: z.string().nullable() on the issue object
  • Updated issues.labeled handler to destructure issueTitle and issueBody from the webhook payload
  • Added messages field to graph.run() call with initial context injection

apps/webhook-listener/src/routes/webhook.spec.ts

  • Updated all 12 labeled event test payloads to include title and body fields
  • Updated all 6 graph.run assertions to expect the new messages field with injected context
  • Added new test case: labeled event with null issue body: omits body from context message

Test Results

  • ✅ All 171 webhook-listener tests pass
  • ✅ All 496 workspace tests pass (no regressions)
  • ✅ Lint & Typecheck: Clean

Copilot Review Triage

  • Blocker — No security/correctness violations
  • Major — Complete error handling for all async operations
  • Minor — Full test coverage including null body edge case
  • Nit — Code style follows project conventions

Deferred follow-ups

None.

Copilot AI review requested due to automatic review settings June 4, 2026 20:52
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
isolate-ui Ignored Ignored Preview Jun 4, 2026 9:11pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the webhook-listener’s issues.labeled bootstrap path so the LangGraph thread starts with an initial human message containing the GitHub issue title/body (fixing empty message history for the po agent when label bootstrapping).

Changes:

  • Extended the issues.labeled webhook payload Zod schema to include issue.title and issue.body (nullable).
  • Injected an initial messages: [{ type: 'human', content: ... }] context message into graph.run() for label bootstrap.
  • Updated labeled-event tests to include title/body and assert the new messages payload.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
apps/webhook-listener/src/routes/webhook.ts Adds issue title/body extraction and injects a human context message into the bootstrap graph.run() call.
apps/webhook-listener/src/routes/webhook.spec.ts Updates labeled webhook payload fixtures and graph.run assertions to include the injected context message.

Comment thread apps/webhook-listener/src/routes/webhook.spec.ts
Comment thread apps/webhook-listener/src/routes/webhook.spec.ts
Comment thread apps/webhook-listener/src/routes/webhook.ts
…dy bootstrap test

- Replace .trim() pattern with conditional expression in graph.run message
  content; avoids stripping trailing whitespace from non-null issue bodies
- Add bootstrap-triggering test for null issue body asserting message content
  contains only the title with no appended blank line or body
@SteveJRobertson SteveJRobertson merged commit 9a68500 into main Jun 4, 2026
6 checks passed
@SteveJRobertson SteveJRobertson deleted the 146-inject-issue-context-on-bootstrap branch June 4, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: AI agents receive empty message history on label bootstrapping

2 participants