Skip to content

Resolve integration resources to VFS globs#343

Merged
khaliqgant merged 2 commits into
mainfrom
codex/integration-native-resource-globs
Jun 29, 2026
Merged

Resolve integration resources to VFS globs#343
khaliqgant merged 2 commits into
mainfrom
codex/integration-native-resource-globs

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • add relayfile integration resolve-path for provider-native resource to VFS glob translation
  • let integration bind/unbind accept native Slack, GitHub, Linear, and Telegram resources while preserving explicit / globs
  • warn on unresolved names and bind matcher-safe fallback globs instead of silent no-match paths

Tests

  • go test ./cmd/relayfile-cli -run 'TestIntegrationBind|TestHelp'\n\n## Coordination\n- Companion agent-relay PR will call relayfile integration resolve-path before subscribe/unsubscribe mutations.

Review in cubic

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@khaliqgant, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1660d2f6-09c6-481a-9db8-e7ad9f097816

📥 Commits

Reviewing files that changed from the base of the PR and between 89cb2df and 6646d07.

📒 Files selected for processing (2)
  • cmd/relayfile-cli/main.go
  • cmd/relayfile-cli/main_test.go
📝 Walkthrough

Walkthrough

Adds a relayfile integration resolve-path subcommand and an internal VFS resolver (resolveIntegrationBindPathGlob) that converts provider-native resource identifiers (e.g. slack general, github owner/repo) into matcher-safe VFS path globs. The bind and unbind commands are updated to invoke this resolver automatically when their path argument is not /-prefixed.

Integration Resource Path Resolution

