This commit is contained in:
1 parent
2048251eff
commit
8c3d0ee31c
3 files changed
+14
-4
No files matched your search
@@ -206,12 +206,18 @@ func (t *XlsxTranslateTool) Execute(ctx context.Context, args json.RawMessage) (
|
||||
logger.Infof(ctx, "[Tool][XlsxTranslate] session=%s file=%s -> %s units=%d residual=%d llm_calls=%d",
|
||||
sessionID, source, deliverable, report.TranslatedUnits, report.ResidualCJKCount, report.LLMCalls)
|
||||
|
||||
// The file name is written as a Markdown link whose destination is the
|
||||
// canonical sandbox:<name> spelling. The stream handler rebinds that
|
||||
// destination to the artifact's stable reference (resource:// handle, or
|
||||
// sandbox:<name> without a catalog), so the file name inside the answer
|
||||
// itself renders clickable — clicking opens the translated workbook.
|
||||
fileLink := "[" + outName + "](sandbox:" + outName + ")"
|
||||
var b strings.Builder
|
||||
switch {
|
||||
case len(outputLinks) > 0:
|
||||
b.WriteString("Translation finished. The English workbook **" + outName + "** is saved in the output directory (available as a downloadable artifact).\n\n")
|
||||
b.WriteString("Translation finished. The English workbook " + fileLink + " is saved in the output directory (available as a downloadable artifact).\n\n")
|
||||
case attached:
|
||||
b.WriteString("Translation finished. The English workbook **" + outName + "** is attached to this reply as a file card — open it to see details and download.\n\n")
|
||||
b.WriteString("Translation finished. The English workbook " + fileLink + " is attached to this reply — click the file name or the file card to view details and download.\n\n")
|
||||
default:
|
||||
b.WriteString("Translation finished. Download the English workbook **" + outName + "** here: " + deliverable + "\n\n")
|
||||
}
|
||||
|
||||
@@ -280,8 +280,12 @@ func TestXlsxTranslateToolWithoutSandbox(t *testing.T) {
|
||||
if !result.Success {
|
||||
t.Fatalf("tool failed: %s", result.Error)
|
||||
}
|
||||
wantLink := "[D4-A08AR12000002-A3-SIP_EN.xlsx](sandbox:D4-A08AR12000002-A3-SIP_EN.xlsx)"
|
||||
if !strings.Contains(result.Output, wantLink) {
|
||||
t.Fatalf("output missing clickable file link %s: %s", wantLink, result.Output)
|
||||
}
|
||||
if !strings.Contains(result.Output, "file card") {
|
||||
t.Fatalf("output should point at the artifact card: %s", result.Output)
|
||||
t.Fatalf("output should mention the file card: %s", result.Output)
|
||||
}
|
||||
|
||||
msg := sink.messages["assistant-1"]
|
||||
|
||||
Reference in new issue
Block a user