Skip to content

fix(copilot): align principal lifetime with orchestration - #6649

Merged
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/copilot-principal-lifecycle
Aug 13, 2026
Merged

fix(copilot): align principal lifetime with orchestration#6649
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/copilot-principal-lifecycle

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • Set Copilot delegated Principal TTL from the shared 60-minute orchestration timeout
  • Add regression coverage for the exact delegation lifetime

Type of Change

  • Bug fix

Testing

  • 17 focused Copilot delegation tests
  • Full lint and 25 CI audits
  • Sim and auth type-check

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

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 13, 2026 12:08am

Request Review

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes delegated-principal expiration across Copilot application adapters (auth boundary); scope is limited to matching an existing orchestration cap rather than introducing new authority.

Overview
Copilot delegated principals no longer use a fixed 5-minute TTL. COPILOT_APPLICATION_DELEGATION_TTL_MS now equals the shared ORCHESTRATION_TIMEOUT_MS (60 minutes), so workflow, file, and other application delegations stay valid for the full bounded orchestration run instead of expiring mid-session.

Tests were tightened to assert the exact delegation span (expiresAt - issuedAt === ORCHESTRATION_TIMEOUT_MS) in workflow and file delegation coverage, replacing looser “expires after issued” checks and a hardcoded five-minute expiresAt in one workflow test.

Reviewed by Cursor Bugbot for commit b9eaa95. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR aligns Copilot delegated-principal validity with the shared 60-minute orchestration timeout.

  • Reuses ORCHESTRATION_TIMEOUT_MS as the application-delegation TTL.
  • Updates workflow and file-delegation regression coverage to verify the aligned lifetime.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/lib/copilot/auth/application-delegation.ts Replaces the five-minute delegation TTL with the shared orchestration timeout without introducing a new import-cycle or runtime-boundary issue.
apps/sim/lib/copilot/application/execute-workflow-use-case.test.ts Updates the expected delegated-principal expiry under the suite’s frozen clock.
apps/sim/lib/copilot/auth/file-delegation.test.ts Adds an exact assertion that delegated-principal lifetime equals the orchestration timeout.

Reviews (2): Last reviewed commit: "fix(copilot): align workflow lifetime ex..." | Re-trigger Greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

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

Reviewed by Cursor Bugbot for commit b9eaa95. Configure here.

@TheodoreSpeaks
TheodoreSpeaks merged commit 51df824 into staging Aug 13, 2026
30 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the fix/copilot-principal-lifecycle branch August 13, 2026 00:15
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