PostHog / PostHog/wizard

Centralize model ID configuration

Open Beginner friendly
#530 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
197
Forks
51
Avg merge
1d 23h
Merged PRs (30d)
94

Description

Why

Model IDs are currently hardcoded in three independent places, with no shared symbol or single source of truth:

File Line Model
`src/lib/agent/agent-interface.ts` 755-758 `claude-opus-4-6` / `claude-sonnet-4-6` (selected by integrationLabel)
`src/lib/agent/mcp-prompt-streaming.ts` 34 `claude-sonnet-4-6`
`src/lib/agent/triage-provider.ts` 21 `claude-haiku-4-5-20251001`

Failure mode

When the LLM gateway adds, renames, or removes a model, all three sites need updating by people who may not know the others exist. This is especially risky for the triage path — a silent 404 there triggers the fail-closed path, which over-blocks user runs.

The format also drifts: triage uses the fully-dated SKU (`claude-haiku-4-5-20251001`); the others use bare IDs (`claude-sonnet-4-6`). No convention is enforced.

Proposal

Add `src/lib/agent/models.ts` (or similar leaf module) that exports named constants:

```ts
export const AGENT_DEFAULT_MODEL = 'claude-sonnet-4-6';
export const AGENT_PREMIUM_MODEL = 'claude-opus-4-6';
export const MCP_STREAMING_MODEL = 'claude-sonnet-4-6';
export const TRIAGE_MODEL = 'claude-haiku-4-5-20251001';
```

Update all three call sites to import from here. Future model decisions land in one file.

Out of scope

  • Gateway capability detection (whether a model is routed)
  • Per-program model overrides

🤖 Generated with Claude Code

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the three listed call sites: src/lib/agent/agent-interface.ts, src/lib/agent/mcp-prompt-streaming.ts, and src/lib/agent/triage-provider.ts. Add the named model constants in src/lib/agent/models.ts or a similar leaf module, update each call site to import them, and run the project’s existing checks to confirm behavior is unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, backend
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.