Codemod db pass-through calls: messages + runs + approvals + company (C1 part 2/3)

Rewrite ~376 call sites for messages, runs, approvalsMod, and company
domains and delete the corresponding pass-through methods on
AppDatabase / AppDatabaseBase. Structural type references
(ReturnType<HandlerDeps["db"]["getRun"]>) and SweepStaleReviewsDeps-style
mocks are updated to route through the owning sub-module.
This commit is contained in:
ZacharyZhang-NY committed 2026-04-20 13:20:15 -04:00
1 parent 5e9b7acbc6
commit a69fbb053b
86 files changed
+393 -454

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ export class CostWriter {
);
}
this.deps.db.recordCostEntry({
this.deps.db.runs.recordCostEntry({
runId: input.runId,
companyId: input.companyId,
agentId: input.agentId,
+1 -1
View File
@@ -134,7 +134,7 @@ function checkOperationalApprovalBlock(
toolName: string,
): BeforeToolCallRpcResult {
try {
const blocking = deps.db.getBlockingApproval(ctx.companyId, ctx.agentId, ctx.taskId);
const blocking = deps.db.approvalsMod.getBlockingApproval(ctx.companyId, ctx.agentId, ctx.taskId);
if (!blocking) return { block: false, reason: null };
if (!OPERATIONAL_APPROVAL_TYPES.has(blocking.type as ApprovalType)) {
return { block: false, reason: null };
+1 -1
View File
@@ -573,7 +573,7 @@ export class RuntimeBridge {
// `?unreadOnly=true`, so agents posted status comments instead of
// replies. The explicit read endpoint is the sole signal.
const store = this.getOrCreateStore(payload.taskSessionId);
const inboxRecords = this.deps.db.listAgentInboxUnread(payload.companyId, payload.agentId);
const inboxRecords = this.deps.db.messages.listAgentInboxUnread(payload.companyId, payload.agentId);
if (inboxRecords.length > 0) {
this.deps.db.withTransaction(() => {
for (const record of inboxRecords) {