-
Notifications
You must be signed in to change notification settings - Fork 580
Open
Description
Overview
AgentKit allows agents to perform complex, multi-step onchain actions, but there is currently no standardized way to identify, track, or correlate individual actions across logs, retries, and execution steps. This makes debugging, observability, and analytics harder in real-world deployments.
Problem Description
When an agent performs multiple actions (e.g., read → simulate → send transaction → wait for confirmation), developers often need to:
- correlate logs belonging to the same logical action
- track retries and partial failures
- emit analytics or telemetry events tied to a single action
- debug long-running or asynchronous agent behavior
Without deterministic action identifiers and lifecycle hooks, each integration tends to implement its own ad-hoc tracking.
Expected Behavior
- Each agent action should have a deterministic, unique action ID.
- Developers should be able to subscribe to action lifecycle events (start, retry, success, failure).
- Lifecycle events should include structured context and error metadata.
Steps to Reproduce
- Run an agent that executes multiple onchain actions in sequence.
- Introduce a transient failure causing retries.
- Attempt to correlate logs for a single action across retries.
- Observe that there is no built-in action identifier or lifecycle hook.
Example code
```ts
import { AgentKit } from "@coinbase/agentkit";
const agent = new AgentKit({
// config...
});
agent.onAction((event) => {
console.log(event.actionId, event.type, event.metadata);
});
await agent.evm.sendTransaction({
network: "base",
to: "0x...",
value: "0",
});
Proposed Solution
- Generate a deterministic actionId for each high-level agent action.
- Emit lifecycle events:
- action:start
- action:retry
- action:success
- action:failure
- Include structured metadata:
- provider type (RPC/CDP)
- retry count
- error classification
- timestamps
- Expose a simple subscription API for consumers.
Metadata
Metadata
Assignees
Labels
No labels