JetBrains Air
If you happen to’ve ever constructed backend providers in Go, chances are high you’ve additionally written a webhook handler or two. They’re small and infrequently get a lot consideration – that’s, till one thing breaks. A 3rd-party supplier sends a signed request, and then you definitely verify the signature, retailer the occasion, and reply. Appears like three simple steps, however lots can go mistaken. A captured request may get replayed, a replica may get saved twice, or a solid signature may slip by.
Coding brokers aren’t prone to make these kind of errors, so with code changing into cheaper to generate, handlers are an excellent job to offer them. They’ll additionally write handlers quicker than you may. However even with their suitability to the duty, it’s nonetheless on you to verify that they acquired the main points proper if you wish to keep away from points in manufacturing.
That’s the place JetBrains Air in IDEs is available in. It offers you one place to begin your most popular brokers, comply with their progress, and overview their work. On this article, we’ll construct a small webhook receiver, overview the adjustments and ship suggestions straight from the diff, after which run a number of follow-up duties in parallel, every in its personal worktree, that may all be merged collectively later. Lastly, we’ll confirm the mixed output with GoLand’s instruments, together with the HTTP consumer and database instruments. And to make issues simpler, we’ll let an agent profile the handler with our new profiling ability, goland-profiler.
Tag alongside to see tips on how to create a working service you personal and belief in a matter of minutes.
What we’re constructing
Our instance is a small service that receives signed, Stripe-style fee webhooks and shops every occasion simply as soon as. We begin with an empty Go module with nothing in it however a short, BRIEF.md, that brokers will use as a reference. You possibly can copy it from the demo repository: air-goland-demo.
These are the ideas of our mission:
- Commonplace library solely: Our mission makes use of
web/httpfor routing,log/slogfor logging, and an in-memory retailer, so the service runs with go run and wishes no additional setup. - One endpoint solely:
POST /webhooks/{supplier}accepts a JSON occasion and shops it as soon as by its ID. A brand new occasion will get202 Accepted, and a redelivery will get200 OK. - Signed requests: Each request carries a signature, and something with a lacking or invalid signature, or a timestamp older than 5 minutes, will get
401 Unauthorized.
Laying out the core ideas is one thing you don’t essentially wish to hand off to brokers right away, as a result of that’s the place you determine on the definition of “finished”. Additionally, as a result of a number of brokers will use it on the similar time, the temporary is what ties their work collectively. Naturally, the higher you scope your mission, the better it will likely be for the brokers to comply with alongside and make fewer errors.
First, we’ll ask an agent to construct the service from BRIEF.md – the shop, the handler, the signature verify, and fundamental.go. As soon as that’s in place, we’ll tackle three follow-up duties: an SQLite retailer, additional assessments for the signature verify, and a set of signed take a look at requests for GoLand’s HTTP consumer. Once we’re finished, the core of the service ought to resemble our demo repository – a reference model of the service you should utilize to check out our new Profiling ability (extra on that later). The reference retains solely the in-memory retailer, so it doesn’t embrace the SQLite retailer or the HOOKRELAY_DB setting your agent provides.

Getting began with Air in GoLand
In GoLand 2026.3, Air has change into the default AI workspace (changing AI Assistant), so there’s nothing to put in – you’ll see it on your own home display screen after you replace. You possibly can select which brokers you wish to work with, together with Junie, Codex, Claude Code, or another agent that helps the Agent Consumer Protocol (ACP).
There are 3 ways to begin a session:
- Agent widget: Click on the widget in the principle toolbar to begin a session together with your present preset, or click on the drop-down button subsequent to it to choose a unique agent.
- Agent Periods instrument window: Open it with View | Device Home windows | Agent Periods.
- World immediate: Press Ctrl twice anyplace within the IDE, kind your request, and press Enter. In case you have code chosen within the editor, it will likely be used as context.
Every session opens in its personal tab. You possibly can choose the mannequin, the hassle, and the entry stage (i.e. how a lot oversight the agent has). The primary time you ship a request, the agent might ask you to authorize it – together with your service account, JetBrains AI, or a supplier key you add underneath Settings | AI | Air | Accounts.
Launch your first agent job
First, we’re going handy off the core of the service to Codex. With a correctly outlined scope, one agent with a sufficiently sturdy mannequin ought to have the ability to construct this easy service with none main hiccups.
- Within the Agent Periods instrument window, click on the drop-down button subsequent to New Session and choose Codex.
- Choose a mannequin within the mannequin selector beneath the textual content area.
- Enter the immediate and press Enter.
Right here’s the immediate we used:
Construct the service described in BRIEF.md: an in-memory occasion retailer behind a Retailer interface in inner/retailer, the webhook handler in inner/webhook, signature verification as web/http middleware in inner/middleware, and a fundamental.go file that wires them collectively. Retailer every occasion as soon as by its ID, replying 202 Accepted for a brand new occasion and 200 OK for a replica, and log with log/slog. Add table-driven assessments and a benchmark for the handler.
Assessment adjustments
The simple half is finished. Now it’s time to make sense of what the agent produced and see if it’s finished every little thing proper.
When an agent finishes a flip, the session lists the recordsdata it modified, with added and eliminated strains, underneath Since final flip. Click on a file to open its diff, or click on Assessment to step by all of them. Since this session works straight in your mission, its adjustments additionally present up within the Commit instrument window (⌘Okay). For periods that run in a worktree, which we’ll get to shortly, Worktree Modifications within the session header reveals every little thing the agent has modified in comparison with the bottom department.

