Skip to content

Commit b60b53a

Browse files
jmbish04claude
andcommitted
fix: address all Gemini code review comments
- LearningAgent: replace `BaseAgent` (deleted on main) with `DurableObject<Env>` which provides properly typed `this.env` access - LearningAgent: remove `__proto__.__proto__` brittle prototype chain access, use simple 404 fallback instead - LearningAgent: typed `LearningEnv` interface for AI and VECTORIZE_INDEX bindings (already applied in previous commit) - BaseAgent `super.fetch as Function` comments: N/A, file removed on main - JulesOverseer `__proto__.__proto__` comment: N/A, already uses `super.fetch()` on main's version Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a99c1b6 commit b60b53a

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/backend/src/ai/agents/LearningAgent.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @module AI/Agents/LearningAgent
1515
*/
1616

17-
import { BaseAgent } from "./base/BaseAgent";
17+
import { DurableObject } from "cloudflare:workers";
1818
import { getDb } from "@db";
1919
import {
2020
learningAiInsights,
@@ -84,10 +84,7 @@ const STANDARD_VIOLATION_PATTERNS: RegExp[] = [
8484
// LearningAgent
8585
// ---------------------------------------------------------------------------
8686

87-
export class LearningAgent extends BaseAgent {
88-
constructor(state: DurableObjectState, env: Env) {
89-
super(state, env);
90-
}
87+
export class LearningAgent extends DurableObject<Env> {
9188

9289
async fetch(request: Request): Promise<Response> {
9390
const url = new URL(request.url);
@@ -138,8 +135,7 @@ export class LearningAgent extends BaseAgent {
138135
});
139136
}
140137

141-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
142-
return (this as any).__proto__.__proto__.fetch?.call(this, request) ?? new Response('Not found', { status: 404 });
138+
return new Response('Not found', { status: 404 });
143139
}
144140

145141
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)