Skip to content

fix(chat): fallback to legacy parser if autoparser generation fails#124

Merged
marksverdhei merged 1 commit into
htfrom
fix/autoparser-fallback-2
Jun 15, 2026
Merged

fix(chat): fallback to legacy parser if autoparser generation fails#124
marksverdhei merged 1 commit into
htfrom
fix/autoparser-fallback-2

Conversation

@marksverdhei

Copy link
Copy Markdown

Replaces #120 (which had merge conflicts). Fixes #117.

@marksverdhei
marksverdhei merged commit 53296b8 into ht Jun 15, 2026
0 of 7 checks passed
@marksverdhei
marksverdhei deleted the fix/autoparser-fallback-2 branch June 15, 2026 18:31
marksverdhei added a commit that referenced this pull request Jun 16, 2026
…125)

PR #124 added an autoparser-failure fallback in
common_chat_templates_apply_jinja() that calls
common_chat_templates_apply_legacy(), but that static function is
defined later in chat.cpp with no forward declaration, so the file
fails to compile:

  error: 'common_chat_templates_apply_legacy' was not declared in
  this scope

Add the forward declaration. The break reached ht because the full
C++ build (build-cpu) is workflow_dispatch-only, so push CI did not
catch it.

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 16, 2026
build-cpu's push trigger was branches:[master] only — an upstream
leftover never retargeted to this fork's default branch (ht). So a
merge to ht never re-ran the compile check on the branch itself.

PR #124 landed a non-compiling commit on ht: build-cpu ran on its PR
and failed every job, but ht has no branch protection so the red PR
was merged, and nothing re-flagged the break on ht afterward (the red
was only on the PR). Adding ht to push.branches gives the default
branch the same compile-on-push coverage master already has, so a
broken main is visible on the branch.

(pull_request already covers PRs to ht. The stronger prevention — a
ruleset requiring build-cpu before merge — is a repo-settings decision
and is left to the maintainer, since ht intentionally runs without
branch protection.)

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 18, 2026
…124)

Fixes #117

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 18, 2026
…125)

PR #124 added an autoparser-failure fallback in
common_chat_templates_apply_jinja() that calls
common_chat_templates_apply_legacy(), but that static function is
defined later in chat.cpp with no forward declaration, so the file
fails to compile:

  error: 'common_chat_templates_apply_legacy' was not declared in
  this scope

Add the forward declaration. The break reached ht because the full
C++ build (build-cpu) is workflow_dispatch-only, so push CI did not
catch it.

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 18, 2026
build-cpu's push trigger was branches:[master] only — an upstream
leftover never retargeted to this fork's default branch (ht). So a
merge to ht never re-ran the compile check on the branch itself.

PR #124 landed a non-compiling commit on ht: build-cpu ran on its PR
and failed every job, but ht has no branch protection so the red PR
was merged, and nothing re-flagged the break on ht afterward (the red
was only on the PR). Adding ht to push.branches gives the default
branch the same compile-on-push coverage master already has, so a
broken main is visible on the branch.

(pull_request already covers PRs to ht. The stronger prevention — a
ruleset requiring build-cpu before merge — is a repo-settings decision
and is left to the maintainer, since ht intentionally runs without
branch protection.)

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 21, 2026
…124)

Fixes #117

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 21, 2026
…125)

PR #124 added an autoparser-failure fallback in
common_chat_templates_apply_jinja() that calls
common_chat_templates_apply_legacy(), but that static function is
defined later in chat.cpp with no forward declaration, so the file
fails to compile:

  error: 'common_chat_templates_apply_legacy' was not declared in
  this scope

Add the forward declaration. The break reached ht because the full
C++ build (build-cpu) is workflow_dispatch-only, so push CI did not
catch it.

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 21, 2026
build-cpu's push trigger was branches:[master] only — an upstream
leftover never retargeted to this fork's default branch (ht). So a
merge to ht never re-ran the compile check on the branch itself.

PR #124 landed a non-compiling commit on ht: build-cpu ran on its PR
and failed every job, but ht has no branch protection so the red PR
was merged, and nothing re-flagged the break on ht afterward (the red
was only on the PR). Adding ht to push.branches gives the default
branch the same compile-on-push coverage master already has, so a
broken main is visible on the branch.

(pull_request already covers PRs to ht. The stronger prevention — a
ruleset requiring build-cpu before merge — is a repo-settings decision
and is left to the maintainer, since ht intentionally runs without
branch protection.)

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 27, 2026
…124)

Fixes #117

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 27, 2026
…125)

PR #124 added an autoparser-failure fallback in
common_chat_templates_apply_jinja() that calls
common_chat_templates_apply_legacy(), but that static function is
defined later in chat.cpp with no forward declaration, so the file
fails to compile:

  error: 'common_chat_templates_apply_legacy' was not declared in
  this scope

Add the forward declaration. The break reached ht because the full
C++ build (build-cpu) is workflow_dispatch-only, so push CI did not
catch it.

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
marksverdhei added a commit that referenced this pull request Jun 27, 2026
build-cpu's push trigger was branches:[master] only — an upstream
leftover never retargeted to this fork's default branch (ht). So a
merge to ht never re-ran the compile check on the branch itself.

PR #124 landed a non-compiling commit on ht: build-cpu ran on its PR
and failed every job, but ht has no branch protection so the red PR
was merged, and nothing re-flagged the break on ht afterward (the red
was only on the PR). Adding ht to push.branches gives the default
branch the same compile-on-push coverage master already has, so a
broken main is visible on the branch.

(pull_request already covers PRs to ht. The stronger prevention — a
ruleset requiring build-cpu before merge — is a repo-settings decision
and is left to the maintainer, since ht intentionally runs without
branch protection.)

Co-authored-by: marksverdhei <mark.sverdhei@gmail.com>
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.

Autoparser hard-fails (500) on templates that raise during render — should fall back to legacy parser

1 participant