Fortunately sufficient, webhook receivers fail in fairly predictable methods. That is the place your precise expertise as a developer is useful. As an alternative of studying the diff high to backside, you may verify it towards a brief checklist of identified offenders:
- Fixed-time comparability: Signatures ought to be in contrast with
hmac.Equal. A plain==orbytes.Equalreturns on the first mismatched byte, which might leak how a lot of a solid signature was proper. - Uncooked physique: The HMAC has to cowl the timestamp and the physique precisely because it arrived, not a re-encoded model of the parsed JSON.
- Replay window: Stale timestamps ought to be rejected, or a captured request will be replayed indefinitely.
- Dimension restrict: With out
http.MaxBytesReader, a consumer can ship a physique of any measurement, and the service will learn all of it. - Learn as soon as: If the middleware reads
r.Physiqueto verify the signature, it has to place it again for the handler. - Idempotent replies: Suppliers retry something that doesn’t get a 2xx response, so duplicates – together with one which loses a race to be saved – ought to get
200 OK. - Quiet errors: Error responses ought to carry a brief, fastened message, whereas the main points go to the logs. We lined this in our information to safe error dealing with in Go.
Give suggestions within the diff
If you happen to discover any errors, you may describe every change you need within the chat, but it surely’s faster and leaves much less room for error to level the agent on the proper line of code as a substitute. Within the diff, click on the chat icon within the gutter subsequent to a line or number of strains, kind your be aware, and click on Add Notice or press Enter. You may also depart a number of notes and ship them collectively.

When you ship the message, the notes keep hooked up to it as a read-only report of what you requested for. The agent picks up from there, and its subsequent Since final flip checklist reveals solely what modified since then.
While you’re pleased with the outcomes, commit them from the Commit instrument window (⌘Okay). This might be our start line for subsequent duties.
Run extra duties in parallel
Usually, you’d in all probability full the duties that we’ll work on in a sequence. However since they don’t actually depend upon one another, you may hand them out to brokers all on the similar time and overview the adjustments as they arrive in. We’re going to create:
- SQLite retailer: A persistent retailer behind the prevailing
Retailerinterface. - Checks for the replay window: Proof that the signature middleware rejects requests which are greater than 5 minutes previous.
- Signed take a look at requests: A approach to strive the entire service from GoLand’s HTTP consumer.
We are going to work with worktrees, in order that brokers don’t get in one another’s means. Right here’s tips on how to set them up:
- Within the Agent Periods instrument window, click on the drop-down button subsequent to New Session and choose the agent.
- Open the run mode checklist within the toolbar above the textual content area and choose New Native Worktree. The session will get its personal Git worktree and a department.
- Within the department checklist subsequent to the mission identify, select the department together with your first commit as the bottom.
- Choose a mannequin within the mannequin selector beneath the textual content area.
- Enter the immediate and press Enter.
We’re going to offer the SQLite retailer to Claude with this immediate:
Add an SQLite implementation of the Retailer interface in inner/retailer, utilizing the pure-Go driver modernc.org/sqlite, so the service nonetheless runs with go run. Make the occasion ID the first key, so a replica insert returns the identical error because the in-memory retailer. In fundamental.go, use SQLite when HOOKRELAY_DB is ready to a file path, and maintain the in-memory retailer because the default. Add table-driven assessments towards a short lived database. The motive force is the one exception to the temporary’s standard-library rule.
The opposite two duties are fairly routine, in order that they’re an excellent match for Junie Lite – our coding agent with a cost-efficient mannequin for on a regular basis duties that works together with your JetBrains Account. Listed below are the prompts:
Add table-driven assessments for the signature middleware in inner/middleware to verify {that a} request is rejected with 401 Unauthorized when its timestamp is greater than 5 minutes previous, and accepted when it’s simply contained in the window. Solely change take a look at recordsdata.
Create requests/webhooks.http for GoLand’s HTTP consumer with three requests to POST {{host}}/webhooks/stripe: a sound occasion, the identical occasion despatched once more, and an occasion with a foul signature. Signal the primary two in a pre-request script, as described in BRIEF.md. In a dev setting, put the host in requests/http-client.env.json and the key in requests/http-client.non-public.env.json. Give every request a response verify for the standing code the temporary expects.
All three brokers now work aspect by aspect, every in its personal worktree. The Agent Periods instrument window reveals which periods are In Progress, which want your enter, and which have completed with outcomes you haven’t checked out but, so there’s no have to maintain clicking by tabs to verify. If you happen to activate Time and Price underneath the Filter icon, you can too see how lengthy every session has been working and what it has price up to now.
If an agent wants a choice from you – like permission to run go take a look at – its session is marked as ready for enter, and you’ll reply proper in its tab. You may also queue follow-up prompts whereas an agent is busy. They’re despatched as quickly because it finishes its present flip.
Tie all of it collectively
Every of the brand new additions has solely been examined by itself – the SQLite retailer towards a short lived file and the brand new assessments towards the middleware, whereas the take a look at requests haven’t been despatched anyplace but. So now that we wish to mix the branches, it’s time to verify the entire thing.
First, you wish to overview every worktree the identical means you probably did the unique service: Assessment the adjustments and depart notes within the diff.
Be conscious that take a look at requests need to signal precisely what the middleware checks, making certain that the identical string with the identical secret in the identical header format. The key belongs within the http-client.non-public.env.json, not within the shared setting file or the script.
When you’re pleased with the outcomes, you may deliver these three branches collectively:
- In your mission, try the department the work ought to land on. Air cherry-picks onto whichever department is at the moment checked out, not the worktree’s base department.
- In every session’s header, click on the drop-down button subsequent to Commit, choose Commit, and cherry-pick all.

