forked from zed-industries/zed
-
Notifications
You must be signed in to change notification settings - Fork 0
Add agent tabs #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
6c90240
multitabs work
wzulfikar cd25c5b
f
wzulfikar a016091
animate tab title when chat is still generating
wzulfikar f571675
add action CloseActiveThreadTab
wzulfikar 984ee0d
add pulsating label
wzulfikar 7202924
keep toolbar visible
wzulfikar dab5ba2
use pulsating_between
wzulfikar a9e479e
f
wzulfikar 022613f
add return icon when editing
wzulfikar 8ef4711
todo: add gap close button and tab title
wzulfikar 6bde7b2
add icon shape square
wzulfikar 15cf63b
Merge branch 'zd-main' into add-tabs
wzulfikar afaba57
extract tab codes to agent_panel_tab
wzulfikar 338b949
f
wzulfikar 2dbf635
add opencode review
wzulfikar adb4504
f
wzulfikar 42dfe6f
trigger opencode review
wzulfikar 8c808fc
f
wzulfikar e955684
use opencode review template from sst/opencode
wzulfikar a08f8e9
test opencode review
wzulfikar f7cf8b6
f
wzulfikar 69a757d
fix bad subsitution
wzulfikar ec9a99b
add issues: write
wzulfikar a0fbf3e
use gh token
wzulfikar fc93bd9
f
wzulfikar 278daf4
use z.ai
wzulfikar 880792c
Update opencode_review.yml
wzulfikar ab50009
use GH_TOKEN
wzulfikar d76a11c
f
wzulfikar cfa2bc9
attempt to isolate post pr comment
wzulfikar b81c431
extract to steps
wzulfikar b1746d5
f
wzulfikar b8c3b16
f
wzulfikar 4008e2f
f
wzulfikar 3ce7d04
f
wzulfikar 13f39ff
f
wzulfikar 33b4fcd
f
wzulfikar 497c75c
f
wzulfikar ee414cd
f
wzulfikar b27b7d8
f
wzulfikar 48e047b
current workdir
wzulfikar b35bc4c
t
wzulfikar 064a92d
f
wzulfikar fc4dbd6
f
wzulfikar cb26fec
f
wzulfikar e953c4f
f
wzulfikar 7b78082
f
wzulfikar c7cc538
f
wzulfikar 0386215
f
wzulfikar c0ab65e
f
wzulfikar a133edd
f
wzulfikar 8a543f8
f
wzulfikar 050809c
f
wzulfikar 8099985
f
wzulfikar a01d15b
f
wzulfikar 2307481
f
wzulfikar 319bc56
f
wzulfikar 34bb5c9
f
wzulfikar 91bc246
f
wzulfikar c719a74
f
wzulfikar ed49a5c
f
wzulfikar 75ad391
parse diff path
wzulfikar ca873ba
f
wzulfikar c6376ce
f
wzulfikar dd39f48
f
wzulfikar 8c286bb
f
wzulfikar fea804b
gh token
wzulfikar c412065
remove issues: write
wzulfikar 229a5cb
focus on diffs
wzulfikar bc8acd1
p
wzulfikar c063622
f
wzulfikar 336a194
f
wzulfikar 0309947
f
wzulfikar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| 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] | ||
| " |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 sincesession_id()already returns a reference that can be cloned if needed.