feat(server): update prompts (#12539)

fix AI-63
fix PD-2567
fix AI-150
fix AI-149
fix AI-148
fix AI-147
fix AI-146
fix AI-145
fix AI-144
fix AI-143

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Enhanced AI-generated responses for writing and code-related prompts with detailed, structured instructions for improved clarity and consistency.
  - Updated AI model for multiple prompts to deliver faster and more accurate results.

- **Bug Fixes**
  - Improved test validation for code explanation and error-checking prompts to better recognize correct outputs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
darkskygit
2025-05-26 19:35:56 +00:00
parent 8b76644fc1
commit 8952ce4fb3
2 changed files with 459 additions and 93 deletions
@@ -191,8 +191,8 @@ const retry = async (
if (ret.passed) {
return ret.commit();
} else {
ret.discard();
t.log(ret.errors.map(e => e.message).join('\n'));
ret.discard({ retainLogs: true });
t.log(ret.errors.map(e => e.message || e.name || String(e)).join('\n'));
t.log(`retrying ${action} ${3 - i}/3 ...`);
}
}
@@ -414,7 +414,9 @@ const actions = [
assertNotWrappedInCodeBlock(t, result);
const cleared = result.toLowerCase();
t.assert(
cleared.includes('single source of truth') || cleared.includes('ssot'),
cleared.includes('single source of truth') ||
/single.*source/.test(cleared) ||
cleared.includes('ssot'),
'should include original keyword'
);
},
@@ -453,7 +455,8 @@ const actions = [
verifier: (t: ExecutionContext<Tester>, result: string) => {
assertNotWrappedInCodeBlock(t, result);
t.assert(
result.toLowerCase().includes('distance'),
result.toLowerCase().includes('distance') ||
/no.*error/.test(result.toLowerCase()),
'explain code result should include keyword'
);
},