Fix agent output validation to prevent false verified status (#807)

* Changes from fix/cursor-fix

* feat: Enhance provider error messages with diagnostic context, address test failure, fix port change, move playwright tests to different port

* Update apps/ui/src/components/views/board-view/dialogs/add-feature-dialog.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* ci: Update test server port from 3008 to 3108 and add environment configuration

* fix: Correct typo in health endpoint URL and standardize port env vars

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
gsxdsm
2026-02-24 20:18:40 -08:00
committed by GitHub
parent 0330c70261
commit 51e9a23ba1
36 changed files with 1610 additions and 104 deletions

View File

@@ -202,6 +202,7 @@ export {
getThinkingTokenBudget,
isAdaptiveThinkingModel,
getThinkingLevelsForModel,
normalizeThinkingLevelForModel,
getDefaultThinkingLevel,
// Event hook constants
EVENT_HOOK_TRIGGER_LABELS,

View File

@@ -260,7 +260,13 @@ export interface ContentBlock {
*/
export interface ProviderMessage {
type: 'assistant' | 'user' | 'error' | 'result';
subtype?: 'success' | 'error' | 'error_max_turns' | 'error_max_structured_output_retries';
subtype?:
| 'success'
| 'error'
| 'error_max_turns'
| 'error_max_structured_output_retries'
| 'error_during_execution'
| 'error_max_budget_usd';
session_id?: string;
message?: {
role: 'user' | 'assistant';

View File

@@ -349,6 +349,28 @@ export function getThinkingLevelsForModel(model: string): ThinkingLevel[] {
return ['none', 'low', 'medium', 'high', 'ultrathink'];
}
/**
* Normalize a selected thinking level to a value supported by the target model.
* Prefers preserving the selected level, falls back to 'none' when available.
*/
export function normalizeThinkingLevelForModel(
model: string,
thinkingLevel: ThinkingLevel | undefined
): ThinkingLevel {
const availableLevels = getThinkingLevelsForModel(model);
const currentLevel = thinkingLevel || 'none';
if (availableLevels.includes(currentLevel)) {
return currentLevel;
}
if (availableLevels.includes('none')) {
return 'none';
}
return availableLevels[0];
}
/**
* Get the default thinking level for a given model.
* Used when selecting a model via the primary button in the two-stage selector.