@lobehub/chat 1.94.2 â 1.94.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/scripts/create-failure-issue.js +256 -0
- package/.github/workflows/auto-i18n.yml +359 -0
- package/CHANGELOG.md +42 -0
- package/changelog/v1.json +14 -0
- package/locales/ar/setting.json +13 -1
- package/locales/bg-BG/setting.json +13 -1
- package/locales/de-DE/setting.json +13 -1
- package/locales/en-US/setting.json +13 -1
- package/locales/es-ES/setting.json +13 -1
- package/locales/fa-IR/setting.json +13 -1
- package/locales/fr-FR/setting.json +13 -1
- package/locales/it-IT/setting.json +13 -1
- package/locales/ja-JP/setting.json +13 -1
- package/locales/ko-KR/setting.json +13 -1
- package/locales/nl-NL/setting.json +13 -1
- package/locales/pl-PL/setting.json +13 -1
- package/locales/pt-BR/setting.json +13 -1
- package/locales/ru-RU/setting.json +13 -1
- package/locales/tr-TR/setting.json +13 -1
- package/locales/vi-VN/setting.json +13 -1
- package/locales/zh-CN/setting.json +13 -1
- package/locales/zh-TW/setting.json +13 -1
- package/package.json +2 -2
- package/src/app/[variants]/(main)/settings/common/features/ChatAppearance/ChatTransitionPreview.tsx +111 -0
- package/src/app/[variants]/(main)/settings/common/features/ChatAppearance/index.tsx +50 -3
- package/src/components/Thinking/index.tsx +4 -2
- package/src/config/modelProviders/anthropic.ts +1 -6
- package/src/config/modelProviders/baichuan.ts +4 -8
- package/src/config/modelProviders/google.ts +4 -4
- package/src/config/modelProviders/lmstudio.ts +4 -4
- package/src/config/modelProviders/minimax.ts +3 -3
- package/src/config/modelProviders/moonshot.ts +4 -4
- package/src/config/modelProviders/openai.ts +1 -3
- package/src/config/modelProviders/perplexity.ts +3 -3
- package/src/config/modelProviders/qwen.ts +4 -4
- package/src/config/modelProviders/search1api.ts +4 -4
- package/src/config/modelProviders/spark.ts +4 -4
- package/src/config/modelProviders/stepfun.ts +4 -4
- package/src/config/modelProviders/vertexai.ts +1 -3
- package/src/config/modelProviders/volcengine.ts +4 -4
- package/src/config/modelProviders/wenxin.ts +3 -3
- package/src/const/settings/common.ts +1 -0
- package/src/features/Conversation/Messages/Assistant/Reasoning/index.tsx +11 -1
- package/src/features/Conversation/components/ChatItem/index.tsx +6 -2
- package/src/features/Conversation/components/MarkdownElements/LobeThinking/Render.tsx +4 -0
- package/src/features/Conversation/components/MarkdownElements/Thinking/Render.tsx +12 -1
- package/src/locales/default/setting.ts +12 -0
- package/src/services/chat.ts +15 -6
- package/src/store/user/slices/settings/selectors/general.test.ts +1 -0
- package/src/store/user/slices/settings/selectors/general.ts +2 -0
- package/src/types/aiProvider.ts +11 -11
- package/src/types/llm.ts +8 -10
- package/src/types/user/settings/general.ts +3 -0
- package/src/utils/fetch/__tests__/fetchSSE.test.ts +57 -12
- package/src/utils/fetch/fetchSSE.ts +22 -15
@@ -0,0 +1,256 @@
|
|
1
|
+
/**
|
2
|
+
* Create or update GitHub issue when i18n workflow fails
|
3
|
+
* Usage: node create-failure-issue.js
|
4
|
+
*/
|
5
|
+
|
6
|
+
module.exports = async ({ github, context, core }) => {
|
7
|
+
const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
|
8
|
+
const timestamp = new Date().toISOString();
|
9
|
+
const date = timestamp.split('T')[0];
|
10
|
+
|
11
|
+
// Get error details from environment variables
|
12
|
+
const errorDetails = {
|
13
|
+
validateEnv: process.env.ERROR_VALIDATE_ENV || '',
|
14
|
+
rebaseAttempt: process.env.ERROR_REBASE_ATTEMPT || '',
|
15
|
+
createBranch: process.env.ERROR_CREATE_BRANCH || '',
|
16
|
+
installDeps: process.env.ERROR_INSTALL_DEPS || '',
|
17
|
+
runI18n: process.env.ERROR_RUN_I18N || '',
|
18
|
+
commitPush: process.env.ERROR_COMMIT_PUSH || '',
|
19
|
+
};
|
20
|
+
|
21
|
+
// Get step conclusions from environment variables
|
22
|
+
const stepStatus = {
|
23
|
+
validateEnv: process.env.STEP_VALIDATE_ENV || 'Not run',
|
24
|
+
checkBranch: process.env.STEP_CHECK_BRANCH || 'Not run',
|
25
|
+
rebaseAttempt: process.env.STEP_REBASE_ATTEMPT || 'Not run',
|
26
|
+
createBranch: process.env.STEP_CREATE_BRANCH || 'Not run',
|
27
|
+
installDeps: process.env.STEP_INSTALL_DEPS || 'Not run',
|
28
|
+
runI18n: process.env.STEP_RUN_I18N || 'Not run',
|
29
|
+
commitPush: process.env.STEP_COMMIT_PUSH || 'Not run',
|
30
|
+
createPr: process.env.STEP_CREATE_PR || 'Not run',
|
31
|
+
};
|
32
|
+
|
33
|
+
// Find the first non-empty error
|
34
|
+
const mainError =
|
35
|
+
Object.values(errorDetails).find((error) => error && error.trim()) || 'Unknown error occurred';
|
36
|
+
|
37
|
+
// Determine error category for better troubleshooting
|
38
|
+
const getErrorCategory = (error) => {
|
39
|
+
if (error.includes('API') || error.includes('authentication')) return 'API/Authentication';
|
40
|
+
if (error.includes('network') || error.includes('timeout')) return 'Network/Connectivity';
|
41
|
+
if (error.includes('dependencies') || error.includes('bun')) return 'Dependencies';
|
42
|
+
if (error.includes('git') || error.includes('branch') || error.includes('rebase'))
|
43
|
+
return 'Git Operations';
|
44
|
+
if (error.includes('permission') || error.includes('token')) return 'Permissions';
|
45
|
+
return 'General';
|
46
|
+
};
|
47
|
+
|
48
|
+
const errorCategory = getErrorCategory(mainError);
|
49
|
+
|
50
|
+
const issueTitle = `đ¨ Daily i18n Update Failed - ${date}`;
|
51
|
+
|
52
|
+
const issueBody = `## đ¨ Automated i18n Update Failure
|
53
|
+
|
54
|
+
**Timestamp:** ${timestamp}
|
55
|
+
**Workflow Run:** [#${context.runNumber}](${runUrl})
|
56
|
+
**Repository:** ${context.repo.owner}/${context.repo.repo}
|
57
|
+
**Branch:** ${context.ref}
|
58
|
+
**Commit:** ${context.sha}
|
59
|
+
|
60
|
+
## â Error Details
|
61
|
+
**Primary Error:** ${mainError}
|
62
|
+
**Category:** ${errorCategory}
|
63
|
+
|
64
|
+
## đ Step Status
|
65
|
+
| Step | Status |
|
66
|
+
|------|--------|
|
67
|
+
| Environment Validation | ${stepStatus.validateEnv} |
|
68
|
+
| Branch Check | ${stepStatus.checkBranch} |
|
69
|
+
| Rebase Attempt | ${stepStatus.rebaseAttempt} |
|
70
|
+
| Branch Creation | ${stepStatus.createBranch} |
|
71
|
+
| Dependencies | ${stepStatus.installDeps} |
|
72
|
+
| i18n Update | ${stepStatus.runI18n} |
|
73
|
+
| Git Operations | ${stepStatus.commitPush} |
|
74
|
+
| PR Creation | ${stepStatus.createPr} |
|
75
|
+
|
76
|
+
## đ§ Environment Info
|
77
|
+
- **Runner OS:** ${process.env.RUNNER_OS || 'Unknown'}
|
78
|
+
- **Bun Version:** ${process.env.BUN_VERSION || 'Default'}
|
79
|
+
- **Workflow:** \`${context.workflow}\`
|
80
|
+
|
81
|
+
## đ Debug Information
|
82
|
+
Debug logs have been uploaded as artifacts and will be available for 7 days.
|
83
|
+
|
84
|
+
${getErrorCategoryHelp(errorCategory)}
|
85
|
+
|
86
|
+
## đ ī¸ General Troubleshooting Steps
|
87
|
+
1. Check if all required secrets are properly configured
|
88
|
+
2. Verify OpenAI API quota and billing status
|
89
|
+
3. Review the workflow run logs for detailed error messages
|
90
|
+
4. Check if there are any ongoing GitHub API issues
|
91
|
+
5. Manually trigger the workflow to retry
|
92
|
+
|
93
|
+
## đ Workflow Statistics
|
94
|
+
- **Run Number:** ${context.runNumber}
|
95
|
+
- **Run ID:** ${context.runId}
|
96
|
+
- **Event:** ${context.eventName}
|
97
|
+
|
98
|
+
---
|
99
|
+
**Auto-generated by:** [\`${context.workflow}\`](${runUrl})
|
100
|
+
**Labels:** automated, bug, i18n, workflow-failure, ${errorCategory.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
|
101
|
+
|
102
|
+
try {
|
103
|
+
// Search for existing open issues with similar title
|
104
|
+
const existingIssues = await github.rest.issues.listForRepo({
|
105
|
+
owner: context.repo.owner,
|
106
|
+
repo: context.repo.repo,
|
107
|
+
labels: 'automated,workflow-failure',
|
108
|
+
state: 'open',
|
109
|
+
per_page: 50,
|
110
|
+
});
|
111
|
+
|
112
|
+
const todayPrefix = `đ¨ Daily i18n Update Failed - ${date}`;
|
113
|
+
const existingIssue = existingIssues.data.find((issue) => issue.title.startsWith(todayPrefix));
|
114
|
+
|
115
|
+
if (existingIssue) {
|
116
|
+
// Update existing issue with comment
|
117
|
+
const commentBody = `## đ Additional Failure
|
118
|
+
|
119
|
+
**Timestamp:** ${timestamp}
|
120
|
+
**Workflow Run:** [#${context.runNumber}](${runUrl})
|
121
|
+
**Error Category:** ${errorCategory}
|
122
|
+
**Error:** ${mainError}
|
123
|
+
|
124
|
+
Same issue occurred again. Please investigate the recurring problem.
|
125
|
+
|
126
|
+
### Quick Actions
|
127
|
+
- [ ] Check API quotas and billing
|
128
|
+
- [ ] Verify network connectivity
|
129
|
+
- [ ] Review recent changes that might cause conflicts
|
130
|
+
- [ ] Consider manual intervention
|
131
|
+
|
132
|
+
---
|
133
|
+
*This is failure #${(await getFailureCount(github, context, existingIssue.number)) + 1} for today.*`;
|
134
|
+
|
135
|
+
await github.rest.issues.createComment({
|
136
|
+
owner: context.repo.owner,
|
137
|
+
repo: context.repo.repo,
|
138
|
+
issue_number: existingIssue.number,
|
139
|
+
body: commentBody,
|
140
|
+
});
|
141
|
+
|
142
|
+
// Add priority label if this is a recurring issue
|
143
|
+
const failureCount = await getFailureCount(github, context, existingIssue.number);
|
144
|
+
if (failureCount >= 2) {
|
145
|
+
await github.rest.issues.addLabels({
|
146
|
+
owner: context.repo.owner,
|
147
|
+
repo: context.repo.repo,
|
148
|
+
issue_number: existingIssue.number,
|
149
|
+
labels: ['priority-high', 'recurring'],
|
150
|
+
});
|
151
|
+
}
|
152
|
+
|
153
|
+
core.info(`â
Updated existing issue #${existingIssue.number}`);
|
154
|
+
core.setOutput('issue-number', existingIssue.number);
|
155
|
+
core.setOutput('issue-url', existingIssue.html_url);
|
156
|
+
core.setOutput('action', 'updated');
|
157
|
+
} else {
|
158
|
+
// Create new issue
|
159
|
+
const labels = [
|
160
|
+
'automated',
|
161
|
+
'bug',
|
162
|
+
'i18n',
|
163
|
+
'workflow-failure',
|
164
|
+
errorCategory.toLowerCase().replace(/[^a-z0-9]/g, '-'),
|
165
|
+
];
|
166
|
+
|
167
|
+
const issue = await github.rest.issues.create({
|
168
|
+
owner: context.repo.owner,
|
169
|
+
repo: context.repo.repo,
|
170
|
+
title: issueTitle,
|
171
|
+
body: issueBody,
|
172
|
+
labels: labels,
|
173
|
+
});
|
174
|
+
|
175
|
+
core.info(`â
Created new issue #${issue.data.number}`);
|
176
|
+
core.setOutput('issue-number', issue.data.number);
|
177
|
+
core.setOutput('issue-url', issue.data.html_url);
|
178
|
+
core.setOutput('action', 'created');
|
179
|
+
}
|
180
|
+
} catch (error) {
|
181
|
+
core.setFailed(`Failed to create or update issue: ${error.message}`);
|
182
|
+
throw error;
|
183
|
+
}
|
184
|
+
};
|
185
|
+
|
186
|
+
/**
|
187
|
+
* Get category-specific help text
|
188
|
+
*/
|
189
|
+
function getErrorCategoryHelp(category) {
|
190
|
+
const helpTexts = {
|
191
|
+
'API/Authentication': `
|
192
|
+
### đ API/Authentication Issues
|
193
|
+
- Verify \`OPENAI_API_KEY\` is correctly set and valid
|
194
|
+
- Check if API key has sufficient quota/credits
|
195
|
+
- Ensure \`GH_TOKEN\` has necessary permissions
|
196
|
+
- Test API connectivity manually`,
|
197
|
+
|
198
|
+
'Network/Connectivity': `
|
199
|
+
### đ Network/Connectivity Issues
|
200
|
+
- Check if OpenAI API is experiencing outages
|
201
|
+
- Verify proxy settings if using \`OPENAI_PROXY_URL\`
|
202
|
+
- Retry the workflow as this might be temporary
|
203
|
+
- Check GitHub Actions service status`,
|
204
|
+
|
205
|
+
'Dependencies': `
|
206
|
+
### đĻ Dependencies Issues
|
207
|
+
- Verify \`bun\` version compatibility
|
208
|
+
- Check for package.json changes that might affect dependencies
|
209
|
+
- Clear cache and retry installation
|
210
|
+
- Review recent dependency updates`,
|
211
|
+
|
212
|
+
'Git Operations': `
|
213
|
+
### đ§ Git Operations Issues
|
214
|
+
- Check for conflicting changes in target branch
|
215
|
+
- Verify repository permissions
|
216
|
+
- Review recent commits that might cause conflicts
|
217
|
+
- Manual branch cleanup might be required`,
|
218
|
+
|
219
|
+
'Permissions': `
|
220
|
+
### đ Permissions Issues
|
221
|
+
- Verify \`GH_TOKEN\` has \`repo\` and \`issues\` permissions
|
222
|
+
- Check if token can create/update PRs and branches
|
223
|
+
- Ensure token hasn't expired
|
224
|
+
- Review repository settings and branch protection rules`,
|
225
|
+
|
226
|
+
'General': `
|
227
|
+
### đ General Issues
|
228
|
+
- Review detailed error logs in workflow run
|
229
|
+
- Check for recent changes in codebase
|
230
|
+
- Verify all environment variables are set
|
231
|
+
- Consider running workflow manually with debug enabled`,
|
232
|
+
};
|
233
|
+
|
234
|
+
return helpTexts[category] || helpTexts['General'];
|
235
|
+
}
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Count how many times this issue has failed today
|
239
|
+
*/
|
240
|
+
async function getFailureCount(github, context, issueNumber) {
|
241
|
+
try {
|
242
|
+
const comments = await github.rest.issues.listComments({
|
243
|
+
owner: context.repo.owner,
|
244
|
+
repo: context.repo.repo,
|
245
|
+
issue_number: issueNumber,
|
246
|
+
});
|
247
|
+
|
248
|
+
const today = new Date().toISOString().split('T')[0];
|
249
|
+
return comments.data.filter(
|
250
|
+
(comment) =>
|
251
|
+
comment.body.includes('Additional Failure') && comment.created_at.startsWith(today),
|
252
|
+
).length;
|
253
|
+
} catch (error) {
|
254
|
+
return 0;
|
255
|
+
}
|
256
|
+
}
|
@@ -0,0 +1,359 @@
|
|
1
|
+
name: Daily i18n Update
|
2
|
+
|
3
|
+
on:
|
4
|
+
schedule:
|
5
|
+
- cron: '0 0 * * *'
|
6
|
+
workflow_dispatch:
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
update-i18n:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
timeout-minutes: 30
|
12
|
+
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v4
|
15
|
+
with:
|
16
|
+
fetch-depth: 0
|
17
|
+
token: ${{ secrets.GH_TOKEN }}
|
18
|
+
|
19
|
+
- name: Configure Git
|
20
|
+
run: |
|
21
|
+
git config --global user.name "github-actions[bot]"
|
22
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
23
|
+
|
24
|
+
- name: Install bun
|
25
|
+
uses: oven-sh/setup-bun@v1
|
26
|
+
with:
|
27
|
+
bun-version: ${{ secrets.BUN_VERSION }}
|
28
|
+
|
29
|
+
- name: Validate environment
|
30
|
+
id: validate_env
|
31
|
+
run: |
|
32
|
+
echo "đ Validating environment..."
|
33
|
+
|
34
|
+
# Check required secrets
|
35
|
+
if [ -z "${{ secrets.OPENAI_API_KEY }}" ]; then
|
36
|
+
echo "â OPENAI_API_KEY is missing"
|
37
|
+
echo "env_valid=false" >> $GITHUB_OUTPUT
|
38
|
+
echo "ERROR_VALIDATE_ENV=OPENAI_API_KEY secret is not configured" >> $GITHUB_ENV
|
39
|
+
exit 1
|
40
|
+
fi
|
41
|
+
|
42
|
+
if [ -z "${{ secrets.GH_TOKEN }}" ]; then
|
43
|
+
echo "â GH_TOKEN is missing"
|
44
|
+
echo "env_valid=false" >> $GITHUB_OUTPUT
|
45
|
+
echo "ERROR_VALIDATE_ENV=GH_TOKEN secret is not configured" >> $GITHUB_ENV
|
46
|
+
exit 1
|
47
|
+
fi
|
48
|
+
|
49
|
+
# Test OpenAI API connectivity (optional, with timeout)
|
50
|
+
echo "đ Testing OpenAI API connectivity..."
|
51
|
+
if timeout 30s curl -s -H "Authorization: Bearer ${{ secrets.OPENAI_API_KEY }}" \
|
52
|
+
${{ secrets.OPENAI_PROXY_URL || 'https://api.openai.com' }}/v1/models >/dev/null 2>&1; then
|
53
|
+
echo "â
OpenAI API accessible"
|
54
|
+
else
|
55
|
+
echo "â ī¸ OpenAI API test failed (but continuing...)"
|
56
|
+
fi
|
57
|
+
|
58
|
+
echo "env_valid=true" >> $GITHUB_OUTPUT
|
59
|
+
|
60
|
+
- name: Check if branch exists
|
61
|
+
id: check_branch
|
62
|
+
run: |
|
63
|
+
echo "đ Checking for existing branch..."
|
64
|
+
|
65
|
+
# Retry mechanism for network issues
|
66
|
+
for i in {1..3}; do
|
67
|
+
if git ls-remote --exit-code --heads origin style/auto-i18n >/dev/null 2>&1; then
|
68
|
+
echo "branch_exists=true" >> $GITHUB_OUTPUT
|
69
|
+
echo "đ Found existing branch: style/auto-i18n"
|
70
|
+
exit 0
|
71
|
+
elif [ $i -eq 3 ]; then
|
72
|
+
echo "branch_exists=false" >> $GITHUB_OUTPUT
|
73
|
+
echo "âšī¸ Branch style/auto-i18n does not exist"
|
74
|
+
exit 0
|
75
|
+
else
|
76
|
+
echo "â ī¸ Network issue, retrying... ($i/3)"
|
77
|
+
sleep 5
|
78
|
+
fi
|
79
|
+
done
|
80
|
+
|
81
|
+
- name: Handle existing branch with rebase
|
82
|
+
if: steps.check_branch.outputs.branch_exists == 'true'
|
83
|
+
id: rebase_attempt
|
84
|
+
run: |
|
85
|
+
echo "đ Attempting to rebase existing branch..."
|
86
|
+
|
87
|
+
# Fetch the existing branch with error handling
|
88
|
+
if ! git fetch origin style/auto-i18n; then
|
89
|
+
echo "â Failed to fetch existing branch"
|
90
|
+
echo "rebase_success=false" >> $GITHUB_OUTPUT
|
91
|
+
echo "ERROR_REBASE_ATTEMPT=Failed to fetch existing branch from origin" >> $GITHUB_ENV
|
92
|
+
exit 1
|
93
|
+
fi
|
94
|
+
|
95
|
+
if ! git checkout -b style/auto-i18n origin/style/auto-i18n; then
|
96
|
+
echo "â Failed to checkout existing branch"
|
97
|
+
echo "rebase_success=false" >> $GITHUB_OUTPUT
|
98
|
+
echo "ERROR_REBASE_ATTEMPT=Failed to checkout existing branch" >> $GITHUB_ENV
|
99
|
+
exit 1
|
100
|
+
fi
|
101
|
+
|
102
|
+
# Try to rebase onto latest main
|
103
|
+
if git rebase origin/main; then
|
104
|
+
echo "â
Rebase successful"
|
105
|
+
echo "rebase_success=true" >> $GITHUB_OUTPUT
|
106
|
+
else
|
107
|
+
echo "â Rebase failed due to conflicts"
|
108
|
+
echo "rebase_success=false" >> $GITHUB_OUTPUT
|
109
|
+
|
110
|
+
# Abort the failed rebase
|
111
|
+
git rebase --abort || echo "â ī¸ Failed to abort rebase cleanly"
|
112
|
+
|
113
|
+
# Go back to main and delete the problematic branch
|
114
|
+
git checkout main
|
115
|
+
git branch -D style/auto-i18n || echo "â ī¸ Failed to delete local branch"
|
116
|
+
|
117
|
+
# Try to delete remote branch, handle if it fails
|
118
|
+
if git push origin --delete style/auto-i18n 2>/dev/null; then
|
119
|
+
echo "đī¸ Deleted old branch due to rebase conflicts"
|
120
|
+
else
|
121
|
+
echo "â ī¸ Could not delete remote branch (may not exist or permission issue)"
|
122
|
+
fi
|
123
|
+
fi
|
124
|
+
|
125
|
+
- name: Create clean branch if needed
|
126
|
+
if: steps.check_branch.outputs.branch_exists == 'false' || steps.rebase_attempt.outputs.rebase_success == 'false'
|
127
|
+
id: create_branch
|
128
|
+
run: |
|
129
|
+
echo "đŋ Creating fresh branch from main..."
|
130
|
+
|
131
|
+
# Ensure we're on main and it's up to date
|
132
|
+
git checkout main
|
133
|
+
git pull origin main
|
134
|
+
|
135
|
+
# Create new branch
|
136
|
+
if git checkout -b style/auto-i18n; then
|
137
|
+
echo "â
Successfully created new branch"
|
138
|
+
echo "branch_created=true" >> $GITHUB_OUTPUT
|
139
|
+
else
|
140
|
+
echo "â Failed to create new branch"
|
141
|
+
echo "branch_created=false" >> $GITHUB_OUTPUT
|
142
|
+
echo "ERROR_CREATE_BRANCH=Failed to create new branch style/auto-i18n" >> $GITHUB_ENV
|
143
|
+
exit 1
|
144
|
+
fi
|
145
|
+
|
146
|
+
- name: Install deps
|
147
|
+
id: install_deps
|
148
|
+
run: |
|
149
|
+
echo "đĻ Installing dependencies..."
|
150
|
+
|
151
|
+
# Retry mechanism for dependency installation
|
152
|
+
for i in {1..3}; do
|
153
|
+
if bun i; then
|
154
|
+
echo "â
Dependencies installed successfully"
|
155
|
+
echo "deps_installed=true" >> $GITHUB_OUTPUT
|
156
|
+
exit 0
|
157
|
+
elif [ $i -eq 3 ]; then
|
158
|
+
echo "â Failed to install dependencies after 3 attempts"
|
159
|
+
echo "deps_installed=false" >> $GITHUB_OUTPUT
|
160
|
+
echo "ERROR_INSTALL_DEPS=Failed to install dependencies with bun after 3 retries" >> $GITHUB_ENV
|
161
|
+
exit 1
|
162
|
+
else
|
163
|
+
echo "â ī¸ Dependency installation failed, retrying... ($i/3)"
|
164
|
+
sleep 10
|
165
|
+
fi
|
166
|
+
done
|
167
|
+
|
168
|
+
- name: Run i18n update
|
169
|
+
id: run_i18n
|
170
|
+
run: |
|
171
|
+
echo "đ Running i18n update..."
|
172
|
+
|
173
|
+
# Set timeout and capture output
|
174
|
+
if timeout 900s bun run i18n 2>&1 | tee i18n_output.log; then
|
175
|
+
echo "â
i18n update completed successfully"
|
176
|
+
echo "i18n_success=true" >> $GITHUB_OUTPUT
|
177
|
+
else
|
178
|
+
exit_code=$?
|
179
|
+
echo "â i18n update failed with exit code: $exit_code"
|
180
|
+
echo "i18n_success=false" >> $GITHUB_OUTPUT
|
181
|
+
|
182
|
+
# Capture error details
|
183
|
+
if [ $exit_code -eq 124 ]; then
|
184
|
+
echo "ERROR_RUN_I18N=i18n update timed out after 15 minutes" >> $GITHUB_ENV
|
185
|
+
else
|
186
|
+
echo "ERROR_RUN_I18N=i18n update failed with exit code $exit_code" >> $GITHUB_ENV
|
187
|
+
fi
|
188
|
+
|
189
|
+
# Save output for debugging
|
190
|
+
echo "đ Saving debug output..."
|
191
|
+
exit 1
|
192
|
+
fi
|
193
|
+
env:
|
194
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
195
|
+
OPENAI_PROXY_URL: ${{ secrets.OPENAI_PROXY_URL }}
|
196
|
+
|
197
|
+
- name: Check for changes
|
198
|
+
id: git_status
|
199
|
+
if: steps.run_i18n.outputs.i18n_success == 'true'
|
200
|
+
run: |
|
201
|
+
echo "đ Checking for changes..."
|
202
|
+
|
203
|
+
if git diff --exit-code >/dev/null 2>&1; then
|
204
|
+
echo "changes_exist=false" >> $GITHUB_OUTPUT
|
205
|
+
echo "âšī¸ No changes detected"
|
206
|
+
else
|
207
|
+
echo "changes_exist=true" >> $GITHUB_OUTPUT
|
208
|
+
echo "⨠Changes detected"
|
209
|
+
|
210
|
+
# Show what changed
|
211
|
+
echo "đ Changed files:"
|
212
|
+
git diff --name-only | head -20
|
213
|
+
fi
|
214
|
+
|
215
|
+
- name: Commit and push changes
|
216
|
+
if: steps.git_status.outputs.changes_exist == 'true'
|
217
|
+
id: commit_push
|
218
|
+
run: |
|
219
|
+
echo "đž Committing and pushing changes..."
|
220
|
+
|
221
|
+
git add .
|
222
|
+
|
223
|
+
# Check if there are staged changes after adding files
|
224
|
+
if git diff --cached --exit-code >/dev/null 2>&1; then
|
225
|
+
echo "âšī¸ No staged changes detected after git add. Skipping commit."
|
226
|
+
echo "push_success=false" >> $GITHUB_OUTPUT
|
227
|
+
echo "no_changes_after_stage=true" >> $GITHUB_OUTPUT
|
228
|
+
exit 0
|
229
|
+
fi
|
230
|
+
|
231
|
+
# Attempt to commit with handling for lint-staged preventing empty commits
|
232
|
+
if git commit -m "đ¤ style: update i18n
|
233
|
+
|
234
|
+
- Auto-generated i18n updates
|
235
|
+
- Generated at: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
|
236
|
+
- Workflow run: ${{ github.run_number }}"; then
|
237
|
+
echo "â
Successfully committed changes"
|
238
|
+
else
|
239
|
+
commit_exit_code=$?
|
240
|
+
if [ $commit_exit_code -eq 1 ]; then
|
241
|
+
echo "âšī¸ No changes to commit after lint-staged processing. This is normal."
|
242
|
+
echo "push_success=false" >> $GITHUB_OUTPUT
|
243
|
+
echo "no_changes_after_lint=true" >> $GITHUB_OUTPUT
|
244
|
+
exit 0
|
245
|
+
else
|
246
|
+
echo "â Commit failed with exit code: $commit_exit_code"
|
247
|
+
echo "push_success=false" >> $GITHUB_OUTPUT
|
248
|
+
echo "ERROR_COMMIT_PUSH=Git commit failed with exit code $commit_exit_code" >> $GITHUB_ENV
|
249
|
+
exit 1
|
250
|
+
fi
|
251
|
+
fi
|
252
|
+
|
253
|
+
# Push with retry mechanism
|
254
|
+
for i in {1..3}; do
|
255
|
+
if git push origin style/auto-i18n --force-with-lease; then
|
256
|
+
echo "â
Successfully pushed changes"
|
257
|
+
echo "push_success=true" >> $GITHUB_OUTPUT
|
258
|
+
exit 0
|
259
|
+
elif [ $i -eq 3 ]; then
|
260
|
+
echo "â Failed to push changes after 3 attempts"
|
261
|
+
echo "push_success=false" >> $GITHUB_OUTPUT
|
262
|
+
echo "ERROR_COMMIT_PUSH=Failed to push changes to remote repository after 3 retries" >> $GITHUB_ENV
|
263
|
+
exit 1
|
264
|
+
else
|
265
|
+
echo "â ī¸ Push failed, retrying... ($i/3)"
|
266
|
+
sleep 5
|
267
|
+
fi
|
268
|
+
done
|
269
|
+
|
270
|
+
- name: Create or Update Pull Request
|
271
|
+
if: steps.git_status.outputs.changes_exist == 'true' && steps.commit_push.outputs.push_success == 'true'
|
272
|
+
id: create_pr
|
273
|
+
uses: peter-evans/create-pull-request@v4
|
274
|
+
with:
|
275
|
+
token: ${{ secrets.GH_TOKEN }}
|
276
|
+
branch: 'style/auto-i18n'
|
277
|
+
title: 'đ¤ style: update i18n'
|
278
|
+
body: |
|
279
|
+
This PR updates the i18n files.
|
280
|
+
|
281
|
+
## đ Update Strategy
|
282
|
+
${{ steps.check_branch.outputs.branch_exists == 'true' && steps.rebase_attempt.outputs.rebase_success == 'true' && 'â
Successfully rebased existing branch onto latest main' || '' }}
|
283
|
+
${{ steps.check_branch.outputs.branch_exists == 'true' && steps.rebase_attempt.outputs.rebase_success == 'false' && 'đ Recreated branch due to rebase conflicts' || '' }}
|
284
|
+
${{ steps.check_branch.outputs.branch_exists == 'false' && 'đŋ Created fresh branch from main' || '' }}
|
285
|
+
|
286
|
+
## đ Changes
|
287
|
+
- Auto-generated i18n updates
|
288
|
+
- Generated at: ${{ github.run_number }}
|
289
|
+
- Timestamp: $(date -u '+%Y-%m-%d %H:%M:%S UTC')
|
290
|
+
|
291
|
+
## đ¤ Automation Info
|
292
|
+
- Workflow: `${{ github.workflow }}`
|
293
|
+
- Run ID: `${{ github.run_id }}`
|
294
|
+
- Commit: `${{ github.sha }}`
|
295
|
+
|
296
|
+
> This PR is automatically generated by GitHub Actions and kept up-to-date with the latest main branch.
|
297
|
+
base: main
|
298
|
+
labels: |
|
299
|
+
i18n
|
300
|
+
automated
|
301
|
+
style
|
302
|
+
|
303
|
+
- name: Check Pull Request Status
|
304
|
+
if: steps.git_status.outputs.changes_exist == 'true' && steps.commit_push.outputs.push_success == 'true'
|
305
|
+
run: |
|
306
|
+
if [ "${{ steps.create_pr.outputs.pull-request-number }}" ]; then
|
307
|
+
echo "â
Pull request #${{ steps.create_pr.outputs.pull-request-number }} created/updated successfully."
|
308
|
+
echo "đ PR URL: ${{ steps.create_pr.outputs.pull-request-url }}"
|
309
|
+
else
|
310
|
+
echo "â Failed to create/update pull request."
|
311
|
+
exit 1
|
312
|
+
fi
|
313
|
+
|
314
|
+
- name: No changes
|
315
|
+
if: |
|
316
|
+
(steps.git_status.outputs.changes_exist != 'true' && steps.run_i18n.outputs.i18n_success == 'true') ||
|
317
|
+
(steps.commit_push.outputs.no_changes_after_stage == 'true') ||
|
318
|
+
(steps.commit_push.outputs.no_changes_after_lint == 'true')
|
319
|
+
run: |
|
320
|
+
if [ "${{ steps.commit_push.outputs.no_changes_after_stage }}" == "true" ]; then
|
321
|
+
echo "âšī¸ No staged changes detected after git add. Skipping PR creation."
|
322
|
+
elif [ "${{ steps.commit_push.outputs.no_changes_after_lint }}" == "true" ]; then
|
323
|
+
echo "âšī¸ No changes remaining after lint-staged processing. Skipping PR creation."
|
324
|
+
else
|
325
|
+
echo "âšī¸ No changes to commit. Skipping PR creation."
|
326
|
+
fi
|
327
|
+
|
328
|
+
# Set step status for issue creation
|
329
|
+
- name: Set step conclusions
|
330
|
+
if: always()
|
331
|
+
run: |
|
332
|
+
echo "STEP_VALIDATE_ENV=${{ steps.validate_env.conclusion || 'Not run' }}" >> $GITHUB_ENV
|
333
|
+
echo "STEP_CHECK_BRANCH=${{ steps.check_branch.conclusion || 'Not run' }}" >> $GITHUB_ENV
|
334
|
+
echo "STEP_REBASE_ATTEMPT=${{ steps.rebase_attempt.conclusion || 'Not run' }}" >> $GITHUB_ENV
|
335
|
+
echo "STEP_CREATE_BRANCH=${{ steps.create_branch.conclusion || 'Not run' }}" >> $GITHUB_ENV
|
336
|
+
echo "STEP_INSTALL_DEPS=${{ steps.install_deps.conclusion || 'Not run' }}" >> $GITHUB_ENV
|
337
|
+
echo "STEP_RUN_I18N=${{ steps.run_i18n.conclusion || 'Not run' }}" >> $GITHUB_ENV
|
338
|
+
echo "STEP_COMMIT_PUSH=${{ steps.commit_push.conclusion || 'Not run' }}" >> $GITHUB_ENV
|
339
|
+
echo "STEP_CREATE_PR=${{ steps.create_pr.conclusion || 'Not run' }}" >> $GITHUB_ENV
|
340
|
+
|
341
|
+
# Error handling and issue creation
|
342
|
+
- name: Upload debug artifacts
|
343
|
+
if: failure()
|
344
|
+
uses: actions/upload-artifact@v4
|
345
|
+
with:
|
346
|
+
name: debug-logs-${{ github.run_number }}
|
347
|
+
path: |
|
348
|
+
i18n_output.log
|
349
|
+
/tmp/*.log
|
350
|
+
retention-days: 7
|
351
|
+
|
352
|
+
- name: Create issue on failure
|
353
|
+
if: failure()
|
354
|
+
uses: actions/github-script@v6
|
355
|
+
with:
|
356
|
+
github-token: ${{ secrets.GH_TOKEN }}
|
357
|
+
script: |
|
358
|
+
const createFailureIssue = require('./.github/scripts/create-failure-issue.js');
|
359
|
+
return await createFailureIssue({ github, context, core });
|
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,48 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.94.4](https://github.com/lobehub/lobe-chat/compare/v1.94.3...v1.94.4)
|
6
|
+
|
7
|
+
<sup>Released on **2025-06-11**</sup>
|
8
|
+
|
9
|
+
#### đ Styles
|
10
|
+
|
11
|
+
- **misc**: Transition animation switch.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Transition animation switch, closes [#7981](https://github.com/lobehub/lobe-chat/issues/7981) ([dd4ab3f](https://github.com/lobehub/lobe-chat/commit/dd4ab3f))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.94.3](https://github.com/lobehub/lobe-chat/compare/v1.94.2...v1.94.3)
|
31
|
+
|
32
|
+
<sup>Released on **2025-06-11**</sup>
|
33
|
+
|
34
|
+
<br/>
|
35
|
+
|
36
|
+
<details>
|
37
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
38
|
+
|
39
|
+
</details>
|
40
|
+
|
41
|
+
<div align="right">
|
42
|
+
|
43
|
+
[](#readme-top)
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
5
47
|
### [Version 1.94.2](https://github.com/lobehub/lobe-chat/compare/v1.94.1...v1.94.2)
|
6
48
|
|
7
49
|
<sup>Released on **2025-06-11**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,18 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Transition animation switch."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-06-11",
|
9
|
+
"version": "1.94.4"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {},
|
13
|
+
"date": "2025-06-11",
|
14
|
+
"version": "1.94.3"
|
15
|
+
},
|
2
16
|
{
|
3
17
|
"children": {
|
4
18
|
"fixes": [
|