Skip to content

ci: add 6 new workflows, Blacksmith runners, and CI speed optimizations#9

Merged
volnei merged 6 commits intomainfrom
devin/1771432476-add-ci-workflows
Feb 18, 2026
Merged

ci: add 6 new workflows, Blacksmith runners, and CI speed optimizations#9
volnei merged 6 commits intomainfrom
devin/1771432476-add-ci-workflows

Conversation

@dhairyashiil
Copy link
Member

@dhairyashiil dhairyashiil commented Feb 18, 2026

ci: add 6 new CI workflows + speed optimizations to companion

Summary

Adds CI workflows ported/adapted from calcom/cal to improve companion's CI coverage. Currently companion only has lint, typecheck, and build jobs.

New workflows:

  1. Security Audit — runs bun pm untrusted and attempts a vulnerability audit on PRs and pushes to main
  2. Semantic PR Titles — enforces conventional commit format on PR titles with a sticky comment explaining errors
  3. Bundle Size Analysis — builds the browser extension, measures .output/ size, uploads baseline on main. On PRs, only posts a comment if the bundle size increases by more than 5KB compared to main (silent when size is stable or decreasing)
  4. PR Labeler — auto-labels PRs based on changed files (extension, mobile, config, ci, api) and propagates labels from linked issues
  5. Cache Cleanup — deletes GitHub Actions caches for a branch when its PR is closed
  6. Changes Requested → Re-draft — auto-converts PRs back to draft when a reviewer requests changes (two-workflow pattern for fork support)

CI speed optimizations (applied to existing ci.yml and new workflows):

  • Blacksmith runners — switched compute-heavy jobs (build, bundle-analysis) to blacksmith-4vcpu-ubuntu-2404 and lighter jobs (lint, typecheck, security-audit, cache-clean) to blacksmith-2vcpu-ubuntu-2404 for ~2x faster execution. Trivial GitHub API workflows (labeler, semantic-pull-requests, re-draft, on-changes-requested) remain on ubuntu-latest.
  • Concurrency groups on ci.yml, security-audit.yml, and bundle-analysis.yml — cancels in-progress runs when a new push arrives on the same PR
  • Build caching for the Expo web export (dist/) and browser extension (.output/) in the build job — skips rebuilds when source files haven't changed
  • Dependency caching added to security-audit.yml (was already present in ci.yml via setup-bun)

