Skip to content

feat: Sourcegraph Amp module #257

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Harsh9485
Copy link

@Harsh9485 Harsh9485 commented Jul 29, 2025

Closes #238
/claim #238

Description

Video - https://www.loom.com/share/59e80a7fa3e54973bb0318132bc849a7?sid=4900077a-6fdb-4760-978c-9ad2e2daa9d8

Screenshot 2025-08-02 164234

Type of Change

  • New module
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

Path: registry/harsh9485]/modules/sourcegraph_amp
New version: v1.0.0
Breaking change: [ ] Yes [x] No

Testing & Validation

  • Tests pass (bun test)
  • Code formatted (bun run fmt)
  • Changes tested locally

Related Issues

@algora-pbc algora-pbc bot mentioned this pull request Jul 29, 2025
6 tasks
@Harsh9485
Copy link
Author

This PR is not ready for review because I’m facing an error, which I’ve fully described on Discord. I’d really appreciate it if you could help me solve it.

https://discord.com/channels/747933592273027093/1143265221545316445/1398733269096337478

@matifali matifali requested a review from hugodutka July 29, 2025 10:43
@matifali matifali requested a review from DevelopmentCats July 29, 2025 16:17
@Harsh9485 Harsh9485 changed the title Add Sourcegraph Amp module feat: Sourcegraph Amp module Aug 2, 2025
@Harsh9485
Copy link
Author

@hugodutka @matifali @bpmct @DevelopmentCats
The test suite isn’t ready for review yet, but the Sourcegraph AMP module is working. Do I need to add a system prompt, or is it okay to skip it?

@Harsh9485
Copy link
Author

@hugodutka @matifali @bpmct @DevelopmentCats
The PR is ready for review.

@hugodutka
Copy link
Contributor

hey @Harsh9485, I haven't reviewed the PR yet, but before I do - agentapi does not officially support Sourcegraph AMP yet. It might just work out of the box, but we'd need to add Sourcegraph AMP-specific tests to https://github.com/coder/agentapi before merging this PR. Here's how to add them: coder/agentapi#32 (review)

@Harsh9485
Copy link
Author

we'd need to add Sourcegraph AMP-specific tests

Ah, so you’re saying I should be the one to add the tests? 😅

@Harsh9485
Copy link
Author

Hey @hugodutka,

I reviewed the PR and understood what the tests are meant for. They make sense for Gemini since it has a lot of repetitive text, but in the case of AMP, it uses a simpler design and doesn’t have repetitive text patterns that match the test structure.

@bpmct mentioned modifying coder/agentAPI if needed to support Sourcegraph AMP.
If these tests are really required, I’d be happy to add them.

Screenshot 2025-08-04 211913

@hugodutka
Copy link
Contributor

@Harsh9485 we do need the tests, the sourcegraph-amp agent type in agentapi, and a README update to mention it's supported. It should be a straightforward PR.

@Harsh9485
Copy link
Author

Okay @hugodutka, just give me a few hours, and I’ll open a PR shortly.

@hugodutka
Copy link
Contributor

@Harsh9485 I read through the PR briefly, nice work. All of our agent modules have support for the task prompt and system prompt parameters - we'd need them for AMP too. I'll do a full review once we have them.

@Harsh9485
Copy link
Author

@hugodutka, honestly, I don’t fully understand the use of the system prompt, but I referenced the Goose module and added support for it. If I made any mistakes, please let me know.

@hugodutka
Copy link
Contributor

hugodutka commented Aug 7, 2025

@Harsh9485 when you start a task that uses the Amp module via the Tasks tab in Coder, the prompt you write on that page should be executed by Amp. That prompt becomes the value of the AI Prompt parameter. I don't think this PR implements support for this.

@Harsh9485
Copy link
Author

@hugodutka you’re right — when I run the task with a prompt, the Coder server works fine. But on the other hand, the AMP module shows this error: sourcegraph-amp--main--task-pink-mammal-40--harsh9485--435hfav3elr36.pit-1.try.coder.app’s server IP address could not be found.

Screenshot 2025-08-08 121109

But by default, when I run the workspace, one task is automatically created with an empty prompt, and it works fine.

Screenshot 2025-08-08 123046

Any suggestions to solve it?

@hugodutka
Copy link
Contributor

@Harsh9485 change the web_app_slug on the agentapi module to "amp". You’re currently running into a DNS limitation around long hostname segments. See coder/coder#15178 for more details.

@Harsh9485
Copy link
Author

@Harsh9485 when you start a task that uses the Amp module via the Tasks tab in Coder, the prompt you write on that page should be executed by Amp. That prompt becomes the value of the AI Prompt parameter. I don't think this PR implements support for this.

@hugodutka you’re right — when I gave the prompt, the AMP module didn’t execute it. I’ll fix that as soon as possible.
Screenshot 2025-08-08 140041

@Harsh9485
Copy link
Author

@hugodutka, is it okay if I just initiate the task prompt with AgentAPI when it starts, similar to how Gemini did? -

if [ -n "$GEMINI_TASK_PROMPT" ]; then
printf "Running the task prompt %s\n" "$GEMINI_TASK_PROMPT"
PROMPT="Every step of the way, report tasks to Coder with proper descriptions and statuses. Your task at hand: $GEMINI_TASK_PROMPT"
GEMINI_ARGS=(--prompt-interactive "$PROMPT")
else
printf "No task prompt given.\n"
GEMINI_ARGS=()
fi
if [ -n "$GEMINI_API_KEY" ]; then
printf "gemini_api_key provided !\n"
else
printf "gemini_api_key not provided\n"
fi
# use low width to fit in the tasks UI sidebar. height is adjusted so that width x height ~= 80x1000 characters
# are visible in the terminal screen by default.
agentapi server --term-width 67 --term-height 1190 -- gemini "${GEMINI_ARGS[@]}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sourcegraph Amp Module
3 participants