-
Notifications
You must be signed in to change notification settings - Fork 317
feat: Add preview content about agent mode #13
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
Merged
Changes from 18 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
971ab05
feat: Add intro for bonus lesson
chriswblake af472ab
feat: Add steps to switch to insiders mode
chriswblake 300f9b9
feat: Add steps to switch to agent mode
chriswblake 6d09447
feat: Add prompt to add delete icons on participants
chriswblake 58ff19c
feat: Add prompt to fix bug when adding participants
chriswblake 9d8192f
feat: Add second activity intro
chriswblake 8e0cd58
feat: Add prompt to install mongodb
chriswblake dfa999d
feat: Add prompt to modify the app to use mongodb
chriswblake 48fff1a
docs: Add description of agent mode
chriswblake 82fb1a6
chore: Move finish message to end
chriswblake 8053e92
feat: Add workflow to trigger bonus lesson
chriswblake 126d5cf
feat: Modify step 3 to clarify bullet points are desired
chriswblake dac7cb0
feat: Add hint about bonus level to step 3
chriswblake aa79844
feat: Modify 2 workflow 2 to enable the bonus content
chriswblake 6888646
fix: cleanup from dev work
chriswblake a6dd60b
docs: Add note about insiders changing daily.
chriswblake 6eca8e8
docs: Add styling to prompts.
chriswblake 1651b10
fix: alert format doesn't work inside expanding details
chriswblake e6a9076
fix: Require keywords for workflow to run
chriswblake 37faaaa
fix: Clarify need for both insiders version of vs code and pre-releas…
chriswblake 5ab770c
chore: Update agent mode screenshot
chriswblake 8b00dae
fix: Clarify breaking change nature of preview features.
chriswblake 7636d7f
fix: typo
chriswblake 999a634
fix: Ensure copilot to update the styling css.
chriswblake e966950
chore: Move insiders instructions into own activity area
chriswblake 1ba1ecb
feat: Add some intro text to the activity
chriswblake c3157a5
fix: update screenshot
chriswblake 17d8fde
chore: Wording tweaks
chriswblake 45f6503
feat: Add step to suggest trying another model
chriswblake e625305
fix: Update screenshots
chriswblake 62caf61
chore: wording tweaks
chriswblake 67571d3
fix: incorrect workflow name
chriswblake 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
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,110 @@ | ||
### :keyboard: Bonus Activity - Preview of GitHub Copilot Agent Mode | ||
|
||
Nice! You found this hidden bonus level! 🎮 👾 | ||
|
||
If you have been keeping an eye on Github, you may have heard about **Agent** mode. | ||
It's a public preview feature for GitHub Copilot. | ||
|
||
But... it's only for _Insiders_! 😎🤫 | ||
|
||
But... good news. Anyone can access the Insiders version if they know the tricks. Yay! 🧐🎉 | ||
|
||
> [!IMPORTANT] | ||
> This activity is optional and ungraded. | ||
> Since the Insiders version is updated daily, please expect to see differences. | ||
|
||
### What is "Agent" Mode? | ||
|
||
**Agent** mode enhances Copilot by automatically providing it feedback, typically the types of feedback you would provide after reviewing Copilot's suggested edits. | ||
|
||
**Agent** mode gives Copilot a feedback loop, enabling it to inspect its own results for issues, bugs, inconsistency, etc. in the code and even the terminal! This allows it to automatically revise its work in many situations. Similarly this means **Agent** mode can | ||
typically handle more complex and multi-step tasks. | ||
|
||
That's just a brief intro and there is much more to learn, but that's for a dedicated future exercise. (hint) | ||
|
||
Now, let's give **Agent** mode a try! 👩🚀 | ||
|
||
### :keyboard: Activity: Test out Copilot Agent mode! 🧑🚀 | ||
|
||
> [!IMPORTANT] | ||
> Copilot Agent mode is only available when using the insiders version of VS Code and the pre-release version of the GitHub Copilot extension. | ||
|
||
1. If needed, use the below steps to switch your VS Code and Copilot extension to the **Insiders** version. | ||
|
||
1. Ensure you are in a browser-based instance of VS Code (your Codespace). | ||
|
||
> **Tip:** This allows switching to **Insiders** mode without installing another version on your local computer. | ||
|
||
1. In the bottom left, click the **Manage** icon and select the **Switch to Insiders Version...** option. | ||
|
||
<img width="300" alt="image" src="https://github.com/user-attachments/assets/11580b67-9891-4aa9-9a7c-04aff1e7ef9c" /> | ||
|
||
1. In the left navigation, select the **Extensions** tab. | ||
Find the **GitHub Copilot** entry, click the **Manage** icon, and select **Switch to Pre-Release Version**. | ||
|
||
<img width="300" alt="image" src="https://github.com/user-attachments/assets/39e1d9ae-ba50-4cd7-b6b6-eb51aa0a35aa" /> | ||
|
||
1. Open the **Copilot Edits** side panel. Use the new dropdown menu to switch to **Agent** mode. | ||
|
||
<img width="250" alt="image" src="https://github.com/user-attachments/assets/1849c14d-99f5-48f9-a7fb-8f623bb6837f" /> | ||
|
||
1. Time for a test! Let's ask Copilot to add functionality for removing participants. | ||
|
||
> <img width="13px" src="https://github.com/user-attachments/assets/98fd5d2e-ea29-4a4a-9212-c7050e177a69" /> **Prompt** | ||
> | ||
> ```prompt | ||
> #codebase Please add a delete icon next to each participant and hide the bullet points. | ||
> When clicked, it will unregister that participant from the activity. | ||
> ``` | ||
|
||
- If you try this prompt in **Edit** mode, you will find that the changes to the frontend and backend were made in a theoretical way. Although no syntax or runtime errors occurred, the changes were not compatible and didn't achieve the goal. | ||
- In **Agent** mode, Copilot reviewed its own work and refined it to ensure all changes were error free and coordinated together. | ||
|
||
1. When Copilot is finished, restart the debugger and inspect the results. If you like the results, press the **Keep** button. If not, try providing Copilot some feedback. | ||
|
||
1. Ask Copilot to fix a registration bug. | ||
|
||
> <img width="13px" src="https://github.com/user-attachments/assets/98fd5d2e-ea29-4a4a-9212-c7050e177a69" /> **Prompt** | ||
> | ||
> ```prompt | ||
> #codebase I've noticed there seems to be a bug. | ||
> When a participant is registered, the page must be refreshed to see the change on the activity. | ||
> ``` | ||
|
||
- If you try this prompt in **Edit** mode, it may or may not work. | ||
|
||
1. When Copilot is finished, inspect the results. If you like the results, press the **Keep** button. If not, try providing Copilot some feedback. | ||
|
||
### :keyboard: Activity: Test out Copilot Agent mode, _again_! 🧑🚀🚀 | ||
|
||
Just for fun, let's try something even more difficult and see what happens! | ||
|
||
> [!IMPORTANT] | ||
> The below request asks much more of Copilot. | ||
> As such is more open-ended and may not work everytime. | ||
|
||
1. Ask Copilot to install a local database service. | ||
|
||
> <img width="13px" src="https://github.com/user-attachments/assets/98fd5d2e-ea29-4a4a-9212-c7050e177a69" /> **Prompt** | ||
> | ||
> ```prompt | ||
> Please install a local mongodb server for development reasons. | ||
chriswblake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> Afterward, run a command that lists the collections to verify the service is active and working. | ||
> Do not modify our program yet. | ||
> ``` | ||
|
||
- We purposly made the default development environment not ready for installing a local MongoDB server. | ||
- You will see Copilot make mistakes, analyze the error messages, and ask to run various extra commands to make the environment suitable. Nice! | ||
|
||
1. Ask Copilot to change our app to use the database service. 🤯 | ||
|
||
> <img width="13px" src="https://github.com/user-attachments/assets/98fd5d2e-ea29-4a4a-9212-c7050e177a69" /> **Prompt** | ||
> | ||
> ```prompt | ||
> #codebase I don't like that we are storing the data in memory. | ||
> Let's switch to using mongodb. | ||
> For now use the local development instance. | ||
> Please prepopulate the database with the existing hardcoded json activities, keeping the the activity name as the key. | ||
chriswblake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> ``` | ||
|
||
1. That's your preview for now. We hope it was fun and please check back soon on the [Skills page](https://skills.github.com) for a dedicated exercise to explore even more of Agent Mode! 🧑🚀 🚀 |
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
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,82 @@ | ||
name: Step 3b # Copilot Agent Mode | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
permissions: | ||
contents: read | ||
actions: write | ||
issues: write | ||
|
||
env: | ||
# Keywords required in the issue comment to allow this workflow to run | ||
REQUIRED_ISSUE_COMMENT_KEYWORDS: "@professortocat,Agent" | ||
STEP_3B_FILE: ".github/steps/3b-copilot-agent-mode.md" | ||
|
||
jobs: | ||
required_issue_comment_keywords: | ||
name: Check issue comment text for required keywords | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Stop early if missing the expected keywords, case insensitive | ||
shell: bash | ||
run: | | ||
required_keywords=(${REQUIRED_ISSUE_COMMENT_KEYWORDS//,/ }) | ||
comment_body_lower=$(echo "$COMMENT_BODY" | tr '[:upper:]' '[:lower:]') | ||
for keyword in "${required_keywords[@]}"; do | ||
keyword_lower=$(echo "$keyword" | tr '[:upper:]' '[:lower:]') | ||
if [[ ! "$comment_body_lower" =~ $keyword_lower ]]; then | ||
exit 1 | ||
fi | ||
done | ||
env: | ||
COMMENT_BODY: ${{ github.event.comment.body }} | ||
|
||
find_exercise: | ||
name: Find exercise by issue title | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
issue-url: ${{ steps.get-issue-url.outputs.ISSUE_URL }} | ||
|
||
steps: | ||
- id: get-issue-url | ||
run: | | ||
# Get the issue url from the event or search for it. | ||
if [ -n "${{ github.event.issue }}" ]; then | ||
issue_url="${{ github.event.issue.html_url }}" | ||
else | ||
issue_url=$(gh issue list --repo $REPO --search "in:title Exercise:" --json url,title --jq '.[].url') | ||
fi | ||
|
||
# Save to output | ||
echo "ISSUE_URL=$issue_url" >> $GITHUB_OUTPUT | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
REPO: ${{ github.repository }} | ||
|
||
post_step_3b_content: | ||
name: Post step 3b content | ||
needs: [find_exercise] | ||
chriswblake marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runs-on: ubuntu-latest | ||
env: | ||
ISSUE_URL: ${{ needs.find_exercise.outputs.issue-url }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create comment - add step content | ||
run: | | ||
gh issue comment "$ISSUE_URL" \ | ||
--body-file "$STEP_3B_FILE" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Disable current workflow | ||
run: | | ||
gh workflow disable "Step 3b" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
Uh oh!
There was an error while loading. Please reload this page.