Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
6c90240
multitabs work
wzulfikar Nov 12, 2025
cd25c5b
f
wzulfikar Nov 12, 2025
a016091
animate tab title when chat is still generating
wzulfikar Nov 12, 2025
f571675
add action CloseActiveThreadTab
wzulfikar Nov 12, 2025
984ee0d
add pulsating label
wzulfikar Nov 12, 2025
7202924
keep toolbar visible
wzulfikar Nov 12, 2025
dab5ba2
use pulsating_between
wzulfikar Nov 12, 2025
a9e479e
f
wzulfikar Nov 12, 2025
022613f
add return icon when editing
wzulfikar Nov 12, 2025
8ef4711
todo: add gap close button and tab title
wzulfikar Nov 12, 2025
6bde7b2
add icon shape square
wzulfikar Nov 12, 2025
15cf63b
Merge branch 'zd-main' into add-tabs
wzulfikar Nov 12, 2025
afaba57
extract tab codes to agent_panel_tab
wzulfikar Nov 12, 2025
338b949
f
wzulfikar Nov 12, 2025
2dbf635
add opencode review
wzulfikar Nov 12, 2025
adb4504
f
wzulfikar Nov 12, 2025
42dfe6f
trigger opencode review
wzulfikar Nov 12, 2025
8c808fc
f
wzulfikar Nov 12, 2025
e955684
use opencode review template from sst/opencode
wzulfikar Nov 12, 2025
a08f8e9
test opencode review
wzulfikar Nov 12, 2025
f7cf8b6
f
wzulfikar Nov 12, 2025
69a757d
fix bad subsitution
wzulfikar Nov 12, 2025
ec9a99b
add issues: write
wzulfikar Nov 12, 2025
a0fbf3e
use gh token
wzulfikar Nov 12, 2025
fc93bd9
f
wzulfikar Nov 12, 2025
278daf4
use z.ai
wzulfikar Nov 12, 2025
880792c
Update opencode_review.yml
wzulfikar Nov 12, 2025
ab50009
use GH_TOKEN
wzulfikar Nov 12, 2025
d76a11c
f
wzulfikar Nov 12, 2025
cfa2bc9
attempt to isolate post pr comment
wzulfikar Nov 12, 2025
b81c431
extract to steps
wzulfikar Nov 12, 2025
b1746d5
f
wzulfikar Nov 12, 2025
b8c3b16
f
wzulfikar Nov 12, 2025
4008e2f
f
wzulfikar Nov 12, 2025
3ce7d04
f
wzulfikar Nov 12, 2025
13f39ff
f
wzulfikar Nov 12, 2025
33b4fcd
f
wzulfikar Nov 12, 2025
497c75c
f
wzulfikar Nov 12, 2025
ee414cd
f
wzulfikar Nov 12, 2025
b27b7d8
f
wzulfikar Nov 12, 2025
48e047b
current workdir
wzulfikar Nov 12, 2025
b35bc4c
t
wzulfikar Nov 12, 2025
064a92d
f
wzulfikar Nov 12, 2025
fc4dbd6
f
wzulfikar Nov 12, 2025
cb26fec
f
wzulfikar Nov 12, 2025
e953c4f
f
wzulfikar Nov 12, 2025
7b78082
f
wzulfikar Nov 12, 2025
c7cc538
f
wzulfikar Nov 12, 2025
0386215
f
wzulfikar Nov 12, 2025
c0ab65e
f
wzulfikar Nov 12, 2025
a133edd
f
wzulfikar Nov 12, 2025
8a543f8
f
wzulfikar Nov 12, 2025
050809c
f
wzulfikar Nov 12, 2025
8099985
f
wzulfikar Nov 12, 2025
a01d15b
f
wzulfikar Nov 12, 2025
2307481
f
wzulfikar Nov 12, 2025
319bc56
f
wzulfikar Nov 12, 2025
34bb5c9
f
wzulfikar Nov 12, 2025
91bc246
f
wzulfikar Nov 12, 2025
c719a74
f
wzulfikar Nov 12, 2025
ed49a5c
f
wzulfikar Nov 12, 2025
75ad391
parse diff path
wzulfikar Nov 12, 2025
ca873ba
f
wzulfikar Nov 12, 2025
c6376ce
f
wzulfikar Nov 12, 2025
dd39f48
f
wzulfikar Nov 12, 2025
8c286bb
f
wzulfikar Nov 12, 2025
fea804b
gh token
wzulfikar Nov 12, 2025
c412065
remove issues: write
wzulfikar Nov 12, 2025
229a5cb
focus on diffs
wzulfikar Nov 12, 2025
bc8acd1
p
wzulfikar Nov 12, 2025
c063622
f
wzulfikar Nov 12, 2025
336a194
f
wzulfikar Nov 12, 2025
0309947
f
wzulfikar Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/opencode_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: OpenCode Review

