fix(stage): persist every V2 model generation in tracked sessions

This commit is contained in:
2026-10-20 20:39:50 +01:00
parent 1b8d0f2a75
commit cb57da5dfc
7 changed files with 307 additions and 13 deletions
+5 -3
View File
@@ -67,11 +67,13 @@ case "$3" in
n=0; if [ -f %q ]; then n=$(cat %q); fi
n=$((n+1)); echo "$n" > %q
printf '{"data":{"id":"ses_fresh_%%s"}}' "$n" ;;
/api/session/ses_fresh_1/generate) echo '{"_tag":"InvalidRequestError"}'; exit 1 ;;
/api/session/ses_fresh_1/prompt) echo '{"_tag":"InvalidRequestError"}'; exit 1 ;;
/api/session/ses_fresh_1/interrupt) echo '{}' ;;
/api/session/ses_fresh_1) echo '{"data":{"id":"ses_fresh_1"}}' ;;
/api/session/ses_fresh_1/message*) echo '{"data":[{"error":{"message":"provider rejected generation","token":"private-token"}}]}' ;;
/api/session/ses_fresh_2/generate) printf '%%s\n' '{"data":{"text":"# outcome\nsuccess\n"}}' ;;
/api/session/ses_fresh_2/prompt) echo '{}' ;;
/api/session/ses_fresh_2/message*) printf '%%s\n' '{"data":[{"finish":"stop","content":[{"type":"text","text":"# outcome\nsuccess\n"}]}]}' ;;
/api/session/ses_fresh_2) echo '{"data":{"id":"ses_fresh_2"}}' ;;
*) exit 99 ;;
esac
`, log, count, count, count)
@@ -130,7 +132,7 @@ esac
if err != nil {
t.Fatal(err)
}
if strings.Contains(string(calls), "delete") || strings.Count(string(calls), "post /api/session\n") != 2 || strings.Count(string(calls), "ses_fresh_1/generate") != 1 {
if strings.Contains(string(calls), "delete") || strings.Contains(string(calls), "/generate") || strings.Count(string(calls), "post /api/session\n") != 2 || strings.Count(string(calls), "ses_fresh_1/prompt") != 1 {
t.Fatal("session deleted or reused", string(calls))
}
for _, line := range strings.Split(strings.TrimSpace(string(calls)), "\n") {