feat(api): retire ChatGPT plan sign-in by default
ci / checks (push) Successful in 57s
ci / test (push) Successful in 1m0s
ci / chart (push) Successful in 4s
ci / web (push) Successful in 21s
ci / docker (push) Successful in 1m48s
ci / publish-edge-image (push) Successful in 12s
ci / publish-edge-chart (push) Successful in 4s
ci / checks (push) Successful in 57s
ci / test (push) Successful in 1m0s
ci / chart (push) Successful in 4s
ci / web (push) Successful in 21s
ci / docker (push) Successful in 1m48s
ci / publish-edge-image (push) Successful in 12s
ci / publish-edge-chart (push) Successful in 4s
A room's provider serves every member, while a ChatGPT plan belongs to one account, so sharing it breaks OpenAI's terms. Together now hides the chatgpt kind, refuses to store a new one, and fails a room that still points at it with a message that names the API-key route. Existing provider rows stay in the database. The room settings dialog keeps the room's current provider visible even when its kind is retired, so the room shows what it is pinned to instead of silently losing it. Creating or updating a room to that provider is refused. `RHEMA_TOGETHER_I_WANT_CHATGPT_BAN=1` lifts the block for a single-user local test. The value has to be exactly `1`; any other value leaves the block in place.
This commit is contained in:
1 parent
62fa380ec0
commit
64d7f359f5
8 files changed
+157
-34
No files matched your search
@@ -19,6 +19,7 @@ const emit = defineEmits<{ close: []; updated: [room: Room]; archived: [] }>()
|
||||
const api = useApi()
|
||||
|
||||
const providers = ref<ProviderConfig[]>([])
|
||||
const providerKinds = ref<string[]>([])
|
||||
const loadingProviders = ref(true)
|
||||
const providersError = ref('')
|
||||
|
||||
@@ -47,7 +48,13 @@ const canSave = computed(
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const list = await api.get<ProviderListResponse>('/provider-configs')
|
||||
providers.value = list.providers
|
||||
// Keep the room's current provider even when the server no longer
|
||||
// offers its kind, so the select shows what the room is pinned to.
|
||||
const known = new Set(list.kinds)
|
||||
providerKinds.value = list.kinds
|
||||
providers.value = list.providers.filter(
|
||||
(provider) => known.has(provider.kind) || provider.id === providerId.value,
|
||||
)
|
||||
} catch (err) {
|
||||
providersError.value = apiErrorMessage(err)
|
||||
} finally {
|
||||
@@ -74,7 +81,9 @@ async function save() {
|
||||
thinking_effort: thinkingEffort.value,
|
||||
max_turn_steps: Math.min(500, Math.max(1, Math.round(Number(maxSteps.value) || 1))),
|
||||
}
|
||||
if (providerId.value) body.provider_config_id = providerId.value
|
||||
if (providerId.value && providerId.value !== props.room.provider_config_id) {
|
||||
body.provider_config_id = providerId.value
|
||||
}
|
||||
body.model = model.value.trim()
|
||||
try {
|
||||
const response = await api.patch<UpdateRoomResponse>(`/rooms/${props.room.id}`, body)
|
||||
@@ -130,6 +139,9 @@ async function archive() {
|
||||
<span v-else-if="providers.length === 0" class="hint">
|
||||
No providers yet. <NuxtLink to="/settings">Add one in settings</NuxtLink>.
|
||||
</span>
|
||||
<span v-else-if="selectedProvider && !providerKinds.includes(selectedProvider.kind)" class="hint">
|
||||
This provider is no longer available. Pick another before the room can run a turn.
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
|
||||
Reference in new issue
Block a user