Conversation
Bumps the minor-and-patch group with 2 updates: [golang.org/x/crypto](https://github.com/golang/crypto) and [golang.org/x/text](https://github.com/golang/text). Updates `golang.org/x/crypto` from 0.43.0 to 0.44.0 - [Commits](golang/crypto@v0.43.0...v0.44.0) Updates `golang.org/x/text` from 0.30.0 to 0.31.0 - [Release notes](https://github.com/golang/text/releases) - [Commits](golang/text@v0.30.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.44.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch - dependency-name: golang.org/x/text dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: minor-and-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Add a new command-line option --name/-n to set an instance name for the Ayd server. The instance name is: - Stored as a global variable in internal/meta/instance.go - Displayed in HTTP page titles and logo - Included in startup and shutdown logs as instance_name field This allows users to distinguish between multiple Ayd instances when running them concurrently or viewing their logs.
Add unit tests for the instance name option: - Test instance_name template function in templates_test.go - Test --name/-n command-line option parsing in main_test.go Both short form (-n) and long form (--name) are tested.
Modify MCP server Implementation Name and Title based on instance name:
- Name: "Ayd - alive monitoring - {instance_name}" (or "Ayd - alive monitoring" if not set)
- Title: "Ayd - {instance_name}" (or "Ayd" if not set)
This allows LLMs to correctly identify the right instance when multiple
Ayd MCP servers are configured.
Use a single impl variable instead of separate variables for Name and Title. Initialize with default values, then override if instance name is set. This makes the code more readable and maintainable.
Change MCP server configuration:
- Name: fixed to "ayd" (no longer includes instance name)
- Title: "Ayd ({instance_name})" or "Ayd"
- Instructions: Added with instance name information when set
This approach provides better identification for LLMs when multiple
Ayd instances are configured, using Title and Instructions instead
of overloading the Name field.
There was a problem hiding this comment.
Pull request overview
This PR implements an instance name feature for Ayd that allows users to identify their Ayd instances through a command-line option (-n or --name). The instance name is displayed in page titles, navigation logos, MCP server metadata, and included in server start/stop logs.
Key changes:
- Added
InstanceNamefield to store and report structures to track instance name throughout the application - Refactored test utilities to use an options pattern for better flexibility when creating test stores
- Updated UI templates and MCP integration to display instance name when available
Reviewed changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/ayd/main.go | Added -n/--name flag for setting instance name and passes it to store.New() |
| cmd/ayd/help.txt | Added documentation for the new -n/--name flag |
| cmd/ayd/server.go | Updated server start/stop logging to include instance_name in extra fields |
| internal/store/store.go | Added name field and Name() method to Store struct; includes name in MakeReport() |
| lib-ayd/report.go | Added InstanceName field to Report struct |
| internal/endpoint/store.go | Added Name() method to Store interface |
| internal/endpoint/templates/base.html | Updated title and logo to display instance name when available |
| internal/endpoint/log.go | Added InstanceName to logData struct and template context |
| internal/endpoint/mcp.go | Updated MCP server initialization to include instance name in title and instructions |
| internal/testutil/store.go | Refactored to use options pattern (WithInstanceName, WithConsole, WithLog) |
| internal/testutil/endpoint.go | Updated StartTestServer to accept StoreOption parameters |
| internal/scheme/http.go | Moved HTTPUserAgent initialization to init() function |
| go.mod/go.sum | Updated golang.org/x dependencies to newer versions |
| Test files | Updated all store.New() calls to include name parameter; added comprehensive tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7aac1a3 to
449840b
Compare
449840b to
42719f6
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v0.18 #48 +/- ##
==========================================
- Coverage 88.61% 88.41% -0.20%
==========================================
Files 75 75
Lines 5559 5585 +26
==========================================
+ Hits 4926 4938 +12
- Misses 489 502 +13
- Partials 144 145 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 29 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.