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
@@ -67,7 +67,8 @@ onMounted(async () => {
|
||||
api.get<ProviderListResponse>('/provider-configs'),
|
||||
api.get<SandboxListResponse>('/sandbox-targets'),
|
||||
])
|
||||
providers.value = providerList.providers
|
||||
const known = new Set(providerList.kinds)
|
||||
providers.value = providerList.providers.filter((provider) => known.has(provider.kind))
|
||||
targets.value = targetList.targets
|
||||
providerId.value = providers.value[0]?.id ?? ''
|
||||
targetId.value = targets.value[0]?.id ?? ''
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -37,8 +37,8 @@ const KIND_LABELS: Record<string, string> = {
|
||||
}
|
||||
|
||||
const providers = ref<ProviderConfig[]>([])
|
||||
const kinds = ref<string[]>(['anthropic', 'openai', 'openrouter', 'google', 'deepseek', 'zai', 'mistral', 'mistral-vibe', 'copilot', 'chatgpt', 'opencode', 'llama-cpp'])
|
||||
const flowKinds = ref<string[]>(['copilot', 'chatgpt', 'mistral-vibe'])
|
||||
const kinds = ref<string[]>(['anthropic', 'openai', 'openrouter', 'google', 'deepseek', 'zai', 'mistral', 'mistral-vibe', 'copilot', 'opencode', 'llama-cpp'])
|
||||
const flowKinds = ref<string[]>(['copilot', 'mistral-vibe'])
|
||||
const targets = ref<SandboxTarget[]>([])
|
||||
const loading = ref(true)
|
||||
const loadError = ref('')
|
||||
@@ -88,8 +88,6 @@ const flowInstruction = computed(() => {
|
||||
return 'Enter the code on GitHub to authorize Rhema.'
|
||||
case 'mistral-vibe':
|
||||
return 'Sign in with your Mistral account to authorize Rhema for your Vibe plan.'
|
||||
case 'chatgpt':
|
||||
return sentence(instruction.text)
|
||||
default:
|
||||
return sentence(instruction.text)
|
||||
}
|
||||
@@ -450,7 +448,7 @@ async function copyKey(target: SandboxTarget) {
|
||||
<div class="settings-row-main">
|
||||
<div class="settings-row-title">{{ provider.name }}</div>
|
||||
<div class="settings-row-detail">
|
||||
{{ kindLabel(provider.kind) }}<template v-if="provider.api">, {{ provider.api }} API</template><template v-if="provider.base_url">, {{ provider.base_url }}</template>
|
||||
{{ kindLabel(provider.kind) }}<template v-if="!kinds.includes(provider.kind)"> (no longer available)</template><template v-if="provider.api">, {{ provider.api }} API</template><template v-if="provider.base_url">, {{ provider.base_url }}</template>
|
||||
</div>
|
||||
</div>
|
||||
<div class="settings-row-actions">
|
||||
|
||||
Reference in new issue
Block a user