-
Notifications
You must be signed in to change notification settings - Fork 28
Extract error codes into errorHelper.ts for agents-activity and agents-hosting packages #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Extract error codes into errorHelper.ts for agents-activity and agents-hosting packages #787
Conversation
…to -110007 Co-authored-by: cleemullins <[email protected]>
Co-authored-by: cleemullins <[email protected]>
Co-authored-by: cleemullins <[email protected]>
…ent, agent-client Co-authored-by: cleemullins <[email protected]>
|
@copilot The comment in this PR says: Verify this work has been done. If it has not been done, do it now. |
Co-authored-by: cleemullins <[email protected]>
Completed! All 19 remaining files in agents-hosting have been refactored. Every throw statement now uses the errorHelper pattern with proper error codes. Summary:
Latest commit: 94ebbc2 |
…ation.ts Co-authored-by: cleemullins <[email protected]>
|
@copilot - the linting step in the build is failing. The errors are listed below. Fix all of these. |
…orthand Co-authored-by: cleemullins <[email protected]>
Fixed all 19 linting errors:
All core packages build successfully. Commit: 1d9828e |
|
@copilot The below unit test is failing. Examine why and resolve the issue: |
… codes Co-authored-by: cleemullins <[email protected]>
... Fixed! Updated authorization.test.ts to handle the new error message format that includes error codes and help links. Changed from exact message matching to substring validation. All 9 tests now pass. Commit: 227931e |
|
@copilot Unit tests are still failing. The failing tests are below. Withing the authorizeJWT test suite: ❌ authorizeJWT ❌ TurnContext |
Co-authored-by: cleemullins <[email protected]>
Fixed both failing tests:
Both tests now accommodate the new error format that includes error codes and help links. Commit: 0dd6bd3 |
|
@copilot This is not going well. Apparently, the instructions "run all the unit tests and fix them" is beyond you. This is something even Grok could figure out. Instructions:
|
…iptLogger tests for new error format Co-authored-by: cleemullins <[email protected]>
Done. I've run all unit tests and fixed all failures systematically: Test Results:
Tests Fixed:
All tests now use flexible matching to accommodate error codes and help links in the new standardized error format. Commit: df4d7db |
Co-authored-by: cleemullins <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR successfully extracts error codes into errorHelper.ts files for the agents-activity and agents-hosting packages, following the pattern established in the agents-hosting-storage-cosmos package. The implementation provides centralized error management with structured error definitions including error codes, descriptions, and help links.
Key changes:
- Created
errorHelper.tswith 8 error definitions (codes -110000 to -110007) in agents-activity package - Created
errorHelper.tswith ~80 error definitions (codes -120000 to -120299) in agents-hosting package, organized by subsystem - Refactored all error throws across 31 files to use
ExceptionHelper.generateException()with structured error definitions - Updated test files to use flexible matching for error messages to accommodate new error codes and help links
- Added comprehensive test coverage for error definitions including validation of code ranges, uniqueness, and proper formatting
Reviewed changes
Copilot reviewed 44 out of 44 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/agents-activity/src/errorHelper.ts | New file defining 8 error codes for activity-related errors |
| packages/agents-activity/src/activity.ts | Refactored to use centralized error definitions |
| packages/agents-activity/src/index.ts | Exports new Errors object |
| packages/agents-activity/test/errorHelper.test.ts | New comprehensive test suite for error definitions |
| packages/agents-hosting/src/errorHelper.ts | New file defining ~80 error codes organized by subsystem (Activity Handler, Cloud Adapter, Storage, State, etc.) |
| packages/agents-hosting/src/index.ts | Exports new Errors object |
| packages/agents-hosting/src/activityHandler.ts | Refactored to use centralized error definitions |
| packages/agents-hosting/src/cloudAdapter.ts | Refactored to use centralized error definitions for adapter operations |
| packages/agents-hosting/src/baseAdapter.ts | Refactored error handling to use error definitions |
| packages/agents-hosting/src/turnContext.ts | Updated responded setter to use error definitions |
| packages/agents-hosting/src/storage/memoryStorage.ts | Refactored storage errors to use centralized definitions with template parameters |
| packages/agents-hosting/src/state/*.ts | Refactored state management errors across UserState and ConversationState |
| packages/agents-hosting/src/auth/*.ts | Refactored authentication and authorization errors across multiple auth files |
| packages/agents-hosting/src/app/*.ts | Refactored application-level errors including authorization, turn state, and adaptive cards |
| packages/agents-hosting/src/transcript/*.ts | Refactored transcript logger errors |
| packages/agents-hosting/src/connector-client/*.ts | Refactored connector client errors |
| packages/agents-hosting/src/oauth/userTokenClient.ts | Refactored OAuth-related errors |
| packages/agents-hosting/src/middlewareSet.ts | Refactored middleware errors |
| packages/agents-hosting/src/headerPropagation.ts | Refactored header propagation errors |
| packages/agents-hosting/src/agent-client/agentClient.ts | Refactored agent client errors |
| packages/agents-hosting/test/errorHelper.test.ts | New comprehensive test suite validating error code ranges, uniqueness, and formatting |
| packages/agents-hosting/test/hosting/**/*.test.ts | Updated 7 test files to use flexible matching for error messages |
| packages/agents-hosting-storage-cosmos/src/cosmosDbPartitionedStorage.ts | Minor formatting fix removing redundant object property shorthand |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Extract Error Codes for agents-activity and agents-hosting packages
Completed Work
agents-activity package: ✅ 100% complete
agents-hosting package: ✅ 100% complete
Test Fixes (All Complete)
Test Results
All error definitions follow the established pattern with error codes, descriptions, and help links.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.