Strengthen TOML parse-error guarantees and clarify tracing key precedence#6640
Merged
Conversation
4 tasks
Copilot
AI
changed the title
[WIP] Review Go module BurntSushi/toml for usage in gh-aw
Strengthen TOML parse-error guarantees and clarify tracing key precedence
May 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Tightens TOML integration in internal/config by asserting that parse errors expose structured toml.ParseError data, makes the precedence between [gateway.tracing] and [gateway.opentelemetry] explicit with a warning log and test, and documents intentional hyphenated TOML key names on GuardPolicy.
Changes:
- Emit a warning when both
tracingandopentelemetrygateway sections are set; opentelemetry still wins. - Strengthen invalid-TOML test to verify
errors.As(toml.ParseError)with non-zero line/column. - Add precedence test covering combined
tracing+opentelemetryconfig and document hyphenated keys onGuardPolicy.
Show a summary per file
| File | Description |
|---|---|
| internal/config/config_core.go | Logs warning when both tracing and opentelemetry are configured. |
| internal/config/config_core_test.go | Adds parse-error structural assertions and a precedence test. |
| internal/config/guard_policy.go | Comment clarifying intentional hyphenated TOML keys. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
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.
This update tightens
BurntSushi/tomlintegration ininternal/configby ensuring structured parse errors remain unwrap-able and by making dual tracing-key behavior explicit. It also documents an intentional TOML key naming exception in guard policy config.Parse error contract hardening
TestLoadFromFile_InvalidTOMLnow asserts the returned error unwraps totoml.ParseErrorand carries non-zeroline/columnposition metadata.Tracing key precedence visibility
LoadFromFilenow emits a warning when both[gateway.tracing]and[gateway.opentelemetry]are present.opentelemetrycontinues to override legacytracing.Precedence behavior coverage
TestLoadFromFile_BothTracingAndOpenTelemetry_OpenTelemetryTakesPrecedenceto verify merged result usesopentelemetryvalues and clears the temporary alias field.Guard policy key documentation
GuardPolicynoting hyphenated TOML keys (e.g.allow-only) are intentional to match policy schema field names.