feat(workflows): agent node#50934
feat(workflows): agent node#50934kappa90 wants to merge 2 commits into03-13-feat_ph-ai_background_sandbox_agent_apifrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Size Change: +321 B (0%) Total Size: 109 MB ℹ️ View Unchanged
|
Prompt To Fix All With AIThis is a comment left during a code review.
Path: nodejs/src/cdp/async-functions/agent.ts
Line: 25-29
Comment:
**`github_installation` not forwarded to agent endpoint**
The UI collects `github_installation` (the OAuth integration ID) so the agent can authenticate with GitHub, but it is never included in the request body sent to `/agent/run`. Without this, the backend agent has no way to identify which GitHub integration to use when accessing repository data.
```suggestion
body: JSON.stringify({
message: prompt,
github_installation: opts?.github_installation ?? null,
repository: opts?.repository ?? null,
output_schema: opts?.output_schema ?? null,
}),
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: nodejs/src/cdp/services/hog-executor.service.ts
Line: 676-678
Comment:
**Falsy check skips `timeout_ms: 0`**
Using `if (params.timeout_ms)` treats `0` as falsy, so a caller that explicitly passes `timeout_ms: 0` would have the timeout silently ignored. Prefer an explicit nullish check to be robust against future callers:
```suggestion
if (params.timeout_ms != null) {
fetchParams.timeoutMs = params.timeout_ms
}
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: products/workflows/frontend/Workflows/hogflows/steps/components/CyclotronJobInputAgentConfig.tsx
Line: 87-98
Comment:
**`setState` called during render**
Calling `setOutputFields` directly in the render body (outside of `useEffect`) is a React anti-pattern. While React does handle this case by discarding the current render and immediately re-rendering with the new state, it is flagged by React's strict-mode double-render checks and can be harder to reason about than an explicit `useEffect`.
Consider replacing this block with a `useEffect` that watches `config.output_schema`:
```
useEffect(() => {
const incomingStr = JSON.stringify(config.output_schema)
const currentStr = JSON.stringify(lastSyncedSchema.current)
if (incomingStr !== currentStr) {
setOutputFields(schemaToFields(config.output_schema))
lastSyncedSchema.current = config.output_schema
}
}, [config.output_schema])
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 60b05e9 |
| lastSyncedSchema.current = config.output_schema | ||
| } | ||
| } | ||
|
|
||
| const updateFields = useCallback( | ||
| (fields: OutputField[]) => { | ||
| setOutputFields(fields) | ||
| const schema = fieldsToSchema(fields) | ||
| lastSyncedSchema.current = schema | ||
| update({ output_schema: schema }) | ||
| }, | ||
| [update] |
There was a problem hiding this comment.
setState called during render
Calling setOutputFields directly in the render body (outside of useEffect) is a React anti-pattern. While React does handle this case by discarding the current render and immediately re-rendering with the new state, it is flagged by React's strict-mode double-render checks and can be harder to reason about than an explicit useEffect.
Consider replacing this block with a useEffect that watches config.output_schema:
useEffect(() => {
const incomingStr = JSON.stringify(config.output_schema)
const currentStr = JSON.stringify(lastSyncedSchema.current)
if (incomingStr !== currentStr) {
setOutputFields(schemaToFields(config.output_schema))
lastSyncedSchema.current = config.output_schema
}
}, [config.output_schema])
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/workflows/frontend/Workflows/hogflows/steps/components/CyclotronJobInputAgentConfig.tsx
Line: 87-98
Comment:
**`setState` called during render**
Calling `setOutputFields` directly in the render body (outside of `useEffect`) is a React anti-pattern. While React does handle this case by discarding the current render and immediately re-rendering with the new state, it is flagged by React's strict-mode double-render checks and can be harder to reason about than an explicit `useEffect`.
Consider replacing this block with a `useEffect` that watches `config.output_schema`:
```
useEffect(() => {
const incomingStr = JSON.stringify(config.output_schema)
const currentStr = JSON.stringify(lastSyncedSchema.current)
if (incomingStr !== currentStr) {
setOutputFields(schemaToFields(config.output_schema))
lastSyncedSchema.current = config.output_schema
}
}, [config.output_schema])
```
How can I resolve this? If you propose a fix, please make it concise.ccd69a8 to
9dd9ec2
Compare
60b05e9 to
52bedb0
Compare
52bedb0 to
bd62124
Compare
9dd9ec2 to
2e0d5c7
Compare
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, please remove the |

Problem
This adds support for AI agent functionality in workflows, allowing users to run AI agents that can analyze data, answer questions, and return structured output. The feature is gated behind the
WORKFLOW_AI_AGENTfeature flag.To test this, you need to have this branch checked out in the code repository, follow
SETUP_GUIDE.mdon how to test sandbox agents locally, and set these env vars:Screen Recording 2026-03-12 at 21.23.34.mov (uploaded via Graphite)
Changes
postHogRunAgentasync function that makes HTTP requests to/agent/runendpoint with configurable timeout (11 minutes)agent_configinput type support across frontend and backend systemsCyclotronJobInputAgentConfigReact component for configuring:The agent configuration UI uses collapsible sections for optional settings and includes:
How did you test this code?
The code includes mock functionality for the
postHogRunAgentfunction that returns a sample response structure. Frontend components were tested for proper state management and UI interactions. Backend validation ensures proper input schema handling and async function registration.Publish to changelog?
Yes - this introduces a new AI agent capability for workflows that allows users to integrate AI-powered analysis and data processing into their automation flows.