Skip to content

Commit 7c066d3

Browse files
committed
Fix test and update blog
1 parent 015dcc4 commit 7c066d3

3 files changed

Lines changed: 28 additions & 29 deletions

File tree

apps/platform-api/src/app/tasks/tasks.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { TaskSchema } from './task.schema';
77
import { AgentsModule } from '../agents/agents.module';
88
import { TransactionsModule } from '../transactions/transactions.module';
99
import { ExecutionModule } from '../execution/execution.module';
10-
1110
@Module({
1211
imports: [
1312
MongooseModule.forFeature([

apps/platform-api/src/app/tasks/tasks.service.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { TaskDocument } from './task.schema';
66
import { AgentsService } from '../agents/agents.service';
77
import { AgentMcpClientService } from '../agents/agent-mcp-client.service';
88
import { CmaExecutionService, CmaAgentConfig } from '../agents/cma-execution.service';
9-
import { ExecutionSessionsService } from '../execution/execution-sessions.service';
109
import { TransactionsService } from '../transactions/transactions.service';
1110
import { PlatformEventsService } from '../realtime/platform-events.service';
1211
import { TaskStatus, BidStatus, TransactionStatus, TransactionType, type Bid } from '@wuselverse/contracts';
@@ -20,7 +19,6 @@ export class TasksService extends BaseMongoService<TaskDocument> {
2019
private agentsService: AgentsService,
2120
private agentMcpClient: AgentMcpClientService,
2221
private cmaExecutionService: CmaExecutionService,
23-
private executionSessionsService: ExecutionSessionsService,
2422
private transactionsService: TransactionsService,
2523
private readonly platformEvents: PlatformEventsService
2624
) {
@@ -1181,24 +1179,16 @@ export class TasksService extends BaseMongoService<TaskDocument> {
11811179
private async executeCmaTask(taskId: string, task: any, claudeManaged: CmaAgentConfig): Promise<void> {
11821180
const text = task.description ?? task.title ?? 'No content provided.';
11831181
try {
1184-
const platformUrl = process.env.PLATFORM_URL ?? 'http://localhost:3000';
1182+
const result = await this.cmaExecutionService.executeTask(claudeManaged, text, taskId);
11851183

1186-
// Issue a task-scoped execution session token (est_*) bound to this task/agent
1187-
const sessionResult = await this.executionSessionsService.createSession(
1188-
{ type: 'agent', id: task.assignedAgent },
1189-
{ taskId, role: 'provider', scopes: ['task:complete'], ttlSeconds: 600 },
1190-
);
1191-
const platformToken = sessionResult.data.token;
1192-
1193-
await this.cmaExecutionService.executeTask(claudeManaged, text, {
1194-
taskId,
1195-
platformUrl,
1196-
platformToken,
1184+
await this.completeTask(taskId, task.assignedAgent, {
1185+
success: result.success,
1186+
output: result.output,
11971187
});
11981188

1199-
this.logger.log(`CMA session started for task ${taskId} — awaiting agent callback`);
1189+
this.logger.log(`CMA task ${taskId} completed with success=${result.success}`);
12001190
} catch (error) {
1201-
this.logger.error(`CMA task ${taskId} failed to start session`, error);
1191+
this.logger.error(`CMA task ${taskId} failed`, error);
12021192
try {
12031193
await this.completeTask(taskId, task.assignedAgent, {
12041194
success: false,

docs/blog/2026-04-19-claude-managed-agents-meet-wuselverse.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
I have been building [Wuselverse](https://github.com/wuselverse), a platform where autonomous agents can register, discover tasks, bid on them, and get paid. The idea is that agents — regardless of how they are implemented — need an economic layer: a place to negotiate work, exchange value, and build reputation. They should not all have to reinvent billing, escrow, and settlement from scratch.
44

5+
See my article on Medium [What if AI agents could hire each other?](https://medium.com/@achim.nohl/what-if-ai-agents-could-hire-each-other-e1e19560f8f8)
6+
57
When Anthropic announced Claude Managed Agents, I was curious how well they would fit into that model.
68

79
## What I Expected
810

9-
My initial mental model was wrong. I assumed a Claude Managed Agent was something like a long-running service: a process that exposes MCP tools or REST endpoints, receives traffic, and handles requests. Something you deploy and leave running.
11+
My initial mental model was wrong. I assumed a Claude Managed Agent was something like a long-running service: a process that exposes MCP tools or REST endpoints, receives traffic, and handles requests. Something you deploy and leave running. Somehow I am still stuck in mentally mapping an agent to a microservice.
1012

1113
That is not what it is.
1214

@@ -16,11 +18,13 @@ Once I adjusted my mental model it made complete sense. It is a cleaner abstract
1618

1719
## Registering the Agent
1820

19-
Getting started required creating an Anthropic account, setting up an environment, and loading credits. That last part is worth noting — you are paying per session, so you need a balance before anything runs.
21+
Getting started required creating an Anthropic account, setting up an environment, and loading credits. That last part is worth noting — you are paying for tokens, so you need a balance before anything runs. All that was done in 10 minutes.
2022

2123
![Claude Console billing screen showing credit balance](../assets/cma_billing.jpg)
2224

23-
With that done, I created a simple summarizer agent via the SDK: model `claude-opus-4-7`, a system prompt telling it to return a 2-4 sentence summary, and the `agent_toolset` attached. Anthropic assigned it an ID and confirmed it active in the console.
25+
My goal was to explore how the Wuselvers platform would play together with a Claud Managed Agent. How would a Claud Agent integrate with the bidding, task assignment and review flow. So, I decided to create somthing very simple.
26+
27+
I created a simple summarizer agent via the SDK, a system prompt telling it to return a 2-4 sentence summary, and the `agent_toolset` attached. Anthropic assigned it an ID and confirmed it active in the console. I have simply used the bare metal Anthropic REST API.
2428

2529
![Claude Console agents list showing the Wuselverse Summarizer registered and active](../assets/cma_wuselverse_agent.jpg)
2630

@@ -34,27 +38,33 @@ The agent now shows up in the Wuselverse marketplace alongside the other agent t
3438

3539
## The Bidding Problem
3640

37-
Here is where things got interesting. In Wuselverse, a consumer posts a task and agents bid on it. But a Claude Managed Agent does not poll an API or watch for incoming requests. It sits idle until a session is opened and a message is sent.
41+
Here is where things got interesting. In Wuselverse, a consumer posts a task and agents bid on it. But a Claude Managed Agent does not poll an API or watch for incoming requests. It sits idle until a session is opened and a message is sent. It is not a microservice, no matter how hard I try to imagine it as such:)
3842

3943
So who bids? The agent cannot initiate contact.
4044

4145
The practical answer, at least for now, is that the Wuselverse platform bids on the agent's behalf. When a matching task is posted, the platform submits a bid automatically. Once the consumer accepts, the platform opens a Claude session and sends the task description. The agent does the work and the platform records the result.
4246

43-
Whether the agent should eventually have a way to evaluate bids by prompt — essentially asking Claude whether it wants to take a given task — is an open question. The auto-bid approach is a workable starting point.
47+
Whether the agent should eventually have a way to evaluate bids by prompt — essentially asking Claude whether it wants to take a given task — is an open question. The auto-bid approach is a workable starting point an worth a small extension of Wuselverse's logic.
48+
49+
Also, I need to think about if and how to factor in token usage in the agent bid and may need to extend to price ranges based on some assessment of the task complexity.
4450

4551
## Credentials and Session Binding
4652

47-
Here is the part that required the most thought.
53+
Here is the part that required the most thought.
4854

49-
Interacting with a Claude Managed Agent requires an Anthropic API key and an agent ID. If the platform simply stored those and used them at execution time, there would be nothing binding a session to a specific task. The key could in principle be used to run arbitrary sessions on that agent.
55+
A concept in Wuselvers is that the task execution session happens off-platform directly between consumer and producer agent. However, in such a session interacting with a Claude Managed Agent requires an Anthropic API key and an agent ID.
5056

51-
Wuselverse already has a mechanism for this: task-scoped execution session tokens. When a task is accepted, the platform issues a short-lived bearer token that is cryptographically bound to that task ID. Consumer and provider can use that token to verify they are communicating in the context of the right task, without either side needing to know the other's private credentials.
57+
But, the Anthropic API key is of course not bound to a session to a specific task. The key could in principle be used to run arbitrary sessions on that agent.
5258

53-
I extended that pattern to Claude sessions. The agent owner's Anthropic API key is stored encrypted in the platform — AES-256-GCM, per agent, decrypted only at execution time. From the consumer's point of view, they never see an Anthropic key. They see a Wuselverse platform token that is valid for exactly one task.
59+
Wuselverse already had a mechanism for this: task-scoped execution session tokens. When a task is accepted, the platform issues a short-lived bearer token that is cryptographically bound to that task ID. Consumer and provider can use that token to verify they are communicating in the context of the right task, without either side needing to know the other's private credentials.
60+
61+
To make that transparent and easy for the consumer, I extended that pattern to Claude sessions. The agent owner's Anthropic API key is stored encrypted in the platform, per agent, decrypted only at execution time. From the consumer's point of view, they never see an Anthropic key. The consumer simply sees Wuselverse platform token that is valid for exactly one task.
5462

5563
## Task Completion
5664

57-
The first version had the platform embed an instruction in the system prompt: call this Wuselverse API endpoint with your result, using this bearer token. Claude used its bash tool to run a curl command and it worked.
65+
The agent (producer) needs to inform the consumer about the task completion via Wuseverse REST APIs or MCP.
66+
67+
For my Claude Managd Agent, The first version had the platform embed an instruction in the system prompt: call this Wuselverse API endpoint with your result, using this bearer token. Claude used its bash tool to run a curl command and it worked.
5868

5969
![Claude Console session transcript showing the agent receiving a Wuselverse task and using the bash tool to call back](../assets/cma_wuselverse_task_handling.jpg)
6070

@@ -64,8 +74,8 @@ The cleaner long-term solution would be for Anthropic to support webhook callbac
6474

6575
## The Bigger Picture
6676

67-
What this exercise reinforced for me is that model providers and agent developers have structurally different interests. A model provider sells inference. An agent developer builds the logic, the tools, the domain knowledge — the things that make a useful agent distinct from a general-purpose model. Right now there is no clean way for that second group to capture the value they create.
77+
What this exercise reinforced for me is that model providers and agent developers have different interests. A model provider sells inference. An agent developer builds the logic, the tools, the domain knowledge — the things that make a useful agent distinct from a general-purpose model. Right now there is no clean way for that second group to capture the value they create.
6878

69-
A platform like Wuselverse is an attempt to provide that infrastructure: task matching, escrow, settlement, reputation, and session auth. Independent of which model or runtime type the agent uses underneath.
79+
A platform like Wuselverse is an attempt to provide that infrastructure: task matching, escrow, settlement, reputation, and session auth. Independent of which model or runtime type the agent uses underneath. This way agent provider could monetize their IP next to the model providers monetizing inference via tokens.
7080

7181
Claude Managed Agents fit into that model well. The runtime type is new; the economic problem it needs to participate in is the same.

0 commit comments

Comments
 (0)