daniel
0a0e26ccd2
Enable extended thinking: budget_tokens=2000
2026-05-07 23:18:48 -05:00
daniel
b919a13c76
Fix enrolled_services key mapping in agent-runner payload
2026-05-07 19:29:50 -05:00
daniel
ce95cf4c12
Remove send_message @tool def: was causing session-history duplicates
2026-05-07 19:26:23 -05:00
daniel
08ad66a732
Log Telegram API response message_id to find duplicate source
2026-05-07 19:22:40 -05:00
daniel
fa74ea784f
Remove mid-stream flush on newlines: prevents split multi-turn responses
2026-05-07 19:13:02 -05:00
daniel
fd479b8c00
Suppress exceptions in generator to prevent AgentCore retry duplicates
2026-05-07 19:09:46 -05:00
daniel
60573c360f
Switch to sync entrypoint + callback delivery: eliminates AgentCore retry duplicates
2026-05-07 19:07:30 -05:00
daniel
bbd9a99645
Fix duplicate: remove event.data fallback, only use contentBlockDelta.delta.text
2026-05-07 19:01:36 -05:00
daniel
d44fd788f9
Fix broken send_telegram_direct: restore missing data= line
2026-05-07 18:47:16 -05:00
daniel
e35599b522
Add stack trace logging to track duplicate send source
2026-05-07 18:43:56 -05:00
daniel
b0b641b4c8
Add in-process dedup to prevent AgentCore retry duplicates
2026-05-07 18:38:55 -05:00
daniel
6098f4766a
Fix Bedrock read timeout causing retry → duplicate messages
2026-05-07 18:31:44 -05:00
daniel
83b937c20e
Remove fallback adapter.send() — streaming consumer handles delivery
2026-05-07 18:17:48 -05:00
daniel
89d0819189
Add logging to streaming path in agent-runner
2026-05-07 18:12:31 -05:00
daniel
ae5e0df884
Remove send_message tool: let harness stream text deltas to Telegram
2026-05-07 17:03:34 -05:00
daniel
04c0aeeb8a
test-bot: capture send_message tool calls in output
2026-05-07 16:53:15 -05:00
daniel
d773985191
Restore send_message in base_tools (tool-based delivery works, streaming is fallback)
2026-05-07 16:52:12 -05:00
daniel
7b7ad578c0
Guard isinstance(event, dict) in SSE parser
2026-05-07 16:47:24 -05:00
daniel
beb8dfc969
Fix SSE parsing: read data: prefix + contentBlockDelta.delta.text
2026-05-07 16:45:58 -05:00
daniel
cc3b448291
Fix agent-runner: 600s read timeout on bedrock-agentcore streaming
2026-05-07 16:42:49 -05:00
daniel
6adec991da
Wire streaming: agent-runner processes chunks, remove send_message tool
2026-05-07 16:32:02 -05:00
daniel
40a942b506
streaming: switch to stream_async + iter_chunks response drain
2026-05-07 16:27:26 -05:00
daniel
7f7f555983
Fix send_message docstring: remove unicode dashes that broke tool spec
2026-05-07 15:15:41 -05:00
daniel
b69fdd479a
Prompt send_message to fire incrementally instead of buffering
2026-05-07 14:54:21 -05:00
daniel
0951d2be31
Fix workspace bucket fallback + typing error logging
2026-05-07 09:35:09 -05:00
daniel
116d79ead5
Add WORKSPACE_BUCKET_NAME, TELEGRAM_BOT_TOKEN_SECRET_ARN, BRAVE_API_KEY_SECRET_ARN to agentcore env
2026-05-07 09:27:28 -05:00
daniel
92c87222e8
multi-tenant phase 3: per-user Home Assistant + enrolled services
...
- tools/home_assistant.py: remove hardcoded URL/token; read from per-user
config injected via set_ha_config() at invocation time; return helpful
enrollment prompt when HA not configured
- main.py: inject HA config from user_profile.services at startup; add
manage_service tool (enroll/remove/list) that persists to DynamoDB;
show enrolled services in user context; add USERS_TABLE_NAME env var
- agent-runner/handler.py: pass services dict from DDB user record in
user_profile payload; initialize services={} for new users
- cdk/lib/agent-claw-stack.ts: grant usersTable read/write to runtime1Role
so manage_service tool can update user records
- agentclaw/agentcore/agentcore.json: add USERS_TABLE_NAME env var
2026-05-07 09:10:39 -05:00
daniel
4f551ce069
Fix kiro mcp.json: remove invalid factbase server ref
2026-05-07 09:01:43 -05:00
daniel
c54e9b1b22
Add kiro config (.kiro steering + settings)
2026-05-07 03:33:02 -05:00
daniel
b1056beaa9
Phase 2: wire X-Actor-Id credential loading into workspace-mcp handler.py
...
Replace cold-start single-user credential loading with per-request
multi-tenant loading via ASGI middleware:
- _setup_shared_environment(): loads OAuth client creds once at cold start
- _ActorCredentialsMiddleware: reads x-actor-id header per request,
fetches per-user Google credentials from Secrets Manager
(agent-claw/google-credentials/{actor_id}), writes to /tmp,
sets USER_GOOGLE_EMAIL env var
- 5-minute in-memory cache to avoid redundant Secrets Manager calls
2026-05-06 21:48:05 -05:00
daniel
ac5bd78d5a
multi-tenant Phase 2: per-user Google OAuth
...
- workspace-mcp: add proxy.py (port 8080) that reads X-Actor-Id header,
fetches per-user Google credentials from Secrets Manager, writes creds
file, sets USER_GOOGLE_EMAIL, proxies to workspace-mcp on port 8081
- workspace-mcp: update bootstrap to start workspace-mcp on 8081 + proxy on 8080
- workspace-mcp: update Dockerfile to include proxy.py
- oauth-handler Lambda: new Lambda with /oauth/start + /oauth/callback
routes; exchanges Google auth code, stores tokens in Secrets Manager
at agent-claw/google-credentials/{actor_id_safe}, updates DynamoDB
- CDK: add OAuthHandler Lambda + GET /oauth/start + /oauth/callback routes
- CDK: remove shared google-workspace-credentials secret; add per-user
secret IAM grants (agent-claw/google-credentials/*) for workspace-mcp
role, runtime1 role, and oauth-handler role
- CDK: output OAuthStartUrl + OAuthRedirectUri
- agent-runner: pass google_email in user_profile payload
- main.py: pass actor_id as X-Actor-Id header in workspace-mcp MCP calls;
skip workspace-mcp if user has no google_email; add connect_google_account
tool that generates OAuth URL for the current user
- main.py: include google_email in user_context for system prompt
- agentcore.json: add OAUTH_START_URL env var for agent runtime
2026-05-06 21:42:33 -05:00
daniel
841e729b18
Phase 1 cleanup: onboarding flow, per-user S3 MEMORY.md, seed script
2026-05-06 21:11:07 -05:00
daniel
893c110729
multi-tenant Phase 1: user registry + per-user memory
...
- CDK: add agent-claw-users DynamoDB table (actor_id PK, RETAIN policy)
- CDK: grant agent-runner read/write on users table; add USERS_TABLE_NAME env
- CDK: fix cdk.json app field (was object, must be command string)
- CDK: add UsersTableName output
- agent-runner: get_or_create_user() auto-registers users on first contact
(stores display_name, telegram_username, created_at, allowed)
- agent-runner: pass user_profile in AgentCore payload
- prompt_builder: split base prompt (cached) from per-user context (injected per-call)
removes USER.md/MEMORY.md from shared load; user name/username injected dynamically
- main.py: extract user_profile from payload, build user_context string for prompt
2026-05-06 20:36:22 -05:00
daniel
732b00fb66
agent-claw: automated task changes
2026-05-06 18:55:16 -05:00
daniel
38905bb1e9
Phase 0: CDK stack + Lambdas + AgentCore Runtime 1 scaffold
...
- CDK TypeScript stack (AgentClawStack):
- S3 workspace bucket with BucketDeployment seed
- DynamoDB session-store (actor_id → session_id, TTL)
- SQS FIFO message queue (serialized per actor)
- Lambda: tg-ingest (webhook validation, typing action, SQS enqueue)
- Lambda: agent-runner (SQS → InvokeAgentRuntime, session management)
- API Gateway HTTP: POST /telegram → tg-ingest
- AgentCore Runtime 1 IAM execution role
- CDK outputs: WebhookUrl, WorkspaceBucketName, Runtime1RoleArn
- Runtime 1 (Python + Strands + BedrockAgentCoreApp):
- main.py: entrypoint, Strands agent, tool wiring
- channels/: ChannelAdapter Protocol + TelegramAdapter (decoupled)
- tools/: web_search (Brave), web_fetch, read/write_workspace_file, send_message
- prompt_builder.py: loads SOUL.md/AGENTS.md/USER.md from S3 (cached)
- Lambdas:
- tg-ingest: validate X-Telegram-Bot-Api-Secret-Token, send typing, enqueue FIFO
- agent-runner: session lookup/create in DDB, bundle batched messages, InvokeAgentRuntime
- workspace/: seed files (SOUL.md, AGENTS.md, USER.md, IDENTITY.md, HEARTBEAT.md)
NOTE: AgentCore Runtime 1 creation via CfnResource deferred — deploy CDK first,
create runtime manually with the output Role ARN, then redeploy with runtime1Arn context param.
2026-05-04 09:00:23 -05:00
daniel
6ee2890831
Add final architecture design doc
2026-05-04 08:43:08 -05:00
daniel
0369a74ac1
Initial research: OpenClaw on AgentCore architecture
...
- Architecture comparison (OpenClaw daemon vs AgentCore serverless)
- Component compatibility analysis
- Fargate analysis
- AgentCore rebuild plan (Telegram, zero always-on compute)
- Memory strategy: AgentCore Memory + factbase as structured KB
- Serverless relay patterns per channel
- All open questions resolved
- OpenClaw feature delta March→May 2026
- Build phases and cost estimates
2026-05-04 08:28:52 -05:00
4afa16a9cd
Initial commit
2026-05-04 13:27:43 +00:00