Repository navigation
fix: write tips, session summaries and topic tags in the UI language - #19686
Conversation
Feature tips, the session summary panel and the sidebar topic tags are
dashboard text, but their prompts carried no language instruction, so
the model mirrored whichever language the transcript or context was in.
Home-screen suggestions and session titles already follow
dashboard.language; these three did not.
Each prompt gets a {language} slot filled from the validated UI tag
(context.ui_language_tag). An unset or non-catalog language fills it
with nothing, so the prompt stays byte-identical to what it was. Keys
and control values keep their spelling: the tip id, feature and doc,
the summary JSON keys and status words, and the NONE reply for topic
tags.
The folder suggestion prompt is left alone: the model returns a folder
number, and nothing it writes reaches the card.
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Tips stay cached for up to six hours and that cache is not keyed on language, so check that a language switch showing old tips is acceptable. [DESIGN-REVIEWED] c68cdf9 Description read[DESCRIPTION-READ] 4c340f698e783c46f9eacf883042ebb570796edb45e0dd04bd06f20247b6482d That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This review's patch file also carried aws-control, registry.json and steer changes from #19783/#19800/#19795, which are already on main. Confirm the PR's own diff is just the 8 files it declares. What this change shipsInventory (5 items) — 5 justifiedIntent: when someone has set a dashboard language, their feature tips, session summaries and topic tags come out in that language instead of the language of whatever they last typed or pasted. FIX (#19530; 9 of the 18 new cases fail on base).
[FIRST-PRINCIPLES-REVIEWED] c68cdf9 Description read[DESCRIPTION-READ] 90aacb354a20acca1ef7bf7a4bda6bb67db2343ec7657a9844b78a5a957e5b44 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsHindi and Bengali workspaces now get no topic tags at all; the language directive asks for a script the tag filter always rejects. FINDING — src/kiro_crew/dashboard/chat_auto_tag.py:259 — when [OPUS-REVIEWED] c68cdf9 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
The off-loop test installed its recording shim through monkeypatch while the patch_save_slot fixture already held asyncio.to_thread. An autouse fixture owns that monkeypatch, so it unwinds after the fixture and puts the fixture's synchronous mock back for every test that follows in the same process, which then runs its own to_thread calls on the event loop. The shim now lives in a context manager around the one call it observes, so the fixture's patch is the last one standing and is undone on its own exit.
|
Pushed a test-isolation fix; closing and reopening again so CI runs on hosted runners (same fleet-queue shape as before). |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (8 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: generated tips, session summaries and topic tags now take the configured dashboard language in their prompts, and an unset or unshipped language leaves each prompt unchanged. Spec files changed as a ride-along (a minority of the diff on both file count and changed lines), not reviewed as a design decision: docs/system-specs/modules/learn-cron-dashboard.md, docs/system-specs/modules/session-summary.md.
Problem / Motivation
Goal: Feature tips, session summaries and topic tags appear in the language the user chose for the dashboard, not in whichever language their latest messages happen to be in.
Three background prompts produce text the dashboard shows and tell the model nothing about the UI language: the feature-tips prompt (
_PROMPT_TEMPLATEintips.py), the session-summary prompt (_PROMPTindashboard/chat_summary.py) and the topic-tag prompt (_TOPIC_PROMPT_TEMPLATEindashboard/chat_auto_tag.py). With no instruction the model mirrors what it is given: the user context for tips, the transcript for summaries, the first message for tags. A user who set the dashboard tozh-CNsees the heading, buttons and sidebar in Chinese beside a tip, a summary or a tag in English, or in whatever language the last pasted log was in. Home-screen suggestions and session titles already avoid this by taking the configured tag:_build_prompt(suggestions.py:112) and_build_title_prompt(dashboard/chat_title.py:640).Why it matters
A summary is written once and kept in the transcript's sidecar until the transcript changes, and a topic tag is stored on the session, so a mismatched language stays on screen. The language also flips with the content a prompt reads, so the same dashboard shows one language today and another after a pasted stack trace. #19301 closed this for suggestions; #19530 records the prompts it left out.
Not a goal
dashboard/chat_folder_suggest.py), which Steer the remaining UI-visible background prompts by the UI language #19530 also lists. The model answers with a folder number orNONE(_parse_choice,dashboard/chat_folder_suggest.py:207), and the card payload takes the stored folder name and breadcrumb inmaybe_suggest_folder(dashboard/chat_folder_suggest.py:391-392; module docstring, lines 15-16: "nothing generated reaches the card"). A language line there would change nothing a user sees, and the reply has to stay a bare number.dashboard/chat_nav.py. They are UI text, but Steer the remaining UI-visible background prompts by the UI language #19530 does not name them, so they are left for a follow-up.id,featureanddoc, the summary's JSON keys andstatuswords, and theNONEreply.cta_prompt. No page renders it; the card's type only declares the field (cta_promptatwebsite/src/components/TipCard.tsx:51), so the directive names the three fields the card shows.What changed (motivation → approach → change)
_build_title_promptand the suggestions_build_promptalready use. A{language}slot sits outside the data the prompt carries, and is filled from the tagcontext.ui_language_tagreturns (shape- and catalog-gated). An unset language, or a tag naming no shipped catalog, fills the slot with nothing, so the prompt is byte-identical to today's.tips.py:104andtips.py:127: the slot, and a template asking fortitle,bodyandwhyin the tag's language whileid,featureanddocstay as the catalog gives them (docis matched against the catalog and is the dismissal identity).tips.py:1124-1133:generate_tipsloads the config before building the prompt, reads the tag from it, and fills the slot.{language}slot beforeTRANSCRIPT(dashboard/chat_summary.py:146) and_LANGUAGE_TEMPLATE(dashboard/chat_summary.py:159), a template covering every free-text value while the JSON keys andstatuswords stay as spelled (normalize_payloadcoerces an unknown status toactive)._build_prompt(dashboard/chat_summary.py:169-176) fills the slot withstr.replaceon the constant alone (the prompt holds literal JSON braces), before the transcript is appended, so a transcript that quotes{language}cannot restate it._generate_locked(dashboard/chat_summary.py:444) passes the tag from the config the pass already holds.{language}slot at the end of_TOPIC_PROMPT_TEMPLATE(dashboard/chat_auto_tag.py:92) and_LANGUAGE_TEMPLATE(dashboard/chat_auto_tag.py:101), a template that keepsNONEliteral (a translated one would be stored as a tag;_parse_topic_tagsdrops only the ASCII word) and sizes unspaced scripts._maybe_topic_tags(dashboard/chat_auto_tag.py:255-259) takes the tag fromchat_title._ui_language()dispatched withasyncio.to_thread, which answers""when the config read fails.docs/system-specs/modules/session-summary.mdanddocs/system-specs/modules/learn-cron-dashboard.md(tips): state the behaviour and that cached output keeps its language until it regenerates.Backwards compatibility
Compatible: with no
dashboard.languageset, or one naming no shipped catalog, the three prompts are byte-identical tode2d143dcf(I rendered each with the language unset on that commit and on this branch; the digests are equal). With one set, new tips and summaries are written in it and so are new topic tags. A tag is matched by its name, so a workspace that switches language holdsdebuggingon older sessions and its translation on newer ones.Removes nothing: no name, key, route, setting or string is removed;
generate_tipsonly reads the config before building its prompt instead of after.Tests
In short: with only the three changed or new test files copied onto
origin/mainde2d143dcf, the 18 new cases give 9 failed and 9 passed in 3 of 3 runs (the 9 that pass pin what main already does: no language line without a usable language, and the tips config load off the loop); on this branch the same command is 18 passed, and the three files are 134 passed, in 3 of 3 runs. Twelve mutations each fail only their own cases. Neighbours: 29 files, 3203 passed; ratchets 226 passed.test/test_tips_language.pytest_prompt_carries_the_configured_ui_language(zh-CN,ja){language}test_prompt_keeps_the_identifying_fields_out_of_the_ui_languageid,featureanddocstay as giventest_prompt_has_no_language_line_without_a_usable_ui_language("",ar,None)test_ui_language_is_read_off_the_event_looptest/test_session_summary_generate.pyTestPromptFollowsTheUiLanguage(5 cases)statusstay;""andarleave the prompt as the constant with the slot removed; a transcript quoting{language}does not add a second language linetest/test_tag_session.pyTestTopicTagsUiLanguage(6 cases)NONEstays literal; no line for""oraror a config that cannot answer; the lookup goes throughasyncio.to_threadRed,
pytest -n 0 -k ui_languageon the three files in a detached checkout oforigin/mainde2d143dcf, RC=1 in 3 of 3 runs:Green on this branch, the three whole files, RC=0 in 3 of 3 runs:
Mutations, one source line each, run against the 18 new cases (baseline 18 passed):
ar,None). A second config load on the loop, 1 fails (off-loop). The identifier clause removed, 1 fails.ar). Thestatusclause removed, 1 fails.NONEclause removed, 1 fails.Neighbours: the 29 test files that name
kiro_crew.tips,generate_tips,chat_summary,generate_session_summary,chat_auto_tagormaybe_auto_tag(git grep -l; they include the three changed files,test_tips.pyandtest_tips_edition_pool.py), 3203 passed. The wait-discipline, flake-pattern, pid-reader, tmpdir-helper, dir-fd-race, kill-chokepoint, agent-admission, ratchet-scope, main-ratchet-audit, fd-census and deferred-disposition ratchets: 226 passed.Manual verification
N/A — unit coverage sufficient: the change is the text of three model prompts, and each test captures the prompt handed to
run_bg_oneliner. A live call would exercise the model, not this change.Related Issues
Refs #19530 (three of the four prompts the issue names; the folder-suggestion prompt is left as described under Not a goal, for the maintainer to close or split)
Refs #19301
Pattern harvest
Rule candidate: review-prompt
Pattern: a
run_bg_onelinerprompt whose reply the dashboard renders, with no{language}slot filled fromcontext.ui_language_tag.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.