Repository navigation
fix(slack): Attribute current instructions by author - #772
Merged
Merged
Conversation
Preserve Slack author metadata in model-facing current-instruction tags and keep passive queued thread messages as recent context instead of folding them into the active instruction. This avoids first-person follow-ups inheriting the wrong actor in group threads while keeping broader memory and auth behavior out of scope. Add an eval for a cross-participant first-person follow-up and remove the legacy unwrapped prompt matching path. Co-Authored-By: GPT-5 Codex <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
marked this pull request as ready for review
July 7, 2026 01:58
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7a147d5. Configure here.
Compute durable prompt history before appending queued instructions so fresh passive thread context is still included on first-turn batches. Treat recent-thread-messages as structured context instead of wrapping it as generic background. Co-Authored-By: GPT-5 Codex <[email protected]>
Update CI-covered assertions for authored Slack steering. Queued explicit mentions are prompt history now, while the active instruction remains the latest message. Remove obsolete legacy resume prompt expectations and keep exact current-instruction duplicate checks covered. Co-Authored-By: GPT-5 Codex <[email protected]>
Return undefined instead of an empty string when no prompt context exists, and keep prepared conversation context available alongside durable Pi history. Align the active-turn steering assertion with deferred passive follow-up behavior. Co-Authored-By: GPT-5 Codex <[email protected]>
This was referenced Jul 7, 2026
dcramer
added a commit
that referenced
this pull request
Jul 7, 2026
…ss support (#774) Adds TDD eval coverage for the actor/instruction provenance work in #773: four multi-user Slack thread scenarios where Alice is the run requester and Bob is another participant, asserting against the memory plugin's stored rows plus a reply-attribution rubric. Two cases are **intentionally red** — they are the acceptance gates for the provenance fix, not eval bugs: - **Batched cross-actor mention**: when Bob's pending mention batches into Alice's turn, the reply attributes his first-person preference to Alice ("You asked for short bullet summaries" — she didn't). Reproduced through the real mailbox batching path; whether it fails on a given run depends on the model honoring prompt-text author labels from #772, which is exactly the fragility the provenance fix removes. - **Cross-author conversation knowledge** (fails deterministically): operational knowledge stated by a passive participant never reaches passive memory extraction today — it only exists in runtime context blocks that `stripRuntimeTurnContext` removes from the plugin transcript, so no conversation-scoped memory is ever created from it. The two sequential-turn cases pass today and guard against over-tightening: per-turn attribution already holds when each message gets its own run, and the fix must not break that. To make the batched arrangement expressible, the eval harness gains a `batch()` event builder (`message_batch` event). Batch members persist through the real Slack ingress boundary (`buildSlackInboundMessage` → `appendAndEnqueueInboundMessage`) and are claimed by the real conversation worker as one mailbox batch — the last message becomes the live turn, earlier ones arrive as queued context, exactly the production flow. Two harness seams support this: worker-claimed turns deliver through the harness `TestThread` (the worker's restored thread has no posting surface on the eval adapter), and the `FakeSlackAdapter` fixture gains single-workspace internals (`botUserId`, `defaultBotTokenProvider`) so `runWithSlackInstallation` treats it as a default-token install. Non-batch events keep the existing direct delivery path unchanged. Review order: `src/helpers.ts` (the `batch()` builder), `src/behavior-harness.ts` (the `message_batch` ingress path and worker thread seam), then the eval file. Refs #773 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <[email protected]>
This branch was successfully deployed
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.

Slack thread prompts now preserve the author on each current instruction, including mid-run steering, so first-person follow-ups in group threads are not implicitly attributed to the active requester. Passive skipped Slack messages are kept as recent thread context instead of being concatenated into the active instruction, and stale legacy prompt matching was removed.
The eval coverage exercises the user-visible actor-attribution behavior with Alice and Ryan giving conflicting first-person preferences. The deterministic integration coverage stays focused on runtime wiring: explicit follow-ups steer, passive queued text remains context, and passive text is no longer part of the active instruction.
Open concerns for follow-up: