-
Notifications
You must be signed in to change notification settings - Fork 1.3k
update agent docs #1411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update agent docs #1411
Conversation
|
Greptile OverviewGreptile SummaryUpdated agent documentation to reflect four new experimental features available for non-CUA agents:
The reference documentation was updated with new interface definitions, parameter descriptions, error types, and comprehensive code examples organized in tabs. All examples follow TypeScript conventions and consistently use camelCase naming per project standards. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Agent
participant LLM
participant Browser
User->>Agent: execute(instruction, options)
alt With Streaming
Agent->>User: Return AgentStreamResult
loop Each Step
Agent->>LLM: Generate next action
opt prepareStep callback
Agent->>User: prepareStep(context)
User-->>Agent: Modified context
end
LLM-->>Agent: Action + reasoning chunks
opt onChunk callback
Agent->>User: onChunk(chunk)
end
Agent->>Browser: Execute action
Browser-->>Agent: Action result
opt onStepFinish callback
Agent->>User: onStepFinish(event)
end
end
opt onFinish callback
Agent->>User: onFinish(result)
end
Agent->>User: Resolve result promise
else Without Streaming
loop Each Step
Agent->>LLM: Generate next action
opt prepareStep callback
Agent->>User: prepareStep(context)
User-->>Agent: Modified context
end
LLM-->>Agent: Action + reasoning
Agent->>Browser: Execute action
Browser-->>Agent: Action result
opt onStepFinish callback
Agent->>User: onStepFinish(event)
end
end
Agent->>User: Return AgentResult
end
opt Message Continuation
User->>Agent: execute(instruction, {messages: previousMessages})
Note over Agent,LLM: Agent continues conversation<br/>with previous context
end
opt Abort Signal
User->>Agent: controller.abort()
Agent-->>User: Throw AgentAbortError
opt onAbort callback
Agent->>User: onAbort(event)
end
end
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/docs/v3/references/agent.mdx">
<violation number="1" location="packages/docs/v3/references/agent.mdx:250">
P2: Type documentation inconsistency: `onAbort` ParamField is missing `| Promise<void>` return type that's present in the interface definition above. This could mislead users into thinking they cannot use async handlers.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| <ParamField path="onError" type="StreamTextOnErrorCallback" optional> | ||
| Called when an error occurs during streaming. | ||
| </ParamField> | ||
| <ParamField path="onAbort" type="(event: { steps: StepResult[] }) => void" optional> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Type documentation inconsistency: onAbort ParamField is missing | Promise<void> return type that's present in the interface definition above. This could mislead users into thinking they cannot use async handlers.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/docs/v3/references/agent.mdx, line 250:
<comment>Type documentation inconsistency: `onAbort` ParamField is missing `| Promise<void>` return type that's present in the interface definition above. This could mislead users into thinking they cannot use async handlers.</comment>
<file context>
@@ -157,9 +205,60 @@ interface AgentExecuteOptions {
+ <ParamField path="onError" type="StreamTextOnErrorCallback" optional>
+ Called when an error occurs during streaming.
+ </ParamField>
+ <ParamField path="onAbort" type="(event: { steps: StepResult[] }) => void" optional>
+ Called when the stream is aborted via the `signal` option.
+ </ParamField>
</file context>
| <ParamField path="onAbort" type="(event: { steps: StepResult[] }) => void" optional> | |
| <ParamField path="onAbort" type="(event: { steps: StepResult[] }) => void | Promise<void>" optional> |
✅ Addressed in 3b58bf9
why
update agent docs to reflect new features
what changed
Summary by cubic
Updated Agent docs to cover new experimental capabilities—streaming, callbacks, abort signals, and message continuation—and clarified what’s supported for Computer Use Agents vs non-CUA. This helps build real-time UIs, control execution, and maintain conversation state.
New Features
stream: true),textStream/fullStream, andAgentStreamResult.AbortSignalusage, timeout patterns, and streaming abort behavior.messagesinexecuteoptions.AgentConfig.stream,messages,signal,callbacks, response fields (e.g.,messages,timestamp), and new error types.Migration
experimental: trueto use these features; they are not supported with CUA.stream: truefor streaming and streaming callbacks; using streaming-only callbacks without streaming will throw.messagesto continue conversations; useAbortController.signalto cancel runs.Written for commit 3b58bf9. Summary will update automatically on new commits.