-
Notifications
You must be signed in to change notification settings - Fork 60
Stop silently discarding agent metadata on registration and spawn #1436
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
Open
khaliqgant
wants to merge
2
commits into
main
Choose a base branch
from
relay/spawn-identity-metadata
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+312
−3
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: AgentWorkforce/relay
Length of output: 158
🏁 Script executed:
Repository: AgentWorkforce/relay
Length of output: 4891
🌐 Web query:
Vitest toEqual signature expects single argument expect value message custom message💡 Result:
In Vitest, the standard
toEqualmatcher takes a single argument, which is the expected value to compare against the received value [1][2][3]. Although it is not explicitly highlighted in the primary API documentation, you can provide an optional custom failure message as a second argument to theexpectfunction itself [4][5][6]. When used this way, the message acts as a prefix to the default error message if the assertion fails [5][6]. The signature for an assertion with a custom message is: expect(received, 'your custom message').toEqual(expected); Key points regarding this behavior: - Compatibility: This functionality allows the second argument ofexpectto serve as a custom message across various matchers [5][6]. - Behavior: If the assertion fails, the test will throw an error that includes your custom message [5][6]. If the message is omitted, empty, or undefined, it defaults to the standard matcher error message [6]. - Caveats: Because this is anexpectfunction feature rather than a specific matcher parameter, it may behave unexpectedly if a specific matcher (like those provided by external libraries) also attempts to interpret a second argument [7]. Always verify that the matcher you are using is designed to receive only one argument before relying on this pattern [7].Citations:
expect(..., message)consistent as error message prefix vitest-dev/vitest#10068🌐 Web query:
Jest toEqual optional second argument message expect.toEqual actually accepts message💡 Result:
No, Jest's standard expect.toEqual matcher does not accept an optional second argument for a custom error message [1][2][3]. The function signature is strictly expect.toEqual(expected) [1][2]. If you provide a second argument to toEqual, Jest will not treat it as a custom error message, and it may lead to unexpected behavior or assertion errors depending on your test implementation. To provide custom error messages in Jest, common approaches include: 1. Use Third-Party Packages: The library jest-expect-message is a widely used community solution that enables support for custom messages in assertions [4][5]. 2. Custom Matchers: You can use expect.extend to create your own matcher that wraps existing Jest matchers and includes custom logic to return a custom failure message [6][7]. 3. Manual Error Handling: For complex logic, developers often wrap the assertion in a try-catch block and manually throw a new Error with a custom message if the assertion fails [4][5].
Citations:
expector somewhere in the chain jestjs/jest#14147Move the custom message onto
expect, not intotoEqual.expect(record.metadata.fleet, 'must not clobber platform keys').toEqual({ nodeId: 'node_x' }));has the expected type and keeps the message with this assertion.🤖 Prompt for AI Agents