Skip to content

feat(neon): add read-only Neon integration and a neon remote-sync provider - #6987

Merged
muddlebee merged 2 commits into
Tracer-Cloud:mainfrom
rishi-raj-jain:main
Nov 5, 2026
Merged

muddlebee merged 2 commits into
Tracer-Cloud:mainfrom
rishi-raj-jain:main

Conversation

@rishi-raj-jain

@rishi-raj-jain rishi-raj-jain commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #

NA

Describe the changes you have made in this PR

Adds a read-only Neon integration (Neon API) and a neon backend for remote sync on Neon Object Storage, modeled on the existing Vercel and Supabase integrations and the s3compat remote-sync provider.

Postgres diagnostics on Neon need no new code. The existing postgresql integration works against a Neon compute (verified: server status, current queries, locks, replication, table stats, slow queries). Two gotchas are documented on the Neon page:

  • It must use the direct host. The pooled -pooler host rejects the connection because the integration sets statement_timeout as a startup option, which Neon's PgBouncer does not accept. I left the shared Postgres integration unchanged. Moving the timeout to a SET after connect would make pooled hosts work for every PgBouncer-fronted provider, and can be a follow-up if maintainers want it.
  • Slow queries only need CREATE EXTENSION pg_stat_statements;, since Neon preloads the library.

Demo/Screenshot for feature changes and bug fixes

Run against a real Neon project (opensre-neon-test, aws-us-east-2):

$ opensre integrations verify neon
SERVICE │ SOURCE    │ STATUS   │ DETAIL
━━━━━━━━┿━━━━━━━━━━━┿━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
neon    │ local env │ ✓ passed │ Connected to Neon project opensre-neon-test
        │           │          │ (little-lab-10567887, aws-us-east-2).

$ NEON_API_KEY=wrong opensre integrations verify neon
neon    │ local env │ ✗ failed │ Neon rejected the API key (HTTP 401).

get_neon_storage_buckets through the normal tool executor (execute_tools with env-resolved integrations):

{"source": "neon", "available": true, "branch_id": "br-summer-art-bdbz1xg2",
 "storage_enabled": true,
 "s3_endpoint": "https://br-summer-art-bdbz1xg2.storage.c-8.us-east-2.aws.neon.tech",
 "region": "us-east-2", "total_buckets": 2,
 "buckets": [{"name": "incident-artifacts", "access_level": "private"},
             {"name": "public-assets", "access_level": "public_read"}],
 "public_buckets": ["public-assets"]}

A model call to list_neon_storage_objects that also passes project_id is refused by the executor (got unexpected args: api_key, project_id), and the API key never appears in any tool output.

Remote sync between two separate OPENSRE_HOMEs through one Neon bucket (files included a name with a space, + and unicode, and a 2 MB binary):

$ OPENSRE_REMOTE_SYNC_PROVIDER=neon OPENSRE_REMOTE_SYNC_BUCKET=incident-artifacts opensre remote-sync status
Remote sync is on (neon) → incident-artifacts/opensre-e2e
Bucket access: private.

$ OPENSRE_HOME=machine1 opensre remote-sync sync
Sync complete — 0 downloaded, 3 uploaded (1.9 MiB), 0 already current (1.9 MiB total).
$ OPENSRE_HOME=machine2 opensre remote-sync sync
Sync complete — 3 downloaded (1.9 MiB), 0 uploaded, 3 already current (1.9 MiB total).
$ diff -r machine1 machine2   # no output: identical. An edit on machine2 then synced back to machine1

$ unset AWS_ENDPOINT_URL_S3; opensre remote-sync sync
Sync failed: Neon remote sync needs the branch's storage endpoint. Run `neon env pull` to set AWS_ENDPOINT_URL_S3, or set OPENSRE_REMOTE_SYNC_ENDPOINT_URL to the s3_endpoint shown by `neon api /projects/<project_id>/branches/<branch_id>/storage`.

