Profiling: refactor AgentEndpoint so it can be const#3577
Merged
morrisonlevi merged 1 commit intomasterfrom Jan 15, 2026
Merged
Profiling: refactor AgentEndpoint so it can be const#3577morrisonlevi merged 1 commit intomasterfrom
morrisonlevi merged 1 commit intomasterfrom
Conversation
|
2 tasks
realFlowControl
approved these changes
Jan 15, 2026
Member
realFlowControl
left a comment
There was a problem hiding this comment.
If I see this right, in conjunction with #3578, AgentEndpoint (specifically the PathBuf inside) is the sole reason why SystemSettings is not const and why we are using the MaybeUninit thing there and this PR unlocks the path to make SystemSettings const.
Nice!
Collaborator
Author
|
Yes, that's right. This should make things safer and easier to work with! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This refactors
AgentEndpointto use aCow<Path>instead of aPathBufso that we can use&'static Path. This avoids an allocation which is a little bit nice, but mainly it's to allow us to make aconstone:It's a little tricky to make a const
&PathbecausePath::newisn't const, so it uses some unsafe tricks. Note that I ran this by miri locally and it was fine, as I expected.This UDS path is not necessarily the "best" default because it's only partly true: in practice, we use this as the default agent path if it exists, but if it doesn't, then we use
"http://localhost:8126". But it has the distinct advantage of being one that can be defined in const contexts. I plan to use this in another PR to simplifySystemSettings.Reviewer checklist