Skip to content

Commit 3b387de

Browse files
committed
fix
1 parent 7a21cab commit 3b387de

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/content/changelog/agents/2025-03-18-npm-i-agents.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Future updates will be pushed to the new `agents` package, and the older package
4242
We've added a number of big new features to the Agents SDK over the past few weeks, including:
4343

4444
- TODO
45-
- TODO
45+
- TODO: you can now set `cors: true` when using `routeAgentRequest` to return permissive default CORS headers to Agent responses.
4646
- TODO: the regular client now syncs state on the agent (just like the react version)
4747
- TODO: useAgentChat bug fixes for passing headers/credentials, properly clearing cache on unmount, etc
4848
- TODO: experiemental /schedule module with a prompt/schema for adding scheduling to your app (with evals!)

src/content/docs/agents/api-reference/agents-api.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -751,24 +751,22 @@ interface TaskState {
751751

752752
function TaskManager() {
753753
const [newTask, setNewTask] = useState("");
754-
754+
755755
// Connect to a task-manager Agent instance
756756
const agent = useAgent<TaskState>({
757757
agent: "task-manager",
758758
name: "user-123-tasks",
759-
760759
onStateUpdate: (state, source) => {
761760
console.log(`State updated from ${source}`, state);
762761
},
763-
764762
onOpen: () => console.log("Connected to task manager agent"),
765763
onClose: () => console.log("Disconnected from task manager agent")
766764
});
767-
765+
768766
function addTask(e: React.FormEvent) {
769767
e.preventDefault();
770768
if (!newTask.trim()) return;
771-
769+
772770
// Update the Agent's state
773771
agent.setState({
774772
...agent.state,
@@ -777,12 +775,12 @@ function TaskManager() {
777775
{ id: Date.now().toString(), text: newTask, completed: false }
778776
]
779777
});
780-
778+
781779
setNewTask("");
782780
}
783-
781+
784782
return (
785-
<>
783+
<div>
786784
<h1>Task Manager</h1>
787785
<form onSubmit={addTask}>
788786
<input
@@ -797,7 +795,7 @@ function TaskManager() {
797795
<li key={task.id}>{task.text}</li>
798796
))}
799797
</ul>
800-
</>
798+
</div>
801799
);
802800
}
803801

0 commit comments

Comments
 (0)