Skip to content

MAINT: Store hash in prompt template identifiers - #3340

Open
Isaac Emmanuel (1cbyc) wants to merge 6 commits into
microsoft:mainfrom
1cbyc:1cbyc/3339-template-identifier-hash
Open

Isaac Emmanuel (1cbyc) wants to merge 6 commits into
microsoft:mainfrom
1cbyc:1cbyc/3339-template-identifier-hash

Conversation

@1cbyc

Copy link
Copy Markdown
Contributor

Description

Fixes #3339.

Replace the full configured template in PromptTemplateConverter identifier params with the project-standard 16-character SHA-256 content hash. This keeps identifier metadata fixed-size while preserving deterministic identity across equivalent templates and distinct identity across different templates or strip_characters settings.

The converter documentation notes the one-time identifier hash and autogenerated registry-name change. Conversion output is unchanged, and deprecated TaskFramingConverter identifiers retain their legacy representation.

Tests and Documentation

  • 61 passed, 30 skipped for the focused prompt-template and task-framing converter suites
  • Ruff format and lint checks on changed Python files
  • ty source check for prompt_template_converter.py
  • relevant pre-commit hooks for changed files
  • git diff --check

Co-authored-by: insisong emmanuelisaacnsisong@gmail.com

Co-authored-by: insisong <emmanuelisaacnsisong@gmail.com>
@hannahwestra25 hannahwestra25 self-assigned this Oct 19, 2026
Check the long-template identifier's serialized form instead of str(), which never includes params, and pin its template_hash. Pin the PromptTemplateConverter identifier hash, and assert TaskFramingConverter emits no template_hash and keeps its v1.1.0 hash.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 170f6a4a-a2dd-481d-a201-8cbf40b3d566

@hannahwestra25 hannahwestra25 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for contributing! made a few changes to make the test assertions stricter jfyi

hannahwestra25 and others added 4 commits October 19, 2026 17:08
PromptTemplateConverter has not shipped in a release, so its class docstring should not describe a one-time identifier change for existing configurations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 170f6a4a-a2dd-481d-a201-8cbf40b3d566
@hannahwestra25
hannahwestra25 added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026
@hannahwestra25
hannahwestra25 added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026
@hannahwestra25
hannahwestra25 added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026
@hannahwestra25
hannahwestra25 added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MAINT: Store a template hash in PromptTemplateConverter identifiers

3 participants