$ OPENSRE_REMOTE_SYNC_BUCKET=public-assets opensre remote-sync status
Remote sync is on (neon) → public-assets/opensre-e2e
WARNING: this store is publicly readable. Anyone on the internet can read your synced sessions and memory — restrict its access now.

Also checked against the real project: OPENSRE_REMOTE_SYNC_ENDPOINT_URL wins over AWS_ENDPOINT_URL_S3, AWS_ENDPOINT_URL is used as a fallback, region us-east-1, auto and unset all work, settings saved with opensre remote-sync setup --provider neon (including endpoint_url in config.yml) work, and a missing bucket reports NoSuchBucket.

Local validation: .github/ci/run_checks.py --group all passes 8/8 (lint, format, imports, integration-registry, tool-registry, types, tool-contracts, global-contracts). Focused tests: tests/integrations tests/filestorage tests/config tests/tools/test_registry.py tests/tools/test_telemetry.py tests/cli/test_integrations.py all pass except tests/integrations/llm_cli/test_codex_hosted_request_shape.py::test_hosted_codex_posts_only_function_tools, which fails the same way on unmodified main in my environment.


Code Understanding and AI Usage

Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code?

  • No, I wrote all the code myself
  • Yes, I used AI assistance (continue below)

If you used AI assistance:

  • I have reviewed every single line of the AI-generated code
  • I can explain the purpose and logic of each function/component I added
  • I have tested edge cases and understand how the code handles them
  • I have modified the AI output to follow this project's coding standards and conventions

Explain your implementation approach:

The problem: during a Postgres incident on Neon, the first questions are about the platform, not the SQL. Is the compute idle or disabled, did a restart or branch operation fail, which branch is the app on, and did the expected files land in storage. None of that is visible from a Postgres connection, so the integration reads the Neon API.

I captured real payloads for every endpoint used (project, branches, endpoints, operations, branch storage, buckets, objects) before writing the parsers, and the test fixtures are those payloads plus a failed operation and a second branch to cover the incident paths.


Checklist before requesting a review

  • I have added proper PR title and linked to the issue
  • I have performed a self-review of my code
  • I can explain the purpose of every function, class, and logic block I added
  • I understand why my changes work and have tested them thoroughly
  • I have considered potential edge cases and how my code handles them
  • If it is a core feature, I have added thorough tests
  • My code follows the project's style guidelines and conventions

Note: Please check Allow edits from maintainers if you would like us to assist in the PR.

Misc

I'm a contractor at Neon.

@mintlify

mintlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 3e5d70a.

Approve preview

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Greptile code review

This repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md.

Run a review — add a PR comment with:

@greptile review

Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5.

Optional: automate with the greploop skill.

@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; the compute-count fix addresses the previous finding.

Summary

Adds read-only Neon project and storage tools, plus a Neon Object Storage backend for remote sync.

  • Neon tools show project health and branch storage details.
  • Remote sync can store sessions and memory in Neon buckets.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Configured Neon integration] --> B[Read-only Neon tools]
  B --> C[Neon API]
  C --> D[Project and storage evidence]
  E[Remote sync] --> F[Required branch endpoint]
  F --> G[Neon Object Storage]
Loading

Reviews (2) · Last reviewed commit: "fix(neon): count every compute in projec..." · Reviewed by Greptile

@muddlebee

Copy link
Copy Markdown
Collaborator

hey @rishi-raj-jain thank you for the PR, I think I remember you from Polar.sh :) Glad to see you here 🙌

@muddlebee
muddlebee merged commit 92ec478 into Tracer-Cloud:main Nov 5, 2026
35 checks passed
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🍕 rishi-raj-jain's PR: crispy edges, no unnecessary toppings, delivered on time. Understood the assignment. 🔥


👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome.

@rishi-raj-jain

Copy link
Copy Markdown
Contributor Author

hey @rishi-raj-jain thank you for the PR, I think I remember you from Polar.sh :) Glad to see you here 🙌

Yes, me too! Thank you for the quick merge ❤️

Wish you continued success 🙌🏼

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.

2 participants