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
1 change: 1 addition & 0 deletions .github/scripts/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const schema = z.object({
confidence: z.number().min(0).max(1).optional(),
model: z.string().optional(),
prompt: z.string().optional(),
users: z.array(z.string()).optional(),
});

const configpath = '.github/tigent.yml';
Expand Down
8 changes: 8 additions & 0 deletions .github/tigent.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
confidence: 0.6

users:
- gr2m
- dancer
- aayush-kapoor
- lgrammel
- nicoalbanese
- felixarntz

prompt: |
this bot labels issues and prs for the vercel ai sdk monorepo. the ai sdk provides a unified api for working with large language models across providers.

Expand Down
7 changes: 3 additions & 4 deletions app/api/webhook/feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import type { Gh, Config } from './triage';
import { classify, fetchlabels, addlabels } from './triage';
import { createpr } from './learn';

const allowed = ['OWNER', 'MEMBER', 'COLLABORATOR'];

export async function handlecomment(gh: Gh, config: Config, payload: any) {
const comment = payload.comment;
const body: string = comment.body?.trim() || '';
const association: string = comment.author_association || '';
const username: string = comment.user?.login || '';

if (!allowed.includes(association)) return;
if (!config.users.some(u => u.toLowerCase() === username.toLowerCase()))
return;
if (!body.toLowerCase().startsWith('@tigent')) return;

const command = body.slice(7).trim().toLowerCase();
Expand Down
2 changes: 2 additions & 0 deletions app/api/webhook/triage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface Config {
confidence: number;
model: string;
prompt: string;
users: string[];
}

export interface Label {
Expand All @@ -24,6 +25,7 @@ export const defaultconfig: Config = {
confidence: 0.6,
model: 'openai/gpt-5-nano',
prompt: '',
users: [],
};

export async function getconfig(gh: Gh): Promise<Config> {
Expand Down
29 changes: 27 additions & 2 deletions app/docs/config/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,39 @@ export default function Config() {
</div>
</Section>

<Section id="users" title="Users">
<div className="space-y-8 max-w-2xl">
<div>
<h3
id="users-option"
className="text-lg font-semibold mb-2 text-white"
>
users
</h3>
<p className="text-white/60 mb-4">
List of GitHub usernames allowed to use feedback commands (@tigent
why, @tigent wrong). Only users in this list can interact with
Tigent. If no users are configured, feedback commands are
disabled.
</p>
<Code className="max-w-2xl">{`users:
- gr2m
- aayuush-kapoor
- dancer`}</Code>
</div>
</div>
</Section>

<Section id="example" title="Full example">
<p className="text-white/60 mb-6 max-w-2xl">A complete config file:</p>
<Code className="max-w-2xl">{`confidence: 0.7

users:
- gr2m
- aayuush-kapoor

prompt: |
crashes and errors are always bug.
if the issue describes data loss or a crash, assign p0.
minor bugs get p1.
feature requests get feature, not enhancement.`}</Code>
</Section>

Expand Down
5 changes: 3 additions & 2 deletions app/docs/feedback/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ prompt: |

<Section id="permissions" title="Permissions">
<p className="text-white/60 max-w-2xl">
Only users with OWNER, MEMBER, or COLLABORATOR association can use
feedback commands. Comments from other users are ignored.
Only users listed in the users config can use feedback commands.
Comments from other users are ignored. If no users are configured,
feedback commands are disabled.
</p>
</Section>

Expand Down