mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-16 21:53:07 +00:00
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:
@@ -202,6 +202,7 @@ export {
|
||||
getThinkingTokenBudget,
|
||||
isAdaptiveThinkingModel,
|
||||
getThinkingLevelsForModel,
|
||||
normalizeThinkingLevelForModel,
|
||||
getDefaultThinkingLevel,
|
||||
// Event hook constants
|
||||
EVENT_HOOK_TRIGGER_LABELS,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user