chore: run terminal settlement repair #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rebuild Telegram successor on current dev | |
| on: | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| issues: write | |
| jobs: | |
| rebuild: | |
| if: github.event.issue.number == 1 && github.event.comment.body == '/rebuild-telegram-clean' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: fix/telegram-tool-activity-terminal-rejection | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Apply exact net feature diff onto current dev | |
| id: apply | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| git config user.name "twoimo" | |
| git config user.email "32544727+twoimo@users.noreply.github.com" | |
| git fetch --no-tags origin backup/telegram-tool-activity-103337 | |
| git diff --binary 7c3f5907b5fbd42d573fe3a2186858b7245c3e77..origin/backup/telegram-tool-activity-103337 > /tmp/telegram-successor.patch | |
| if ! git apply --3way --index /tmp/telegram-successor.patch; then | |
| git diff --name-only --diff-filter=U > /tmp/telegram-conflicts.txt | |
| exit 1 | |
| fi | |
| - name: Report patch conflicts | |
| if: steps.apply.outcome == 'failure' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const paths = fs.existsSync('/tmp/telegram-conflicts.txt') | |
| ? fs.readFileSync('/tmp/telegram-conflicts.txt', 'utf8').trim() | |
| : '(patch failed before conflict enumeration)'; | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: 1, | |
| body: `TELEGRAM_REBUILD_FAILED\n\n${paths}`, | |
| }); | |
| - name: Stop after conflict report | |
| if: steps.apply.outcome == 'failure' | |
| run: exit 1 | |
| - uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Format changed TypeScript and Rust files | |
| shell: bash | |
| run: | | |
| bunx biome check --write \ | |
| packages/coding-agent/src/sdk/bus/telegram-daemon.ts \ | |
| packages/coding-agent/test/notifications-telegram-daemon.test.ts \ | |
| packages/coding-agent/test/notifications-tool-activity.test.ts \ | |
| packages/coding-agent/test/sdk-host.test.ts \ | |
| scripts/telegram-daemon-generation-guard.ts \ | |
| scripts/telegram-daemon-generation-guard.test.ts | |
| cargo fmt --all | |
| git add -A | |
| - name: Run focused rejected-terminal regression | |
| run: bun test --timeout 30000 packages/coding-agent/test/notifications-telegram-daemon.test.ts --test-name-pattern "terminal submission rejection" | |
| - name: Run Telegram lifecycle suites | |
| run: | | |
| bun test --timeout 30000 \ | |
| packages/coding-agent/test/notifications-telegram-daemon.test.ts \ | |
| packages/coding-agent/test/notifications-tool-activity.test.ts \ | |
| packages/coding-agent/test/sdk-host.test.ts | |
| bun test --timeout 30000 scripts/telegram-daemon-generation-guard.test.ts | |
| bun scripts/telegram-daemon-generation-guard.ts --validate-current-tree | |
| - name: Run package check | |
| run: bun --cwd=packages/coding-agent run check | |
| - name: Commit clean successor | |
| shell: bash | |
| run: | | |
| git add -A | |
| git commit -m "fix(notifications): retire rejected legacy tool terminals" | |
| git push --force-with-lease origin HEAD:fix/telegram-tool-activity-terminal-rejection | |
| - name: Report successful verification | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: 1, | |
| body: `TELEGRAM_REBUILD_OK\n\n${process.env.GITHUB_SHA}`, | |
| }); |