Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGLOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [0.1.16] - 2025-11-10
### Fixed
- fix baggage escape problem

## [0.1.15] - 2025-10-23
### Added
- support set spanID when StartSpan
Expand Down
10 changes: 3 additions & 7 deletions internal/trace/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,10 @@ func (s *Span) SetBaggage(ctx context.Context, baggageItems map[string]string) {
return
}

s.setBaggage(ctx, baggageItems, true)
s.setBaggage(ctx, baggageItems)
}

func (s *Span) setBaggage(ctx context.Context, baggageItems map[string]string, escape bool) {
func (s *Span) setBaggage(ctx context.Context, baggageItems map[string]string) {
if s == nil {
return
}
Expand All @@ -760,10 +760,6 @@ func (s *Span) setBaggage(ctx context.Context, baggageItems map[string]string, e
s.SetTags(ctx, map[string]interface{}{key: value})
newKey := key
newValue := value
if escape {
newKey = url.QueryEscape(key)
newValue = url.QueryEscape(value)
}
s.SetBaggageItem(newKey, newValue)
}
}
Expand Down Expand Up @@ -928,7 +924,7 @@ func (s *Span) toHeaderBaggage() (string, error) {
tempV := v
// empty key or value is invalid
if tempK != "" && tempV != "" {
m[tempK] = tempV
m[url.QueryEscape(tempK)] = url.QueryEscape(tempV)
}
}
return util.MapToStringString(m), nil
Expand Down
2 changes: 1 addition & 1 deletion internal/trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (t *Provider) startSpan(ctx context.Context, spanName string, spanType stri
}

// 3. set Baggage from parent span
s.setBaggage(ctx, options.Baggage, false)
s.setBaggage(ctx, options.Baggage)

return s
}
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ package internal

// Version returns the version of the loop package.
func Version() string {
return "v0.1.15"
return "v0.1.16"
}
8 changes: 5 additions & 3 deletions spec/tracespec/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import "encoding/json"

// ModelInput is the input for model span, for tag key: input
type ModelInput struct {
Messages []*ModelMessage `json:"messages,omitempty"`
Tools []*ModelTool `json:"tools,omitempty"`
ModelToolChoice *ModelToolChoice `json:"tool_choice,omitempty"`
Messages []*ModelMessage `json:"messages,omitempty"`
Tools []*ModelTool `json:"tools,omitempty"`
ModelToolChoice *ModelToolChoice `json:"tool_choice,omitempty"`
PreviousResponseID string `json:"previous_response_id,omitempty"`
}

// ModelOutput is the output for model span, for tag key: output
type ModelOutput struct {
ID string `json:"id,omitempty"`
Choices []*ModelChoice `json:"choices"`
}

Expand Down