Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/gastown/container/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ process.on('unhandledRejection', (reason, promise) => {
townId: TOWN_ID,
uptimeMs: getUptime(),
activeAgents: activeAgentCount(),
promise: String(promise),
event: 'unhandled_rejection',
});
});

Expand Down
9 changes: 2 additions & 7 deletions services/gastown/src/dos/Town.do.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ import { agent_metadata } from '../db/tables/agent-metadata.table';
import { escalation_metadata } from '../db/tables/escalation-metadata.table';
import { convoy_metadata } from '../db/tables/convoy-metadata.table';
import { bead_dependencies } from '../db/tables/bead-dependencies.table';
import {
town_events,
TownEventRecord,
type TownEventType,
} from '../db/tables/town-events.table';
import { town_events, TownEventRecord, type TownEventType } from '../db/tables/town-events.table';
import {
agent_nudges,
AgentNudgeRecord,
Expand Down Expand Up @@ -3905,8 +3901,7 @@ export class TownDO extends DurableObject<Env> {
// succeed on retry — mark them processed so the drain loop
// stops re-running them every alarm tick.
const isMissingEntity =
err instanceof Error &&
/\b(Bead|Agent) [0-9a-f-]{36} not found\b/.test(err.message);
err instanceof Error && /\b(Bead|Agent) [0-9a-f-]{36} not found\b/.test(err.message);
if (isMissingEntity) {
logger.warn('reconciler: applyEvent skipped (missing entity)', {
eventId: event.event_id,
Expand Down
6 changes: 3 additions & 3 deletions services/gastown/test/integration/event-cleanup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ describe('town_events cleanup on bead deletion (#fix-1)', () => {
bead_id: string | null;
agent_id: string | null;
}>;
expect(
pendingAfter.some(e => e.bead_id === bead.bead_id || e.agent_id === bead.bead_id)
).toBe(false);
expect(pendingAfter.some(e => e.bead_id === bead.bead_id || e.agent_id === bead.bead_id)).toBe(
false
);
});

it('deleteBead also removes events referencing the bead as agent_id (agents are beads)', async () => {
Expand Down