Skip to content

Commit 37a14b8

Browse files
NathanFlurryclaude
andcommitted
refactor: clean up logging style and reduce verbosity
Improved the logging across multiple files: - Made all log messages use consistent lowercase style - Removed extraneous '===' prefixes from log messages - Reduced verbose logging of full request/response data - Kept important debug information while reducing noise 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent bf929a5 commit 37a14b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2683
-1623
lines changed

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ This ensures imports resolve correctly across different build environments and p
8585
- Extend from `ActorError` base class
8686
- Use `UserError` for client-safe errors
8787
- Use `InternalError` for internal errors
88+
- Don't try to fix type issues by casting to unknown or any. If you need to do this, then stop and ask me to manually intervene.
89+
- Write log messages in lowercase
90+
- Instead of returning raw HTTP responses with c.json, use or write an error in packages/actor-core/src/actor/errors.ts and throw that instead. The middleware will automatically serialize the response for you.
8891

8992
## Project Structure
9093

examples/chat-room/scripts/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function main() {
1010

1111
// connect to chat room - now accessed via property
1212
// can still pass parameters like room
13-
const chatRoom = await client.chatRoom.connect(room, {
13+
const chatRoom = client.chatRoom.connect(room, {
1414
params: { room },
1515
});
1616

examples/chat-room/scripts/connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async function main() {
77
const client = createClient<App>(process.env.ENDPOINT ?? "http://localhost:6420");
88

99
// connect to chat room - now accessed via property
10-
const chatRoom = await client.chatRoom.connect();
10+
const chatRoom = client.chatRoom.connect();
1111

1212
// call action to get existing messages
1313
const messages = await chatRoom.getHistory();

examples/chat-room/tests/chat-room.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test("chat room should handle messages", async (test) => {
66
const { client } = await setupTest(test, app);
77

88
// Connect to chat room
9-
const chatRoom = await client.chatRoom.connect();
9+
const chatRoom = client.chatRoom.connect();
1010

1111
// Initial history should be empty
1212
const initialMessages = await chatRoom.getHistory();

examples/counter/scripts/connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { App } from "../actors/app";
55
async function main() {
66
const client = createClient<App>(process.env.ENDPOINT ?? "http://localhost:6420");
77

8-
const counter = await client.counter.connect()
8+
const counter = client.counter.connect()
99

1010
counter.on("newCount", (count: number) => console.log("Event:", count));
1111

examples/counter/tests/counter.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { app } from "../actors/app";
44

55
test("it should count", async (test) => {
66
const { client } = await setupTest(test, app);
7-
const counter = await client.counter.connect();
7+
const counter = client.counter.connect();
88

99
// Test initial count
1010
expect(await counter.getCount()).toBe(0);

examples/linear-coding-agent/src/server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ server.post('/api/webhook/linear', async (c) => {
7575
// Create or get a coding agent instance with the issue ID as a key
7676
// This ensures each issue gets its own actor instance
7777
console.log(`[SERVER] Getting actor for issue: ${issueId}`);
78-
const actorClient = await client.codingAgent.connect(issueId);
78+
const actorClient = client.codingAgent.connect(issueId);
7979

8080
// Initialize the agent if needed
8181
console.log(`[SERVER] Initializing actor for issue: ${issueId}`);

examples/resend-streaks/tests/user.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ beforeEach(() => {
2626

2727
test("streak tracking with time zone signups", async (t) => {
2828
const { client } = await setupTest(t, app);
29-
const actor = await client.user.connect();
29+
const actor = client.user.connect();
3030

3131
// Sign up with specific time zone
3232
const signupResult = await actor.completeSignUp(

packages/actor-core-cli/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"bundle-require": "^5.1.0",
3939
"chokidar": "^4.0.3",
4040
"esbuild": "^0.25.1",
41+
"invariant": "^2.2.4",
4142
"open": "^10.1.0",
4243
"yoga-wasm-web": "0.3.3"
4344
},
@@ -46,6 +47,7 @@
4647
"@rivet-gg/api": "^24.6.2",
4748
"@sentry/esbuild-plugin": "^3.2.0",
4849
"@sentry/node": "^9.3.0",
50+
"@types/invariant": "^2",
4951
"@types/micromatch": "^4",
5052
"@types/react": "^18.3",
5153
"@types/semver": "^7.5.8",

packages/actor-core-cli/src/cli.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PACKAGE_JSON } from "./macros" with { type: "macro" };
2-
import { create, deploy, dev, program } from "./mod";
2+
import { create, deploy, dev, endpoint, program } from "./mod";
33

44
export default program
55
.name(PACKAGE_JSON.name)
@@ -8,4 +8,5 @@ export default program
88
.addCommand(deploy)
99
.addCommand(create)
1010
.addCommand(dev)
11+
.addCommand(endpoint)
1112
.parse();

0 commit comments

Comments
 (0)