I've noticed Claude Opus 4.5 regularly decides to write it's own handlers for the form remote function.
Here's an example of code it writes (removed irrelevant parts):
<script lang="ts">
import { approveJob } from './content.remote'
let approving = $state(false)
async function handleApprove() {
if (approving) return
approving = true
try {
const result = await approveJob({ id: contentId })
if (result?.success) {
toast.success('Job approved and employer notified!')
// Reload the page to show updated status
window.location.reload()
} else {
toast.error('Failed to approve job')
}
} catch {
toast.error('Failed to approve job')
} finally {
approving = false
}
}
</script>
<Button onclick={handleApprove} variant="primary" disabled={approving}>
{approving ? 'Approving...' : 'Approve & Notify Employer'}
</Button>
{/if}
I've noticed Claude Opus 4.5 regularly decides to write it's own handlers for the form remote function.
Here's an example of code it writes (removed irrelevant parts):