mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-09 07:29:51 +00:00
feat(claude): add effort setting parity with model across stack (#353)
Co-authored-by: Xiaoyi <xiaoyizhang@microsoft.com>
This commit is contained in:
@@ -50,7 +50,7 @@ export function SessionChat(props: {
|
||||
const agentFlavor = props.session.metadata?.flavor ?? null
|
||||
const controlledByUser = props.session.agentState?.controlledByUser === true
|
||||
const codexCollaborationModeSupported = agentFlavor === 'codex' && !controlledByUser
|
||||
const { abortSession, switchSession, setPermissionMode, setCollaborationMode, setModel } = useSessionActions(
|
||||
const { abortSession, switchSession, setPermissionMode, setCollaborationMode, setModel, setEffort } = useSessionActions(
|
||||
props.api,
|
||||
props.session.id,
|
||||
agentFlavor,
|
||||
@@ -233,6 +233,17 @@ export function SessionChat(props: {
|
||||
}
|
||||
}, [setModel, props.onRefresh, haptic])
|
||||
|
||||
const handleEffortChange = useCallback(async (effort: string | null) => {
|
||||
try {
|
||||
await setEffort(effort)
|
||||
haptic.notification('success')
|
||||
props.onRefresh()
|
||||
} catch (e) {
|
||||
haptic.notification('error')
|
||||
console.error('Failed to set effort:', e)
|
||||
}
|
||||
}, [setEffort, props.onRefresh, haptic])
|
||||
|
||||
// Abort handler
|
||||
const handleAbort = useCallback(async () => {
|
||||
await abortSession()
|
||||
@@ -332,6 +343,7 @@ export function SessionChat(props: {
|
||||
permissionMode={props.session.permissionMode}
|
||||
collaborationMode={codexCollaborationModeSupported ? props.session.collaborationMode : undefined}
|
||||
model={props.session.model}
|
||||
effort={props.session.effort}
|
||||
agentFlavor={agentFlavor}
|
||||
active={props.session.active}
|
||||
allowSendWhenInactive
|
||||
@@ -346,6 +358,7 @@ export function SessionChat(props: {
|
||||
}
|
||||
onPermissionModeChange={handlePermissionModeChange}
|
||||
onModelChange={handleModelChange}
|
||||
onEffortChange={handleEffortChange}
|
||||
onSwitchToRemote={handleSwitchToRemote}
|
||||
onTerminal={props.session.active && terminalSupported ? handleViewTerminal : undefined}
|
||||
terminalUnsupported={props.session.active && !terminalSupported}
|
||||
|
||||
Reference in New Issue
Block a user