feat: streaming responses, inactivity timeout, and per-project permission levels#1
Merged
vinicius1209 merged 1 commit intomainfrom Mar 11, 2026
Merged
Conversation
…sion levels Streaming responses: - Add chatStream() to CLIAdapter interface (optional, backwards-compatible) - Claude adapter streams via --output-format stream-json with incremental parsing - Gemini adapter streams via stdout with delta calculation - spawnCLIStreaming utility with buffered onChunk callbacks and minChunkSize Inactivity timeout (replaces hard wall-clock timeout): - Process is killed only if no stdout/stderr output for inactivity_timeout seconds (default: 300s) - Timer resets on every data event, allowing long-running agent tasks to complete - Hard stream_timeout (default: 3600s) acts as safety net for runaway processes - Fixes timeout issues with complex agent workflows (e.g., spec-driven development) Per-project permission levels: - New permission_level field: "readonly" (default), "read-write", "full" - Adapter-aware tool mapping via src/adapters/permissions.ts: - Claude: Read,Glob,Grep -> +Write,Edit,MultiEdit -> +Bash,Agent,WebFetch... - Gemini: ReadFileTool,GlobTool,GrepTool -> +WriteFileTool,EditTool -> +ShellTool... - Full mode passes --dangerously-skip-permissions (Claude) / --yolo (Gemini) - Advanced overrides: allowed_tools and skip_permissions per project - Setup wizard (devbridge init) now asks permission level per project (step 5/5) Other improvements: - Log rotation: auto-rotates at 10MB, keeps 5 archived files - Router refactored: extracted sendWithStreaming/sendWithoutStreaming helpers - Improved observability: message duration, response length, user info in logs - Updated docs: configuration.md, security.md, adapters.md, README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chatStream()— Claude usesstream-json, Gemini uses stdout streaming. Both adapters support buffered chunk callbacks with configurableminChunkSize./featureworkflows). The process now stays alive as long as it produces output, and is only killed afterinactivity_timeoutseconds (default 300s) of silence. A hardstream_timeout(default 3600s) acts as a safety net.permission_levelconfig (readonly,read-write,full) with adapter-aware tool mapping. Claude gets--dangerously-skip-permissionsand Gemini gets--yolowhen needed. Supports advancedallowed_toolsandskip_permissionsoverrides per project.devbridge initasks permission level per project.Permission Levels
readonly(default)Read,Glob,GrepReadFileTool,GlobTool,GrepToolread-writeWrite,Edit,MultiEditWriteFileTool,EditToolfullBash,Agent,WebFetch,WebSearch,NotebookEditShellTool,WebFetchTool,WebSearchToolConfig Example
{ "projects": { "my-app": { "path": "/path/to/project", "adapter": "claude", "permission_level": "full" } }, "defaults": { "stream_timeout": 3600, "inactivity_timeout": 300 } }Test plan
/featureprompt via Telegram and verify no timeout while Claude is actively workingreadonlyproject blocks write operationsfullproject allows file creation without permission promptsdevbridge initwizard asks permission level per project