Layer / File(s) Summary
Core resolver implementation
cmd/relayfile-cli/main.go
Defines integrationBindPathResolution, integrationContainerResolver, and resolveIntegrationBindPathGlob (~460 lines). Handles GitHub owner/repo/github/repos/<owner>/<repo>/**, and container-based providers (Slack, Telegram, Linear) via VFS index/alias directory inspection with slugification, JSON field extraction, direct-ID lookup, and fallback-glob-with-warning.
bind/unbind wiring
cmd/relayfile-cli/main.go
integration bind calls the resolver for non-absolute second positional args, stores the resolved PathGlob, and prints any warning. integration unbind resolves non-absolute pathGlob/--resource before matching stored bindings.
resolve-path subcommand and help text
cmd/relayfile-cli/main.go
Adds runIntegrationResolvePath with --json flag; wires it into the runIntegration switch; updates printIntegrationUsage and printUsage with the new command entry.
Tests and changelog
cmd/relayfile-cli/main_test.go, packages/cli/CHANGELOG.md
TestIntegrationBindResolvesNativeResources runs integration bind across slack/github/linear/telegram with fixture mount files, verifying alias resolution, fallback warnings, and unknown-provider rejection. writeTestMountFile materializes fixture directories. Changelog documents the fix under Unreleased.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐇 Hoppity-hop through the VFS maze,
A glob for your channel, a path for your days!
Slack, GitHub, Linear — all neatly resolved,
No mystery resource that can't be absolved.
The rabbit sniffs slugs and JSON with glee,
And warns when a fallback is all it can see! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: resolving integration resources into VFS globs.
Description check ✅ Passed The description matches the changeset and accurately describes the new resolver, bind/unbind behavior, and warning fallback.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/integration-native-resource-globs

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the relayfile integration bind command to accept provider-native resources (for Slack, GitHub, Linear, and Telegram) and resolve them to VFS path globs, and introduces a new resolve-path subcommand. The code review identified three main improvement opportunities: caching the active workspace record to prevent redundant process spawns and severe performance degradation, ensuring only .json files are processed during alias scanning to avoid parsing failures, and using byte-based indexing in isUUIDLike to prevent issues when iterating over strings with multi-byte characters.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread cmd/relayfile-cli/main.go
Comment thread cmd/relayfile-cli/main.go Outdated
Comment thread cmd/relayfile-cli/main.go
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Relayfile Eval Review

Run: .relayfile/evals/runs/2026-06-29T22-08-37-006Z-HEAD-provider
Mode: provider
Git SHA: a24bda4

Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0

Human Review Cases

No reviewable human-review cases captured Relayfile output.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89cb2dff1a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmd/relayfile-cli/main.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/relayfile-cli/main.go`:
- Around line 2461-2470: Make native-resource unbind tolerate previously stored
fallback globs: the current re-resolution in the pathGlob handling causes a
later canonical glob to miss an older broad binding and report “no binding
found.” Update the unbind flow around resolveIntegrationBindPathGlob and the
binding lookup/match logic so it can match and remove stored fallback/broad
globs for the same native resource, even when the current mount resolves to a
narrower pathGlob.
- Around line 712-713: The help text for the `bind` and `unbind` command paths
still only advertises `PATH_GLOB`, so update the usage strings in `main.go`
alongside the `resolve-path` usage to mention provider-native resource inputs as
valid alternatives. Make the change in the command/help definitions for `bind`
and `unbind` (and any shared usage helpers they use) so the new native-resource
flow is visible without requiring users to discover `resolve-path` first.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 86e7df3d-2b23-4e9d-856b-e737ac2609a1

📥 Commits

Reviewing files that changed from the base of the PR and between b1a973c and 89cb2df.

📒 Files selected for processing (3)
  • cmd/relayfile-cli/main.go
  • cmd/relayfile-cli/main_test.go
  • packages/cli/CHANGELOG.md

Comment thread cmd/relayfile-cli/main.go
Comment thread cmd/relayfile-cli/main.go Outdated
@agent-relay-code

Copy link
Copy Markdown
Contributor

⚠️ pr-reviewer did not push — the PR branch advanced during the review, so fixes were withheld to avoid overwriting newer commits. Re-trigger the review once the branch settles. The notes below are advisory and were not pushed.

I made no file edits — everything was already clean (formatting, lint, types, tests all pass). Here is my review.


PR Review: #1213 — integration subscribe native-resource globs + idempotency

Summary

This PR makes agent-relay integration subscribe:

  1. Resolve provider-native --resource values (e.g. #watchdog-test) through relayfile (resolvePath) to a VFS glob before binding, while keeping explicit /-prefixed globs working.
  2. Idempotent and multi-resource-per-provider: webhook names are now scoped per (provider, resource) via a hashed/slugged prefix plus a per-attempt nonce, so two resources routed to the same relay channel no longer collide on the unique (workspace, name) index.
  3. Create-first/retire-after on re-subscribe, so a transient failure can't leave the user with no working binding; failed cleanup now warns instead of being swallowed.
  4. Normalizes the relay channel id (strips both # and @) consistently, and maps relayfile's pathGlob field in listBindings.

The change is well-scoped to the subscribe/unsubscribe path. No lifecycle/reaper/dispatch/broker-ownership code is touched.

Verification

  • npm run typecheck (builds config/cloud/utils/policy/sdk/harness-driver/harnesses/fleet, then tsc --noEmit on cli): passed, 0 errors.
  • packages/cli/.../integration-subscribe.test.ts + relaycast-groups.test.ts: 29 passed.
  • npm run lint: 0 errors (17 pre-existing complexity/naming warnings, none in the changed files).
  • prettier --check on all changed files: clean.
  • Traced RelayfileBridge consumers: the only implementers/mocks are defaultRelayfileBridge (production, implements resolvePath) and the two test files (both updated to add the resolvePath mock). No other caller is broken by the new interface method.

I made no file edits — the working tree was already clean on formatting, lint, types, and tests, and the remaining items are logic observations that need human judgment (left as comments below, not changed).

Addressed comments

  • CodeRabbit / pr-reviewer (prior commits bd34215, a71342a, 3349848): These addressed subscribe idempotency, cleanup hardening, and resolving integration resources before subscribe. Validated against the current checkout — the hardening they asked for is present (create-first ordering at integration.ts:611-651, warnCleanup surfacing at :491-495, fail-fast findExistingBinding at :498-508, active-binding guard at :551-559). Stale — already handled by these later commits; nothing left to change.
  • No open/unresolved bot or human review comments were present in .workforce/context.json (no comments array) or the diff.

Observations (no code changes — for human judgment)

  1. resolvePath is now mandatory on every subscribe/unsubscribe (behavior change, looks intended). runSubscribe (integration.ts:590) and runUnsubscribe (:667) now always call deps.relayfile.resolvePath. If the installed relayfile CLI predates integration resolve-path, runRelayfile will reject and the command fails hard rather than falling back to treating the raw --resource as the glob. This is consistent with the PR's intent (the --resource help text now documents both native and /-prefixed forms), and resolvePath should be an identity for already-glob inputs server-side — but it does raise the minimum relayfile version. Worth confirming the relayfile release that ships resolve-path is a hard dependency, or noting the version bump in the changelog. Not a code defect; flagging for release coordination.

  2. webhookNamePrefix truncates the slug to 40 chars before appending -<hash>. Uniqueness is carried by the 10-char sha1 of the full resource (:473), so truncation only affects the human-readable stem, not correctness. Two distinct resources sharing a 40-char slug prefix still get distinct hashes and distinct prefixes. No issue — noted for completeness.

  3. runUnsubscribe error message uses the user's raw resource, not resolvedResource (:671, :693). This is intentional and user-friendly (shows what they typed). The actual match and unbind correctly use resolvedResource. No change needed.

Advisory Notes

None — the PR is self-contained to the subscribe/unsubscribe feature and its tests; no unrelated cleanup is warranted.


The PR is internally consistent, fully builds and typechecks, lint is clean, and all 29 relevant tests pass. The remaining items above are advisory and require human judgment (the relayfile minimum-version coordination in particular), but none block merge from a code-correctness standpoint. I cannot confirm full-CI status (other workflow jobs, mergeable/conflict state) from this sandbox, so I am not declaring it human-ready.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread cmd/relayfile-cli/main.go Outdated
@khaliqgant khaliqgant merged commit 43905b2 into main Jun 29, 2026
9 checks passed
@khaliqgant khaliqgant deleted the codex/integration-native-resource-globs branch June 29, 2026 22:24
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