Review & Testing Checklist for Human

  • Blacksmith must be enabled for the companion repo: If Blacksmith is only configured for calcom/cal and not org-wide or calcom/companion specifically, every CI job on a Blacksmith runner will fail with a "no matching runner" error. Verify in the Blacksmith console before merging.
  • Security audit is effectively a no-op: bunx audit is not a real Bun command. Both steps end with || true so the job will never fail on vulnerabilities. Consider replacing with npm audit --production --audit-level=critical or removing || true from the critical step — otherwise this workflow only provides false confidence.
  • Build cache glob completeness: The Expo web cache key hashes app/**, components/**, hooks/**, etc. but does not include utils/**, global.css, or other root-level files that may affect the build. A change to an unlisted directory won't invalidate the cache, potentially passing CI with stale build output. Verify the globs cover all directories that influence the Expo and extension builds.
  • Output path assumptions: The build cache assumes bunx expo export --platform web outputs to dist/ and bun run ext:build outputs to .output/. If either path is wrong, caching and bundle analysis will silently do nothing. Verify both paths.
  • Labels must be created in repo settings: The labeler workflow applies labels but doesn't create them. Ensure extension, mobile, config, ci, and api labels exist in the companion repo's GitHub settings before merging.

Suggested test plan: After merge, open a test PR that touches a file in extension/ and verify: (1) CI runs on Blacksmith runners without "no matching runner" errors, (2) the labeler applies the extension label, (3) semantic PR title check runs, (4) bundle analysis runs but doesn't post a comment (unless size increases >5KB), (5) security audit job runs, (6) pushing again to the same PR cancels the previous in-progress CI run. For re-draft, have someone request changes on a PR and confirm it converts to draft. For build caching, push a second commit with no source changes and confirm the build step is skipped.

Notes

  • Blacksmith runners are 2x faster than ubuntu-latest and use the same pricing model as cal.com's CI
  • The re-draft workflow uses the same two-step artifact-passing pattern as cal.com (needed for fork PR secrets access)
  • Bundle analysis only comments when size increases beyond threshold — won't spam PRs with "no change" comments
  • Build caching uses actions/cache@v4 with content-based keys (hashFiles()) to invalidate when source files change
  • Most workflows can only be fully tested after merge since they trigger on real GitHub events

Link to Devin run: https://app.devin.ai/sessions/292c913761564e91aab85809b8ff9c86
Requested by: @dhairyashiil

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

🔴 Bundle Size Analysis

Size
Extension (current) 139.04 KB
Extension (main) N/A (no baseline yet)

@github-actions
Copy link

🔴 Bundle Size Analysis

Size
Extension (current) 139.04 KB
Extension (main) N/A (no baseline yet)

@devin-ai-integration devin-ai-integration bot changed the title ci: add security audit, semantic PRs, bundle analysis, labeler, cache cleanup, and re-draft workflows ci: add 6 new workflows and CI speed optimizations (caching, concurrency) Feb 18, 2026
@devin-ai-integration devin-ai-integration bot changed the title ci: add 6 new workflows and CI speed optimizations (caching, concurrency) ci: add 6 new workflows, Blacksmith runners, and CI speed optimizations Feb 18, 2026
@github-actions
Copy link

🔴 Bundle Size Analysis

Size
Extension (current) 139.04 KB
Extension (main) N/A (no baseline yet)

@dhairyashiil dhairyashiil marked this pull request as ready for review February 18, 2026 17:16
@dhairyashiil dhairyashiil requested a review from a team as a code owner February 18, 2026 17:16
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 9 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/cache-clean.yml">

<violation number="1" location=".github/workflows/cache-clean.yml:9">
P2: Cache deletion requires `actions: write` on the `GITHUB_TOKEN`. Without an explicit permissions block, `gh actions-cache delete` will fail on the default read-only token and the cleanup job won’t actually remove caches. Add job permissions for `actions: write` (and `contents: read` for checkout).</violation>
</file>

<file name=".github/workflows/security-audit.yml">

<violation number="1" location=".github/workflows/security-audit.yml:34">
P2: This step never fails and also calls the wrong audit command/flags. Bun’s audit is `bun audit --prod --audit-level=critical`; `bunx audit ... || true` bypasses failures and likely runs an unrelated package, so vulnerabilities won’t block CI as intended.</violation>
</file>

<file name=".github/workflows/ci.yml">

<violation number="1" location=".github/workflows/ci.yml:73">
P2: The Expo web cache key omits `utils/**`, so updates to shared utilities won’t invalidate the cache and can skip rebuilding `dist`, leaving stale artifacts. Include `utils/**` (and other shared root inputs) in the hashFiles list.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@volnei volnei merged commit ee67c12 into main Feb 18, 2026
9 checks passed
devin-ai-integration bot pushed a commit that referenced this pull request Mar 13, 2026
…ng URLs

- Add 'Managing Event Types' system prompt section with create/update/delete/list
  guidance, slug generation, common requests, and advanced settings redirect
- Relax critical rule #9 to guard booking flows only, not explicit user requests
- Add minimumBookingNotice, beforeEventBuffer, afterEventBuffer, slotInterval,
  scheduleId to create_event_type and update_event_type tool schemas + types
- Update create/update/delete tool descriptions for clarity
- Include bookingUrl in list_event_types response using linked user's username
dhairyashiil added a commit that referenced this pull request Mar 14, 2026
… event types, reschedule & more (#41)

* feat: agentic cancel booking flow — enriched responses, recurring support, guided prompt

* feat: agentic confirm/decline flow — enriched responses, guided prompt, batch support

* update code

* fix: error handling & API robustness — CalcomApiError classifier, friendly messages, schema fixes

Part A: Fix misleading error messages
- A1: Add isCalcomApiError classifier + friendlyCalcomError helper with status-specific messages
- A2: Add isSlackAuthError guard to /cal slash command and retry_response handlers
- A3: Soften Slack auth error message (less alarming, directs to admin)
- A4: Sanitize confirm_booking error (don't expose raw API errors)
- A5: Fix App Home catch-all to only suggest reconnecting on 401/403

Part B: Fix API schema mismatches
- B1: Fix getAvailableSlots to use cal-api-version 2024-09-04
- B2: Rename responses → bookingFieldsResponses (matches OpenAPI spec)
- B3: Add rescheduledBy param to rescheduleBooking for auto-confirm
- B4: Add bookingUidToReschedule to GetSlotsParams for reschedule flow
- B5: Remove phantom notes field from CreateBookingInput types

Part C: Structural improvements
- C1: Add CalcomApiError awareness to all getCustomErrorMessage callbacks
- C2: Centralized friendlyCalcomError helper in bot.ts

* update

* feat: booking search enhancement — attendee/date filtering, sorting, past meeting lookup

- Expand GetBookingsParams with attendeeEmail, attendeeName, afterStart, beforeEnd, sortStart
- Pass new params through in getBookings() query string
- Add all new params to list_bookings tool Zod schema
- Update list_bookings description to mention attendee and date range filtering
- Add FINDING PAST MEETINGS WITH SOMEONE section to system prompt

* update - pass hosts

* feat: 'Am I Free?' flow — availability prompt section, check_busy_times steering, critical rule

- Add 'Checking Your Availability / Am I Free?' system prompt section with 3-step flow
  (determine time range, fetch bookings, answer question) and edge cases
- Update check_busy_times description to note credential limitations and steer toward list_bookings
- Add rule 10 to CRITICAL RULES: use list_bookings for availability checks

* feat: profile management flow — system prompt guidance, Redis cache sync, tool descriptions

- Add 'Profile Management' system prompt section with viewing/updating guidance,
  timezone abbreviation resolution, email verification warning, and fast-path
- Sync email/timezone changes back to Redis via linkUser() after update_profile
  to prevent stale cache in system prompt and timezone conversions
- Add linkUser import from user-linking
- Update get_my_profile description to steer toward cached data for basic info
- Update update_profile description to require confirmation and IANA timezones

* feat: event type CRUD flow — prompt guidance, expanded schemas, booking URLs

- Add 'Managing Event Types' system prompt section with create/update/delete/list
  guidance, slug generation, common requests, and advanced settings redirect
- Relax critical rule #9 to guard booking flows only, not explicit user requests
- Add minimumBookingNotice, beforeEventBuffer, afterEventBuffer, slotInterval,
  scheduleId to create_event_type and update_event_type tool schemas + types
- Update create/update/delete tool descriptions for clarity
- Include bookingUrl in list_event_types response using linked user's username

* feat: no-show and unlink flows — mark_no_show body fix, expanded schema, prompt guidance

* feat: agentic reschedule flow — prompt guidance, slot exclusion, rescheduledBy, recurring detection

* feat: promote event type CRUD tools to CORE_TOOL_NAMES, remove stale ADMIN_KEYWORDS

* refactor: eliminate keyword-based tool gating — always expose all tools

* feat: add fetchWithRetry with exponential backoff and timeouts to all Cal.com API calls

* feat: schedule availability tools — expose availability/overrides, enrich descriptions, add prompt section

* feat: include bookingFields in list_event_types response to fix own-calendar booking with custom fields

* feat: add skip param and hasMore pagination flag to list_bookings tool

* feat: enrich tool descriptions for get_booking, confirm/decline, and schedule tools

* feat: actionable error messages — overhaul friendlyCalcomError, consolidate CalcomApiError handling via deps

* refactor: extract duplicates and magic numbers across agent, bot, and user-linking

* feat: add get_event_type tool + gate agentic features behind org plan (#42)

* feat: add get_event_type tool for fetching single event type details

* fix: align get_event_type tool description with actual response fields

* feat: gate agentic features behind Cal.com Organizations plan

* fix: address review comments — org sync on refresh, split link check, withSlackToken wrapper

* fix: disable retries for mutating API calls, reorder error handlers, re-read linked user after refresh
emrysal pushed a commit that referenced this pull request Mar 14, 2026
…edis persistence (#32)

* feat: smart @mention booking flow with multi-attendee support

- Rewrite booking flow in system prompt to clarification-first logic
  with fast-path for fully-specified requests
- Add guestEmails field to book_meeting tool for email-only additional
  attendees (Strategy A: guests array in initial POST)
- Add add_booking_attendee tool for full attendee records with name +
  timezone after booking (Strategy B: POST /bookings/{uid}/attendees)
- Add AddAttendeeInput type and addBookingAttendee() client function
- Add guests field to CreateBookingInput type
- Relax CRITICAL RULES to support multi-step booking flows and
  re-calling check_availability for alternative slots
- Update check_availability description to allow re-calls
- Bump MAX_STEPS from 10 to 15 for multi-attendee flows
- Update Available Capabilities to list add_booking_attendee

* fix

* refactor: simplify agent booking flow with pre-resolution, tool filtering, and Redis persistence

- Remove check_account_linked tool (bot.ts already checks before agent)
- Pre-resolve Slack @mentions to name+email before calling agent
- Inject linked user context (email/timezone/username) into system prompt
- Rewrite system prompt with checklist-based single-decision booking
- Persist tool results in Redis (keyed by threadId, 30min TTL)
- Context-aware tool filtering: CORE (7 booking tools) vs EXTENDED (admin)
- Add loop guard: force text if same tool called 3x with identical args
- Reduce MAX_STEPS from 15 to 8 (agent needs 3-4 steps with optimizations)

* update

* update 2

* fix: booking flow — timezone-aware dates, tighter loop guard, ASAP handling, tool context reuse

- Replace bare ISO timestamp with timezone-aware date in system prompt
- Add explicit past-date comparison rule against user's timezone
- Lower loop guard threshold from 3 to 2 identical calls
- Reduce MAX_STEPS from 8 to 6
- Rewrite tool context injection: user role, deduplicate by tool name, inject at start of history
- Add ASAP/urgency shortcut section to booking flow
- Add duration mismatch detection rule
- Strengthen tool usage rules (no same tool twice per step, must use returned data)
- Add single event type auto-select logic

* update the code

* feat: add attendee calendar booking flow — list_event_types_by_username tool

- Add getEventTypesByUsername() to calcom/client.ts (public API, no auth needed)
- Add list_event_types_by_username tool to agent createCalTools
- Add list_event_types_by_username to CORE_TOOL_NAMES
- Add WHOSE CALENDAR TO USE section to system prompt booking flow

* update code

* update

* fix: prevent false-positive Slack auth error + add custom booking field support

Fix 1: Updated getCustomErrorMessage in all 3 handlers to return generic
error when lastStreamErrorRef is set and caught error is Slack auth error.

Fix 2a: Added responses?: Record<string, unknown> to CreateBookingInput
and CreatePublicBookingInput types.

Fix 2b: Added responses parameter to book_meeting and book_meeting_public
tool schemas, passed through to API calls.

Fix 2c: Included bookingFields in list_event_types_by_username response.

Fix 2d: Added CUSTOM BOOKING FIELDS section to system prompt instructing
agent to collect required custom field values and pass as responses.

Fix 3: Hardened postAgentStream to re-throw generic error when Slack auth
error is secondary to an agent stream failure.

Also fixed duplicate rule #6 numbering in CRITICAL RULES.

* fix: replace non-null assertions with nullish coalescing in check_availability_public

* revert the prod url in manifest

* fix: encrypt tool-context in Redis + pass metadata for webhook notification routing

1. Encrypt tool-context entries in Redis using existing encryptData/decryptData
   (PII protection for attendee names, emails, booking details).
   Legacy plaintext entries are handled gracefully by decryptData.

2. Added metadata?: Record<string, string> to CreatePublicBookingInput.

3. Added platform parameter to createCalTools, threaded from runAgentStream.

4. Both book_meeting and book_meeting_public now pass metadata with
   slack_team_id/slack_user_id or telegram_chat_id so Cal.com webhooks
   can route notifications back to the correct Slack/Telegram user.

* feat: agentic flows, error handling, API robustness, search, profile, event types, reschedule & more (#41)

* feat: agentic cancel booking flow — enriched responses, recurring support, guided prompt

* feat: agentic confirm/decline flow — enriched responses, guided prompt, batch support

* update code

* fix: error handling & API robustness — CalcomApiError classifier, friendly messages, schema fixes

Part A: Fix misleading error messages
- A1: Add isCalcomApiError classifier + friendlyCalcomError helper with status-specific messages
- A2: Add isSlackAuthError guard to /cal slash command and retry_response handlers
- A3: Soften Slack auth error message (less alarming, directs to admin)
- A4: Sanitize confirm_booking error (don't expose raw API errors)
- A5: Fix App Home catch-all to only suggest reconnecting on 401/403

Part B: Fix API schema mismatches
- B1: Fix getAvailableSlots to use cal-api-version 2024-09-04
- B2: Rename responses → bookingFieldsResponses (matches OpenAPI spec)
- B3: Add rescheduledBy param to rescheduleBooking for auto-confirm
- B4: Add bookingUidToReschedule to GetSlotsParams for reschedule flow
- B5: Remove phantom notes field from CreateBookingInput types

Part C: Structural improvements
- C1: Add CalcomApiError awareness to all getCustomErrorMessage callbacks
- C2: Centralized friendlyCalcomError helper in bot.ts

* update

* feat: booking search enhancement — attendee/date filtering, sorting, past meeting lookup

- Expand GetBookingsParams with attendeeEmail, attendeeName, afterStart, beforeEnd, sortStart
- Pass new params through in getBookings() query string
- Add all new params to list_bookings tool Zod schema
- Update list_bookings description to mention attendee and date range filtering
- Add FINDING PAST MEETINGS WITH SOMEONE section to system prompt

* update - pass hosts

* feat: 'Am I Free?' flow — availability prompt section, check_busy_times steering, critical rule

- Add 'Checking Your Availability / Am I Free?' system prompt section with 3-step flow
  (determine time range, fetch bookings, answer question) and edge cases
- Update check_busy_times description to note credential limitations and steer toward list_bookings
- Add rule 10 to CRITICAL RULES: use list_bookings for availability checks

* feat: profile management flow — system prompt guidance, Redis cache sync, tool descriptions

- Add 'Profile Management' system prompt section with viewing/updating guidance,
  timezone abbreviation resolution, email verification warning, and fast-path
- Sync email/timezone changes back to Redis via linkUser() after update_profile
  to prevent stale cache in system prompt and timezone conversions
- Add linkUser import from user-linking
- Update get_my_profile description to steer toward cached data for basic info
- Update update_profile description to require confirmation and IANA timezones

* feat: event type CRUD flow — prompt guidance, expanded schemas, booking URLs

- Add 'Managing Event Types' system prompt section with create/update/delete/list
  guidance, slug generation, common requests, and advanced settings redirect
- Relax critical rule #9 to guard booking flows only, not explicit user requests
- Add minimumBookingNotice, beforeEventBuffer, afterEventBuffer, slotInterval,
  scheduleId to create_event_type and update_event_type tool schemas + types
- Update create/update/delete tool descriptions for clarity
- Include bookingUrl in list_event_types response using linked user's username

* feat: no-show and unlink flows — mark_no_show body fix, expanded schema, prompt guidance

* feat: agentic reschedule flow — prompt guidance, slot exclusion, rescheduledBy, recurring detection

* feat: promote event type CRUD tools to CORE_TOOL_NAMES, remove stale ADMIN_KEYWORDS

* refactor: eliminate keyword-based tool gating — always expose all tools

* feat: add fetchWithRetry with exponential backoff and timeouts to all Cal.com API calls

* feat: schedule availability tools — expose availability/overrides, enrich descriptions, add prompt section

* feat: include bookingFields in list_event_types response to fix own-calendar booking with custom fields

* feat: add skip param and hasMore pagination flag to list_bookings tool

* feat: enrich tool descriptions for get_booking, confirm/decline, and schedule tools

* feat: actionable error messages — overhaul friendlyCalcomError, consolidate CalcomApiError handling via deps

* refactor: extract duplicates and magic numbers across agent, bot, and user-linking

* feat: add get_event_type tool + gate agentic features behind org plan (#42)

* feat: add get_event_type tool for fetching single event type details

* fix: align get_event_type tool description with actual response fields

* feat: gate agentic features behind Cal.com Organizations plan

* fix: address review comments — org sync on refresh, split link check, withSlackToken wrapper

* fix: disable retries for mutating API calls, reorder error handlers, re-read linked user after refresh
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.

2 participants