Remove internal prompt version metadata

This commit is contained in:
2026-11-02 04:03:39 +00:00
parent fd6e9742a1
commit 500b0aa1c8
29 changed files with 65 additions and 228 deletions

View File

@@ -252,7 +252,6 @@ func (r *Runner) executePreparedRun(
RawOutput: genResp.Content,
Validation: validationResult,
PromptID: prepared.PromptID,
PromptVersion: copyStringPointer(prepared.PromptVersion),
PromptHash: prepared.PromptHash,
SessionID: prepared.SessionID,
RenderedPromptHash: prepared.RenderedPromptHash,
@@ -321,7 +320,7 @@ func (r *Runner) resolvePreparation(
}
def := promptSelection.definition
if recorder := observation.FromContext(ctx); recorder != nil {
recorder.UpdateSelection(observation.Selection{PromptID: def.ID, PromptVersion: copyStringPointer(def.Version)})
recorder.UpdateSelection(observation.Selection{PromptID: def.ID})
}
promptDefinitionHash := promptSelection.hash
effectiveContract, err := resolveOutputContract(def, req.Validation)
@@ -342,7 +341,7 @@ func (r *Runner) resolvePreparation(
return nil, err
}
if recorder := observation.FromContext(ctx); recorder != nil {
recorder.UpdateSelection(observation.Selection{PromptID: def.ID, PromptVersion: copyStringPointer(def.Version), ProfileID: selection.id})
recorder.UpdateSelection(observation.Selection{PromptID: def.ID, ProfileID: selection.id})
}
effectiveModel, targetPresence := resolveExecutionTarget(selection.profile, req.Execution)
@@ -355,7 +354,7 @@ func (r *Runner) resolvePreparation(
return nil, fmt.Errorf("%w: %w", ErrInvalidRequest, err)
}
if recorder := observation.FromContext(ctx); recorder != nil {
recorder.UpdateSelection(observation.Selection{PromptID: def.ID, PromptVersion: copyStringPointer(def.Version),
recorder.UpdateSelection(observation.Selection{PromptID: def.ID,
ProfileID: selection.id, BackendID: effectiveModel.BackendID, Model: effectiveModel.Model})
}
@@ -481,7 +480,6 @@ func (r *Runner) completePreparationWithStructuredOutput(
effectiveModel.APIKey = ""
return &domain.PreparedRun{
PromptID: state.definition.ID,
PromptVersion: copyStringPointer(state.definition.Version),
PromptHash: state.promptDefinitionHash,
SelectedProfileID: state.selectedProfileID,
SelectedBackendID: state.effectiveModel.BackendID,
@@ -713,11 +711,3 @@ func buildOutputArtifact(content string, format domain.OutputFormat) domain.Arti
func hashPromptDefinition(def *domain.PromptDefinition) (string, error) {
return promptdef.HashDefinition(def)
}
func copyStringPointer(value *string) *string {
if value == nil {
return nil
}
copy := *value
return &copy
}