Ship the take a look at requests
The non-public setting file is in .gitignore, so Junie Lite’s copy stayed behind in its worktree. Create your personal in requests/http-client.non-public.env.json:
{"dev": {"secret": "dev-secret"}}
Subsequent, begin the service with SQLite: Open the run configuration for fundamental.go (Run | Edit), add HOOKRELAY_DB=hookrelay.db underneath Atmosphere, and run it. Then open requests/webhooks.http, choose dev within the Run with checklist, and click on Run All Requests in File.

A pre-request script indicators every request earlier than it’s despatched, and a response verify after every one compares the standing code with what the temporary expects. Which means you don’t need to learn the responses your self – the Checks tab of the Providers instrument window lists every verify as handed or failed.
Examine the database
The database tells you what the HTTP consumer saved. Open the Database instrument window, click on +, select Knowledge Supply | SQLite, and level it at hookrelay.db within the mission folder. GoLand might provide to obtain the SQLite driver first. Subsequent, open the occasions desk, or run a fast question within the question console (regulate the desk and column names to no matter your agent selected):
SELECT id, COUNT(*) FROM occasions GROUP BY id;
The legitimate occasion and its duplicate ought to depart one row between them. Because the database retains its information between runs, delete hookrelay.db earlier than you ship the requests once more, or the legitimate occasion turns into a replica and its verify fails.

Let an agent profile the handler
Voilà! Our brokers’ service works, however for now, nothing tells us the way it behaves underneath load. Webhooks are likely to arrive in bursts – after an outage, for instance, when a supplier redelivers its entire backlog without delay – so a sluggish handler is greater than a theoretical downside. Usually, that is the place you’d attain for the profiler. With GoLand 2026.3, you may hand that job to an agent, too.
To exhibit the profiling ability on an precise downside, we’ll swap to a reference model of this service that yow will discover on GitHub. It’s a completed receiver constructed to the identical temporary, with one distinction: We’ve left a efficiency downside in it on function, so you may repeat each step beneath by yourself machine.
The place abilities may help
A ability is a set of directions that teaches an agent tips on how to deal with a particular kind of job. By itself, an agent can solely work with what it sees from the skin: It reads the code, runs instructions, and parses their output. GoLand’s abilities join supported brokers to the IDE’s personal instruments in order that the brokers can use them extra successfully, permitting the brokers to know which profile to take, tips on how to learn it, and tips on how to inform whether or not a repair really labored.
The goland-profiler ability is bundled with Air and works with Claude Code, Codex, and Junie. These brokers can run your utility with GoLand’s profiler, report a CPU profile whereas it handles visitors, and browse its scorching paths and line-level hints. Because of the ability, there’s nothing to arrange – the agent hundreds the ability when a job requires it, or you may connect it explicitly by typing / within the immediate or by clicking Add and selecting Expertise.

