chore: remove debug console.log statements from production code
Three debug logs left in production paths: - useAgent.ts: logs task string on every agent execution - HeroSection.tsx: logs getPageInstructions url/hint on every page visit - HeroSection.tsx: logs the full execute() result to the console None of these are error-level events and they leak internal details to the browser console in production builds.
This commit is contained in:
@@ -108,7 +108,6 @@ export function useAgent(): UseAgentResult {
|
||||
|
||||
const execute = useCallback(async (task: string) => {
|
||||
const agent = agentRef.current
|
||||
console.log('🚀 [useAgent] start executing task:', task)
|
||||
if (!agent) throw new Error('Agent not initialized')
|
||||
|
||||
setCurrentTask(task)
|
||||
|
||||
@@ -77,9 +77,7 @@ export default function HeroSection() {
|
||||
instructions: {
|
||||
system: 'You are a helpful assistant on PageAgent website.',
|
||||
getPageInstructions: (url: string) => {
|
||||
const hint = url.includes('page-agent') ? 'This is PageAgent demo page.' : undefined
|
||||
console.log('[instructions] getPageInstructions:', url, '->', hint)
|
||||
return hint
|
||||
return url.includes('page-agent') ? 'This is PageAgent demo page.' : undefined
|
||||
},
|
||||
},
|
||||
|
||||
@@ -98,8 +96,7 @@ export default function HeroSection() {
|
||||
})
|
||||
}
|
||||
|
||||
const result = await win.pageAgent.execute(task)
|
||||
console.log(result)
|
||||
await win.pageAgent.execute(task)
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user