feat: Add TraceType enum for granular trace control#284
Merged
eric-tramel merged 2 commits intomainfrom Feb 3, 2026
Merged
Conversation
Greptile OverviewGreptile SummaryThis PR introduces a Key Changes:
Implementation Quality:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ConfigBuilder
participant LLMColumnConfig
participant RunConfig
participant LLMCompletionGenerator
participant Model
User->>ConfigBuilder: add_column(LLMTextColumnConfig)
User->>LLMColumnConfig: with_trace=TraceType.LAST_MESSAGE
LLMColumnConfig-->>ConfigBuilder: Column config created
User->>RunConfig: debug_trace_override=TraceType.ALL_MESSAGES
RunConfig-->>User: Override configured
User->>LLMCompletionGenerator: generate(data)
LLMCompletionGenerator->>RunConfig: Check debug_trace_override
RunConfig-->>LLMCompletionGenerator: TraceType.ALL_MESSAGES (override)
Note over LLMCompletionGenerator: Effective trace type = ALL_MESSAGES<br/>(override takes precedence)
LLMCompletionGenerator->>Model: generate(prompt, system_prompt, ...)
Model-->>LLMCompletionGenerator: (response, trace)
alt effective_trace_type == ALL_MESSAGES
LLMCompletionGenerator->>LLMCompletionGenerator: Save all messages to trace column
else effective_trace_type == LAST_MESSAGE
LLMCompletionGenerator->>LLMCompletionGenerator: Find last assistant message
LLMCompletionGenerator->>LLMCompletionGenerator: Save only last assistant to trace column
else effective_trace_type == NONE
LLMCompletionGenerator->>LLMCompletionGenerator: No trace column created
end
LLMCompletionGenerator-->>User: Generated data with trace column
|
nabinchha
previously approved these changes
Feb 3, 2026
Contributor
nabinchha
left a comment
There was a problem hiding this comment.
tiniest of nit, but lgtm! Thanks @eric-tramel!
packages/data-designer-config/src/data_designer/config/utils/trace_type.py
Outdated
Show resolved
Hide resolved
nabinchha
approved these changes
Feb 3, 2026
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.
Summary
This PR converts the boolean
with_tracefield in LLM column configs anddebug_override_save_all_column_tracesinRunConfigto use a newTraceTypeenum, providing more granular control over what trace information is captured.New
TraceTypeEnumThe
TraceTypeenum provides three modes for trace capture:TraceType.NONETraceType.LAST_MESSAGETraceType.ALL_MESSAGESBreaking Changes
with_tracefield type changed: Thewith_tracefield on LLM column configs (LLMTextColumnConfig,LLMCodeColumnConfig,LLMStructuredColumnConfig,LLMJudgeColumnConfig) now acceptsTraceTypeinstead ofbool.with_trace=True→with_trace=TraceType.ALL_MESSAGESwith_trace=False→with_trace=TraceType.NONE(default)debug_override_save_all_column_tracesrenamed: TheRunConfigfield is nowdebug_trace_overrideand acceptsTraceType | None.debug_override_save_all_column_traces=True→debug_trace_override=TraceType.ALL_MESSAGESdebug_override_save_all_column_traces=False→debug_trace_override=None(default, uses per-column settings)Usage
Per-Column Trace Configuration
Global Debug Override
When
debug_trace_overrideis set (notNone), it takes precedence over per-columnwith_tracesettings.Changes
New Files
packages/data-designer-config/src/data_designer/config/utils/trace_type.py- NewTraceTypeenumModified Files
packages/data-designer-config/src/data_designer/config/column_configs.py- Updatedwith_tracefield typepackages/data-designer-config/src/data_designer/config/run_config.py- Renamed and retyped debug override fieldpackages/data-designer-config/src/data_designer/config/__init__.py- ExportTraceTypepackages/data-designer-engine/src/data_designer/engine/column_generators/generators/llm_completion.py- Updated trace logic for three modesTest plan
TraceType.LAST_MESSAGEbehaviorwith_tracefield serialization🤖 Generated with Claude Code