on:
pull_request:
types: [opened, synchronize]

jobs:
code-review:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install opencode
run: curl -fsSL https://opencode.ai/install | bash

- name: Review PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ZAI_API_KEY: ${{ secrets.ZAI_API_KEY }}
OPENCODE_MODEL: "zai-coding-plan/glm-4.6"
OPENCODE_PERMISSION: '{ "bash": { "./post_pr_comment*": "allow", "gh*": "allow", "gh api*": "deny", "gh pr review*": "deny", "*": "deny" } }'
run: |
# Create post_pr_comment script
cat << 'EOF' > $PWD/post_pr_comment
#!/bin/bash
# Use temporary file to store the comment so we can use full markdown format
printf '%s' "$1" > /tmp/comment.md
# Strip full path to make it relative to current working directory
diff_path=$(realpath --relative-to=. "$2")

gh api --method POST \
-H 'X-GitHub-Api-Version: 2022-11-28' \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/comments \
--raw-field 'commit_id=${{ github.event.pull_request.head.sha }}' \
--raw-field 'side=RIGHT' \
--field "body=@/tmp/comment.md" --raw-field "path=$diff_path" --field "line=$3"
EOF
chmod +x $PWD/post_pr_comment

# Configure OpenCode auth
mkdir -p $HOME/.local/share/opencode/
echo '{"zai-coding-plan": { "type": "api", "key": "'$ZAI_API_KEY'"}}' > $HOME/.local/share/opencode/auth.json

# Start OpenCode with PR review prompt
opencode run -m $OPENCODE_MODEL 'A new pull request has been created: "${{ github.event.pull_request.title }}"

<repository>
${{ github.repository }}
</repository>

<pr-number>
${{ github.event.pull_request.number }}
</pr-number>

<pr-description>
${{ github.event.pull_request.body }}
</pr-description>

You are a diligent senior engineer. Review the code changes in this pull request against the guidelines in the ".rules" file. Only review the changes found in diffs, but feel free to read the entire file to get more context. Make it clear the suggestions are merely suggestions and the human can decide what to do. Be concise and to the point. Start directly with the comment, no need to state e.g. "The guideline states...". Wrap codes in backticks (`) or triple backticks (```) for inline and multi-line code respectively.

How to post the comments:

- Use the `post_pr_comment` command to create comments on the files for the violations.
- Focus on changes in the diffs so you can leave the comment on the exact line number.
- If you have a suggested fix, wrap the suggestion in codeblock.
- Only create comments for actual violations. Don't run any `post_pr_comment` if no violations.
- Command format MUST be like this:
./post_pr_comment '[comment]' '[path-to-file]' [line]
"
10 changes: 10 additions & 0 deletions crates/agent_ui/src/acp/thread_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,16 @@ impl AcpThreadView {
}
}

pub fn session_id(&self, cx: &App) -> Option<acp::SessionId> {
if let Some(thread) = self.thread() {
Some(thread.read(cx).session_id().clone())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using .map() instead of .clone() inside the closure since session_id() already returns a reference that can be cloned if needed.

} else {
self.resume_thread_metadata
.as_ref()
.map(|metadata| metadata.id.clone())
}
}

pub fn mode_selector(&self) -> Option<&Entity<ModeSelector>> {
match &self.thread_state {
ThreadState::Ready { mode_selector, .. } => mode_selector.as_ref(),
Expand Down
Loading
Loading