SShortSingh.
Back to feed

Freeze Cursor Pagination Contracts Before AI Agents Write List Clients

0
·1 views

Coding agents frequently default to offset-based pagination patterns when generating list clients, even when an API uses opaque cursor pagination, leading to bugs that pass local tests but fail in staging. A recommended practice is to freeze a contract file and a golden response fixture in the repository before any client code is generated, ensuring the agent cannot rewrite the source of truth without breaking CI. The contract specifies forbidden query keys such as page, offset, and per_page, and enforces that next_cursor must always be treated as an opaque string or null, never parsed as JSON. A failing contract test acts as a gatekeeping mechanism, catching pagination drift before the client file even exists. The approach is intentionally minimal and repository-agnostic, designed to prevent agents from applying generic CRUD assumptions to APIs with strict pagination rules.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

RDLTR Launches as an Inbox-Zero Read-Later App to Replace Pocket and Rivals

A developer has released RDLTR, a read-later web app designed around an inbox-zero model where articles disappear from the queue once read but remain accessible in an archive. The project was inspired by frustration with tab clutter across multiple devices and the shutdown of Pocket, after alternatives like Instapaper and Raindrop failed to match the desired workflow. RDLTR supports URL pasting, drag-and-drop, browser extensions for Chrome and Firefox, a bookmarklet, and an iOS share sheet shortcut. Extensions offer additional features such as sending article text to AI tools like ChatGPT or Claude, and opening links via the Internet Archive to bypass paywalls. The app is built on Bun, TypeScript, HTMX, and SQLite, hosted on a Hetzner VPS, and is available at rdltr.app.

0
ProgrammingDEV Community ·

How question framing shifts which arguments AI models emphasize, not just tone

A developer ran an informal experiment last week testing how differently worded prompts affected responses from three AI assistants on the same underlying question. Using neutral, positively loaded, and negatively loaded versions of the same query, the tester found that framing influenced which considerations the model foregrounded, not merely the tone of its language. The neutral prompt surfaced a broader range of arguments, while loaded prompts led models to prioritize the side implied by the question, sometimes omitting key counterpoints entirely. This behavior is linked to how large language models are trained on human preferences, which can incentivize responses that align with a user's implied conclusion. The author warns that a model can appear balanced while still being directionally persuasive through selective emphasis and ordering of arguments.

0
ProgrammingDEV Community ·

How to Connect VS Code to a Remote JupyterLab Server on GeoLab

Developers can connect their local VS Code editor to a remote JupyterHub instance running on GeoLab, a 2i2c-managed Kubernetes platform hosted at geolab.earthscope.cloud. The setup requires the VS Code Jupyter extension and a running GeoLab server pod, from which users generate a tokenized public URL using a short Python script. This URL replaces the internal 0.0.0.0:8888 address with the public hub host and appends an authentication token, which must be kept private. Users paste the URL into VS Code's kernel picker under 'Existing Jupyter Server' to route notebook execution to the remote GeoLab pod rather than their local machine. Common issues include expired tokens, incorrect URL encoding of OAuth2 user IDs, and pod culling, all of which have documented workarounds in the guide.

0
ProgrammingDEV Community ·

How Solo Founders Can Build a Sustainable Customer Support System

Solo app founders often struggle not with high support volumes but with the lack of a structured system to handle recurring queries efficiently. Every support email serves as a valuable, free usability report, and resolving issues quickly can reduce churn and protect app ratings. Experts suggest setting a realistic response window — such as 24 hours on weekdays — and clearly communicating it to users, rather than creating unsustainable expectations by replying instantly at all hours. A practical setup includes a dedicated support inbox, two fixed daily response windows to protect deep work time, and saved reply templates for the most common questions. Building even a small knowledge base over time further reduces repetitive workload and turns support into a high-leverage growth tool for small apps.