SShortSingh.
Back to feed

Adrafinil keeps MacBooks awake with lid closed only while AI agents are running

0
·1 views

A developer has released Adrafinil, a free open-source macOS utility designed to prevent MacBooks from sleeping when the lid is closed, but only while an AI coding agent is actively running. The tool was built in response to a common workaround where engineers kept their laptop lids partially open in public spaces to avoid sleep interrupting long-running AI agent tasks. Unlike always-on tools such as Amphetamine, Adrafinil uses hooks into tools like Claude Code and Codex to detect agent activity and automatically re-enables sleep once the agent finishes. It uses the macOS pmset command to toggle sleep blocking and includes safety measures such as allowing sleep if the device overheats. The app is fully notarized, MIT-licensed, and displays its active status in the menu bar.

Read the full story at Hacker News

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
ProgrammingDEV Community ·

Developer Series Wraps Up Full RAG System Build Using Python, pgvector, and Gemini

A multi-part developer tutorial series on DEV Community has concluded, documenting the step-by-step construction of a complete Retrieval-Augmented Generation (RAG) system from scratch using Python. The project progressed from basic database setup with pgvector on PostgreSQL through document ingestion, cosine similarity search, and a full RAG pipeline, ultimately reaching multi-step agentic loops and Model Context Protocol (MCP) server deployments. Key technical decisions included capping Gemini embeddings at 768 dimensions to comply with pgvector's HNSW index limit, and using distinct task types for document storage versus query retrieval to preserve accuracy. The free tiers of Render and Supabase were used to host the MCP server and pgvector database respectively, with a specific connection pooler port required to bridge IPv6 compatibility issues. The author noted that evaluation frameworks, observability tooling, security hardening, LLMOps practices, and fine-tuning were intentionally left out of scope for future exploration.

0
ProgrammingDEV Community ·

Developer Builds Scaffold Tool to Auto-Generate Spring Boot Microservices

A developer has created a microservice generator tool called Scaffold, designed to automate the creation of new microservices. The tool is built around the Java and Spring Boot ecosystem, targeting backend developers looking to speed up project setup. The creator shared a walkthrough video demonstrating how the generator works in practice. The tool aims to improve developer productivity by reducing the repetitive boilerplate work typically involved in bootstrapping microservice projects.

0
ProgrammingDEV Community ·

Tutorial: How to Let an LLM Autonomously Decide When to Search in a RAG System

A new developer tutorial explains how to implement Tool Use in a Retrieval-Augmented Generation (RAG) pipeline, enabling a large language model to decide when and what to search rather than following a hardcoded retrieval flow. In traditional RAG setups, a search function is always called before generating an answer, but Tool Use allows the LLM to determine whether retrieval is necessary at all. The LLM is provided with descriptions of available functions and can respond with either a function call or a direct text answer based on its judgment. The tutorial uses Google's Gemini API alongside a PostgreSQL vector database, walking through a working Python implementation called 06_tool_basic.py. This approach improves response quality in cases where the user's question may already be answerable, or where multiple targeted searches with different queries would yield better results.

0
ProgrammingDEV Community ·

Why pgvector, 768 Dims, and Gemini Flash: RAG Design Decisions Unpacked

A technical breakdown of a Retrieval-Augmented Generation (RAG) pipeline explains the reasoning behind key architectural choices, including using pgvector over dedicated vector databases like Pinecone or Weaviate. The author chose pgvector because it integrates with existing PostgreSQL infrastructure, supports SQL and vector search in a single query, and handles millions of documents via HNSW indexing. Google's gemini-embedding-001 model was configured to output 768 dimensions instead of the default 3072, balancing retrieval quality with pgvector's 2000-dimension HNSW limit and storage efficiency. Separate task types — RETRIEVAL_DOCUMENT for ingestion and RETRIEVAL_QUERY for querying — were used to leverage the model's asymmetric training, which improves retrieval accuracy. The HNSW index was preferred over IVFFlat for its faster query speed and higher accuracy at scale, while Gemini 2.5 Flash was selected as the answer-generation model.

Adrafinil keeps MacBooks awake with lid closed only while AI agents are running · ShortSingh