Repository navigation
[BUG]: TS Direct JSON prompt generator should put the protocol schemas in base rules (TS follow-up to #3526) #3562
Copy link
Copy link
Open
Labels
P1This is a priority. Team is actively working on it, or will be soon.This is a priority. Team is actively working on it, or will be soon.component: agent sdkRelating to the agent SDK libraries in any languageRelating to the agent SDK libraries in any languagecomponent: specificationAffects the A2UI specification documents and JSON schemasAffects the A2UI specification documents and JSON schemasfeature: prompt generatorlang: pythonAffects SDKs or apps in the Python programming languageAffects SDKs or apps in the Python programming languagelang: typescriptTypescript agent SDK issuesTypescript agent SDK issuesstatus: first-line-handledtype: bugSomething isn't workingSomething isn't working
Milestone
Description
The Python fix for #3526 (#3559) moves the Direct JSON protocol schemas (the agent-to-renderer schema and the common types schema) from generate_catalog_instructions() into generate_base_rules(). The TypeScript DirectJsonPromptGenerator needs the same change, so that the two SDKs split their output across the hooks the same way.
Current behavior
typescript/agents/a2ui_agent/src/inference-formats/direct-json/prompt-generator.ts:
generateBaseRules()returns onlyDEFAULT_WORKFLOW_RULES.generateCatalogInstructions(catalog?)returns the agent-to-renderer schema, the pruned common types schema and the catalog schemas, all in one schema block.
Nothing triggers the duplication on main, because TS has no SkillGenerator yet. Once #3397 lands, SkillGenerator.generateSkill() calls generateCatalogInstructions(c) once per catalog. A monolithic Direct JSON skill with two catalogs would then repeat the protocol schemas, as Python did before #3559.
Expected behavior
Match #3559:
generateBaseRules(allowedMessages?)returns the workflow rules followed by a schema block with the agent-to-renderer schema (pruned to the allowed messages) and the common types schema (pruned against all of the generator's catalogs).generateCatalogInstructions(catalog?)returns a schema block with only the catalog schemas.generate()/promptSnippetstays byte-identical, so the prompt conformance fixtures don't change.
Done looks like
- The TS change lands before or together with feat(agent): implement Skill, SkillSet, and SkillGenerator #3397.
- A Direct JSON test with two catalogs checks that the monolithic skill holds the protocol schemas once, the
a2ui-coreskill holds them, and catalog skills don't. - Once both SDKs agree, a Direct JSON case can be added to
conformance/agent/skill.yaml([v1.0][skill] Heading mismatch (### Examples: vs ## Examples) in SkillGenerator and zero direct_json test cases in conformance/agent/skill.yaml #3464).
Metadata
Metadata
Assignees
Labels
P1This is a priority. Team is actively working on it, or will be soon.This is a priority. Team is actively working on it, or will be soon.component: agent sdkRelating to the agent SDK libraries in any languageRelating to the agent SDK libraries in any languagecomponent: specificationAffects the A2UI specification documents and JSON schemasAffects the A2UI specification documents and JSON schemasfeature: prompt generatorlang: pythonAffects SDKs or apps in the Python programming languageAffects SDKs or apps in the Python programming languagelang: typescriptTypescript agent SDK issuesTypescript agent SDK issuesstatus: first-line-handledtype: bugSomething isn't workingSomething isn't working
Type
Projects
- StatusShow more project fieldsTodo
Activity
feat(agent)!: use one prompt snippet layout across Python, TS and Dart
feat(agent)!: use one prompt snippet layout across Python, TS and Dart
feat(agent)!: use one prompt snippet layout across Python, TS and Dart