Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

@icecrasher321 icecrasher321 commented Jan 30, 2026

Summary

  • Add Internal API secret to docker compose yaml references
  • Remove dead copilot handler code

Type of Change

  • Other: Code hygiene

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jan 30, 2026 8:03pm

Request Review

@icecrasher321 icecrasher321 marked this pull request as ready for review January 30, 2026 19:35
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

This PR addresses two distinct improvements: adding missing INTERNAL_API_SECRET configuration to docker-compose files and removing unused copilot workflow edit functionality.

Key Changes:

  • Added INTERNAL_API_SECRET environment variable to both docker-compose.local.yml (with safe default) and docker-compose.prod.yml (from env) for both sim and socket services
  • Completely removed the copilot-workflow-edit event system across all layers: HTTP endpoint, room manager interface, memory/redis implementations, and client-side socket listener
  • Clean removal of approximately 70 lines of dead code with no remaining references

Impact:
The INTERNAL_API_SECRET addition completes the security configuration for internal socket server API authentication (already implemented in apps/sim/socket/routes/http.ts:12-29). The copilot handler removal is a safe cleanup of unused functionality with no active callers found in the codebase.

Confidence Score: 5/5

  • Safe to merge - configuration addition and clean code removal with no breaking changes
  • The PR makes two straightforward improvements: (1) adds required environment variables to docker-compose files that were missing but already used by the socket server, and (2) cleanly removes unused copilot workflow edit code with verified zero references remaining in the codebase
  • No files require special attention

Important Files Changed

Filename Overview
docker-compose.local.yml Added INTERNAL_API_SECRET environment variable with default value for local development
docker-compose.prod.yml Added INTERNAL_API_SECRET environment variable for production socket server authentication
apps/sim/socket/routes/http.ts Removed unused /api/copilot-workflow-edit endpoint and associated handler logic
apps/sim/app/workspace/providers/socket-provider.tsx Removed copilot-workflow-edit event listener and workflow rehydration logic

Sequence Diagram

sequenceDiagram
    participant API as Main API
    participant Socket as Socket Server
    participant Manager as Room Manager
    participant Redis as Redis/Memory

    Note over API,Socket: Internal API Authentication Flow

    API->>Socket: POST /api/workflow-updated
    Note over API,Socket: Header: x-api-key
    Socket->>Socket: checkInternalApiKey()
    alt Valid API Key
        Socket->>Manager: handleWorkflowUpdate(workflowId)
        Manager->>Redis: Get workflow room data
        Manager->>Socket: Emit to workflow room
        Socket-->>API: 200 OK
    else Invalid/Missing API Key
        Socket-->>API: 401 Unauthorized
    end

    Note over API,Manager: Removed: Copilot Workflow Edit Flow
    Note over Socket,Manager: Deleted /api/copilot-workflow-edit endpoint
    Note over Manager: Deleted handleCopilotWorkflowEdit() method
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@icecrasher321 icecrasher321 changed the title improvement(docker): add internal api secret to docker compose improvement(docker): update docker-compose env vars Jan 30, 2026
@icecrasher321
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@icecrasher321 icecrasher321 merged commit 478a535 into staging Jan 30, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/docker-compose-yaml branch January 30, 2026 20:20
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