v0.1.1 fix: punctuation-insensitive customer lookup + pin google-adk <3#1
Merged
Conversation
Trailing or embedded punctuation ("Soylent Corp.", "Globex Corp.") missed the
ILIKE '%'||$1||'%' substring match, so the agent reported "not found" for a
customer that exists. search_customers and get_open_issues now strip
non-alphanumerics from both the column and the bound parameter before matching;
$1 stays parameterised (no injection). MemoryStore.customer_key mirrors the same
normalisation via _normalize_customer_name so the Redis cache key agrees with the
DB lookup.
Verified: TDD unit tests, a live regression test, a direct-SQL check against
Postgres, and a new eval case (customer-name-with-trailing-punctuation). Eval 11/11.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…0.1.1 SequentialAgent (used by the escalation skill) is @deprecated in ADK 2.5.0 in favour of Workflow, which is not yet exported from google.adk.agents and cannot yet be an LlmAgent sub-agent — so it is kept deliberately. Pin google-adk >=2.5.0,<3 (was the loose >=1.0.0) so a future 3.0 can't silently remove the class and break the build. Documented at the use site (app/skills/escalation.py) and in README + docs/architecture.md. Bump version 0.1.0 -> 0.1.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Two changes to the Acme Operations assistant:
Fix: customer names with punctuation now resolve. A name typed with trailing/embedded punctuation (
"Soylent Corp.","Globex Corp.") missed theILIKE '%'||$1||'%'substring match, so the agent reported "not found" for a customer that exists. Bothsearch_customersandget_open_issuesnow strip non-alphanumerics from both the column and the bound parameter before matching ($1stays parameterised — no injection surface).MemoryStore.customer_keymirrors the same normalisation so the Redis cache key agrees with the DB lookup.Harden: pin
google-adk, document theSequentialAgentdeprecation.SequentialAgent(used by the escalation skill) is@deprecatedin ADK 2.5.0 in favour ofWorkflow— which is not yet exported fromgoogle.adk.agentsand, per ADK's own note, cannot yet be used as anLlmAgentsub-agent. It is kept deliberately. Pinnedgoogle-adk>=2.5.0,<3(was the loose>=1.0.0) so a future 3.0 can't silently remove the class and break the build. Rationale documented at the use site + README/architecture.Why
The punctuation quirk was a real "customer not found" failure for valid input — a papercut on the core lookup path. And the dependency floor was loose enough that a routine re-lock could pull a version without
SequentialAgent, breaking the build with no code change on our side.Changes
toolbox/tools.yaml—regexp_replace(name, '[^[:alnum:]]', '', 'g')on both sides of theILIKEinsearch_customers+get_open_issuesapp/memory.py— new_normalize_customer_name;customer_keydelegates to itpyproject.toml/uv.lock—google-adk>=2.5.0,<3; version0.1.0 → 0.1.1app/skills/escalation.py,README.md,docs/architecture.md— deprecation rationaletest_customer_key_*), live (test_trailing_punctuation_resolves_customer), eval case (customer-name-with-trailing-punctuation)Verification (run against the live stack — not fabricated)
pytest tests/unit— all pass (TDD, RED → GREEN)ruff check app db tests evalclean;ruff format --checkclean;mypyclean"Soylent Corp."→ 0 rows; new pattern → resolves; unknown customer → still 0 rows (graceful-absence preserved)"Soylent Corp."→ Soylent Corp and"Globex Corp."→ Globex Corporation, grounded in DB valuesget_open_issues, both escalation cases, graceful-absence all pass)Test plan
docker compose restart toolboxpicks up thetools.yamlchange (Toolbox reads--tools-fileat startup)🤖 Generated with Claude Code