Skip to content

fix: allow bot completion event reads - #1684

Merged
ColeMurray merged 1 commit into
mainfrom
fix/bot-completion-rbac
Aug 31, 2026
Merged

fix: allow bot completion event reads#1684
ColeMurray merged 1 commit into
mainfrom
fix/bot-completion-rbac

Conversation

@ColeMurray

@ColeMurray ColeMurray commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • allow the Slack and Linear bot services to read session events and artifacts without an asserted user actor
  • keep the exception scoped to the two completion-extractor endpoints and protected by each service's sessions.read permission ceiling
  • add route-policy and integration coverage for the exact actorless allowlist

Root cause

The RBAC HTTP-boundary change made GET /sessions/:id/events and GET /sessions/:id/artifacts actor-required routes. Slack and Linear completion callbacks use the shared extractor after the original request has completed, and the queued callback does not carry an actor assertion. Production telemetry confirmed Slack authenticated successfully as a service principal but was rejected with HTTP 403 before any D1 query.

The media endpoint already has the equivalent narrow Slack actorless grant; this change restores the prerequisite completion reads without weakening other session routes.

Validation

  • npm test -w @open-inspect/control-plane -- src/router.policy.test.ts
  • npm run test:integration -w @open-inspect/control-plane -- test/integration/service-auth.test.ts
  • npm run typecheck -w @open-inspect/control-plane
  • npm run build -w @open-inspect/control-plane
  • ESLint and Prettier checks on changed files

Created with Open-Inspect

Summary by CodeRabbit

  • New Features

    • Slack and Linear bot integrations can now access session event and artifact completion-read endpoints without a user actor.
  • Bug Fixes

    • Corrected authorization for actorless session completion reads while preserving existing restrictions on unrelated callbacks and media access.

@github-actions

Copy link
Copy Markdown

Terraform Validation Results

Step Status
Format
Init
Validate
Tests

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @ColeMurray, Action: pull_request

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3efd8147-e296-4b16-8327-082e6c035002

📥 Commits

Reviewing files that changed from the base of the PR and between 1937461 and 6f09194.

📒 Files selected for processing (3)
  • packages/control-plane/src/router.policy.test.ts
  • packages/control-plane/src/routes/session-runtime-proxy.ts
  • packages/control-plane/test/integration/service-auth.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The session events and artifacts routes now permit actorless Slack and Linear bot grants. Router policy and service authorization integration tests verify the new access.

Changes

Actorless completion-read access

Layer / File(s) Summary
Completion-read authorization and policy
packages/control-plane/src/routes/session-runtime-proxy.ts, packages/control-plane/src/router.policy.test.ts
The events and artifacts routes now grant sessions.read access to actorless slack-bot and linear-bot services. Router policy tests verify the grants and route allowlist.
Actorless completion-read integration coverage
packages/control-plane/test/integration/service-auth.test.ts
The integration test verifies that actorless Slack and Linear requests to the events and artifacts endpoints do not return 403.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: 🟡 Moderate · up to 6f091

This PR lets Slack and Linear services read session events and artifacts without a user actor. Because access is scoped to the service and endpoint rather than the originating session, a valid service credential could read another session's data; merge should wait for resource scoping or explicit security-owner acceptance.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: allowing bot services to read completion events. It is concise and related to the actorless completion-read authorization changes, although it does not me…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title clearly identifies the main change: allowing bot services to read completion events. It is concise and related to the actorless completion-read authorization changes, although it does not mention artifact reads or the specific services.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bot-completion-rbac

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@open-inspect open-inspect Bot 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.

Deep maintainability review found no structural regressions or actionable code-quality blockers. The change stays within the existing declarative actorless-grant policy rather than adding handler-level special cases, keeps both completion reads under the canonical sessions.read service ceiling, and adds exact allowlist coverage at both the route-policy and integration boundaries. No changed file crosses or approaches the 1k-line decomposition threshold.

Validated locally with the focused router policy tests, service-auth integration tests, and control-plane typecheck.

@ColeMurray
ColeMurray merged commit a925f44 into main Aug 31, 2026
13 checks passed
@ColeMurray
ColeMurray deleted the fix/bot-completion-rbac branch August 31, 2026 17:03

@open-inspect open-inspect Bot 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.

Summary

PR #1684, fix: allow bot completion event reads, by @ColeMurray updates 3 files (+22/-3) to permit actorless Slack and Linear service principals to read session events and artifacts for completion extraction. The change is narrowly scoped, remains constrained by each service permission ceiling, and has appropriate route-policy and integration coverage.

Critical Issues

None.

Suggestions

None.

Nitpicks

None.

Positive Feedback

  • The actorless grants are limited to the two required read endpoints and the two intended services.
  • The existing sessions.read service ceiling remains enforced after actorless grant matching.
  • Tests verify the exact policy allowlist and exercise both services against both completion-read routes.

Questions

None.

Verdict

Approve

Validation: all 100 focused route-policy tests and all 32 focused service-auth integration tests pass; control-plane typechecking also passes.

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.

1 participant