Skip to content

Commit

Permalink
fix: priority multiplier does not apply to specification anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Feb 17, 2025
1 parent bf23ebc commit a1103e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dist/** linguist-generated
bun.lockb linguist-generated
bun.lockb linguist-generated
16 changes: 10 additions & 6 deletions src/parser/content-evaluator-module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { TypeBoxError } from "@sinclair/typebox";
import { Value } from "@sinclair/typebox/value";
import { postComment } from "@ubiquity-os/plugin-sdk";
import Decimal from "decimal.js";
import { encodingForModel } from "js-tiktoken";
import ms, { StringValue } from "ms";
import OpenAI from "openai";
import { commentEnum, CommentKind, CommentType } from "../configuration/comment-types";
import { CommentAssociation, commentEnum, CommentKind, CommentType } from "../configuration/comment-types";
import { ContentEvaluatorConfiguration } from "../configuration/content-evaluator-config";
import { retry } from "../helpers/retry";
import { IssueActivity } from "../issue-activity";
import {
AllComments,
Expand All @@ -15,10 +19,6 @@ import {
import { BaseModule } from "../types/module";
import { ContextPlugin } from "../types/plugin-input";
import { GithubCommentScore, Result } from "../types/results";
import { postComment } from "@ubiquity-os/plugin-sdk";
import { retry } from "../helpers/retry";
import ms, { StringValue } from "ms";
import { TypeBoxError } from "@sinclair/typebox";

/**
* Evaluates and rates comments.
Expand Down Expand Up @@ -139,7 +139,11 @@ export class ContentEvaluatorModule extends BaseModule {
}

const currentReward = new Decimal(currentComment.score?.reward ?? 0);
const priority = currentComment.score?.priority ?? 1;
const priority =
// We do not apply priority multiplier on issue specification
currentComment.score?.priority && !(currentComment.type & CommentAssociation.SPECIFICATION)
? currentComment.score.priority
: 1;

currentComment.score = {
...(currentComment.score || { multiplier: 0 }),
Expand Down

0 comments on commit a1103e5

Please sign in to comment.