Methods to use it
To check out the ability, open the demo repo in GoLand and keep on its fundamental department. The service wants visitors to profile, so the repo comes with a small load generator that sends signed occasions for 30 seconds. Begin a brand new session with this immediate:
Run the service with /goland-profiler and report a CPU profile whereas go run ./cmd/loadgen sends it visitors. Inform me the place the handler spends its CPU time and reminiscence, and what you’ll change. Don’t edit any code but.
We recommend asking for a prognosis first to be able to verify the agent’s studying of the profile earlier than it acts, and determine what you wish to change primarily based on proof.
The agent begins the service with the profiler, information CPU whereas the load generator runs, reads the new paths, and comes again with the offender: validateEventID compiles its common expression on each name. In our run, validateEventID accounted for 69% of the CPU use, with regexp.MustCompile being the most well liked name. The allocation churn was conserving the rubbish collector busy on high of that.
You don’t need to take the agent’s phrase for it, although. The profile it captured is an abnormal Go profile, so you may open it within the Go Optimization instrument window and take a look at the flame graph your self, the place regexp.MustCompile sits proper underneath validateEventID and takes up a lot of the handler’s width.
The repair is fairly easy: Compile the sample as soon as, on the package deal stage, as a substitute of compiling on each request.
// Earlier than: the sample is compiled on each name
func validateEventID(id string) error {
var eventIDPattern = regexp.MustCompile("^evt_[A-Za-z0-9]{24}$")
if !eventIDPattern.MatchString(id) {
return fmt.Errorf("invalid occasion id %q", id)
}
return nil
}
// After: the sample is compiled as soon as, when the package deal is initialized
var eventIDPattern = regexp.MustCompile("^evt_[A-Za-z0-9]{24}$")
func validateEventID(id string) error {
if !eventIDPattern.MatchString(id) {
return fmt.Errorf("invalid occasion id %q", id)
}
return nil
}
Sharing one compiled sample throughout all requests is protected on this case, since a *regexp.Regexp can be utilized by a number of goroutines on the similar time, but it surely’s value confirming first earlier than you let your agent run unfastened. We requested the agent to use the repair and profile the service once more underneath the identical load. To place numbers on the distinction, we additionally ran BenchmarkHandler earlier than and after.
| Earlier than | After | |
| Time per request | 13,141 ns | 2,748 ns |
| Bytes per request | 16.4 KB | 6.7 KB |
| Allocations per request | 126 | 25 |
After the change, the benchmark is about 4.6 instances quicker with 59% fewer bytes and 80% fewer allocations per request. Occasions will fluctuate by machine, however the drop in bytes and allocations ought to be about the identical.
Attempt it your self
You possibly can repeat this train by yourself machine to play with the ability. The repository has two branches:
fundamental: a completed service with a planted sluggish occasion ID validation.fastened(use for reference): the identical service with the common expression compiled as soon as.
To strive it out:
- Clone the repository and open it in GoLand 2026.3. You’ll want Go 1.27.3 or later.
- Begin an Air session with Claude Code, Codex, or Junie.
- Ask the agent to profile the working service – you should utilize the immediate from the earlier part.
- As soon as the agent has utilized its repair, evaluate your working copy with ours by working
git diff origin/fastened, or view our repair by itself withgit diff origin/fundamental origin/fastened.
Your agent’s repair doesn’t need to match ours line for line. But it surely ought to maintain up towards the identical checks: The assessments go, and the brand new profile not has common expression compilation on the high.
Run the ultimate checks earlier than you merge
Whether or not you’re merging the service or the profiling repair, run the checks one final time on the ultimate code. Then, reset the shop and run webhooks.http once more so the primary request is a brand new occasion, and restart the service if it makes use of the in-memory retailer or delete hookrelay.db if it makes use of SQLite. If every little thing checks out, commit from the Commit instrument window (⌘Okay) and merge the department. A pull request is all the time an excellent place for a human to have a look at the adjustments – particularly ones the place three brokers had been within the driver’s seat.
Code the best way you need
AI has modified the coding recreation to the purpose that it’s not a query of whether or not you employ brokers, however how you employ them. At JetBrains we assist all of your workflows. Whether or not it’s within the IDE or the terminal, whether or not you employ brokers for small duties or orchestrating complete providers, whether or not you YOLO your means by or meticulously verify each change, Air is there that will help you with the one factor that hasn’t modified: your possession of your code.
This fast demo solely scratches the floor of what Air in IDEs can do, but it surely’s an excellent start line to discover extra. Tell us how you want this new addition to your IDE and what options we should always demo subsequent. And maintain an eye fixed out for extra tutorials and abilities within the coming months.
Glad coding,
The GoLand workforce

