Skip to content

fix(director): Match a Behavior name in any case - #235

Closed
omesser wants to merge 1 commit into
mainfrom
fix/231-behavior-name-case
Closed

omesser wants to merge 1 commit into
mainfrom
fix/231-behavior-name-case

Conversation

@omesser

@omesser omesser commented Sep 2, 2026 •

Copy link
Copy Markdown
Owner

What

Two leftovers from the case-match that #233 already shipped:

  1. Trim a trailing . or : on the Behavior name in parse_proposal, before the identifier check. Prowl. and prowl: become prowl (then declared maps case as fix(engine): Match a declared Behavior however the model capitalises it #233 already does).
  2. say with nothing after it is Wake::Failed, so Static takes the turn. Bare say, say:, and Say. no longer speak the word "say". say | hello and say: hello still speak hello.

Why

#231 is closed for the case bug. These two were on the same branch and were left on the close comment so they would not vanish.

A trailing full stop or colon is the model finishing a sentence, not a different name. #175 saw Prowl. now and then. Without the trim that token fails identifier, parse_proposal errors, and the whole reply becomes speech — the buddy talks and never acts, the same symptom #233 fixed for case. One line at the parser.

Empty say is a pre-existing quirk: the say arm still did .or(Some(proposal.behavior)), so a reply that is only say speaks "say". The trim makes say: and Say. reach that arm, so the quirk widens unless empty say falls back to Static.

Not done: logging an unknown-but-close name under AI_BUDDY_TRACE_DIRECTOR (#231 also floated that). Observability, not this fix.

Does not close #231 (already closed by #233).

How to test

Automated scenarios this PR covers:

  • Prowl., prowl:, and PROWL. | hunting play declared prowl
  • Parser trim: nap. / nap: are the name nap; dialogue after | is untouched; Nap. still comes through as Nap for declared to map
  • say, say:, and Say. are a failed wake (Static), not spoken "say"
  • say | hello still speaks hello

Every local model measured in #175 capitalises the Behavior it names, and
the exact compare threw the reply away as speech. The proposal now carries
the declared spelling, which is the one the Engine can find. A trailing
full stop or colon is trimmed; `say` with nothing to say falls back to
Static instead of saying "say". The trace-logging the issue floated is left
out — observability, not the fix.
@omesser

omesser commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

Closing as redundant: #233 merged at 12:40 with the same fix — declared() returning the Character's own spelling, matched without case, with the speech-or-fail fallback extracted — and closed #231. This branch was cut from 3fef476 before that landed, and I did not check for an in-flight PR on the issue before starting. My miss.

Two things this branch had that #233 left out, recorded here in case either is wanted as a small follow-up rather than lost:

Neither is worth a PR of its own unless the harness on #230 shows the trailing-punctuation case often enough to matter. The tests for both are on this branch if anyone wants them.

@omesser omesser closed this Sep 2, 2026
@omesser
omesser deleted the fix/231-behavior-name-case branch September 2, 2026 12:43
@omesser

omesser commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

GitHub would not reopen this PR after fix/231-behavior-name-case was recreated from main (force-pushed/recreated history). The two leftovers now live in #242: trailing ./:trim on the Behavior name, and emptysay` falling back to Static.

@omesser

omesser commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

Landed as #242 (this PR could not be reopened after the branch rewrite). Trailing ./:trim and emptysay` → Static are on main.

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.

A Behavior name in the wrong case is thrown away, so local models never act

1 participant