format_skills_as_xml escapes quotes in skill description, corrupting the prompt text
Les mainteneurs répondent en général sous 3 jours
Évaluation
Cette issue n'a pas encore été évaluée.
Description
🔴 Required Information
Describe the Bug:
google.adk.skills.prompt.format_skills_as_xml calls html.escape() with its default quote=True. Every " and ' in a skill's description is therefore turned into " / ' before the text goes into the system prompt. The skills block is plain text for an LLM, not an XML attribute value, so only <, > and & need escaping to keep the structure valid. Escaping quotes makes the description harder for the model to read and changes what the skill author wrote.
Steps to Reproduce:
- Run the following:
from google.adk.skills import models, prompt skills = [ models.Frontmatter( name="my-skill", description='never break the user\'s spaghetti, "al dente" is the law', ) ] print(prompt.format_skills_as_xml(skills)) - Look at the
<description>block in the output.
Expected Behavior:
The description is rendered as written:
<description>
never break the user's spaghetti, "al dente" is the law
</description>
Observed Behavior:
Quotes are HTML-escaped:
<description>
never break the user's spaghetti, "al dente" is the law
</description>
Environment Details:
- ADK Library Version (pip show google-adk): main (2.14.1) @
e1deb17f5 - Desktop OS: Linux
- Python Version (python -V): 3.11.18
Model Information:
- Are you using LiteLLM: No
- Which model is being used: N/A (the bug is in prompt construction, before any model call)
🟡 Optional Information
Regression:
Not checked. The html.escape(...) calls in src/google/adk/skills/prompt.py look like they were added with the escaping of </>/&, and the default quote=True was probably not intended.
Logs:
N/A
Screenshots / Video:
N/A
Additional Context:
The fix is to pass quote=False to both html.escape calls in format_skills_as_xml (name and description). <, > and & are still escaped, so the XML structure stays protected. The existing test desc<ription> still passes. A regression test, test_format_skills_as_xml_preserves_description_quotes, is added in tests/unittests/skills/test_prompt.py.
The fix is also applied to the name attribute, even if its field validator currently doesn't allow such values.
Minimal Reproduction Code:
from google.adk.skills import models, prompt
description = 'never break the user\'s spaghetti, "al dente" is the law'
xml = prompt.format_skills_as_xml(
[models.Frontmatter(name="my-skill", description=description)]
)
assert description in xml # fails: quotes are rendered as " / '
How often has this issue occurred?:
- Always (100%)
- Langage dominant
- Python
- Étoiles
- 22.3k
- Forks
- 4.4k
- Merge moyen
- 1 j 2 h
- PR mergées (30 j)
- 6
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de google/adk-python
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
google/adk-python#8360 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
google/adk-python#8359 ·
Les mainteneurs répondent en général sous 3 jours
-
Can pin to litellm version be changed?Peut-être pris @llalitkumarrr l’a pris il y a 10 jours. Ouvertemodels
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
google/adk-python#8129 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
-
OpenAPI tools ignore operation- and path-level server overridesPeut-être pris @sanketpatil06 l’a pris il y a 14 jours. Ouvertetools
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
google/adk-python#8064 · 4 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
-
Two docstrings in openapi_tool document parameters the signatures do not acceptPeut-être pris @surajksharma07 l’a pris il y a 17 jours. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
google/adk-python#8024 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de google/adk-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
vllm-project/vllm#70030 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
TigreGotico/tugaphone#408 ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
gke-labs/kube-agents#7308 ·
Les mainteneurs répondent en général sous 1 jour
-
t: bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 3 jours
-
chore
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100
lugassawan/swe-workbench#841 ·