feat(runner): inline raw event payload into agent prompt - #84
Merged
Conversation
The runner delivered only a minimal <event> summary block (type, org, repo, issue/pr number, actor) to the agent, discarding the full webhook payload that the hub already delivered in task.payload. Agents had no way to see comment bodies, issue titles or other event details without guessing tool calls. Append the raw payload as an <event-data> JSON block after the event summary, capped by EVENT_DATA_MAX_CHARS (default 16000 chars) using the existing head+tail truncateWithMarker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The runner only prompted agents with a minimal
<event>summary block:even though the hub already delivered the full webhook payload in
task.payload. Comment bodies, issue titles/bodies and all other event details never reached the model, so e.g. a@review-agent wdyt?mention left the agent blind to what it was supposed to review.Changes
buildUserMessagenow appends the raw payload as a pretty-printed<event-data>JSON block after the event summaryEVENT_DATA_MAX_CHARSenv (default 16,000 chars), truncated head+tail with the existingtruncateWithMarkerEVENT_DATA_MAX_CHARSto the transcript-redaction denylist (non-sensitive config)Notes
No payload filtering: whatever the webhook delivered is inlined (subject to the char cap). Payload content goes into the prompt, not the transcript store.
Test plan
npm testinpi/pi-extensions/ainsel-runner— 83/83 pass (10 new tests: payload inlining, null/chat omission, truncation marker,resolveEventDataMaxCharsdefault/invalid/valid)@agenton a PR, verify the prompt contains the full event JSON