Skip to content

[skip ci] fix: batch fixes for issues #2564, 2566, 2569, 2575, 2576, 2577, 2584, 2593, 2599, 2614#273

Closed
echobt wants to merge 1 commit intomasterfrom
fix/bounty-batch-2564-2614
Closed

[skip ci] fix: batch fixes for issues #2564, 2566, 2569, 2575, 2576, 2577, 2584, 2593, 2599, 2614#273
echobt wants to merge 1 commit intomasterfrom
fix/bounty-batch-2564-2614

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 27, 2026

Summary

Batch fix for multiple bounty issues.

Issues Fixed

Changes

Model Format Validation (#2564)

  • Added validate_model_format() function in cortex-common
  • Validates model strings and rejects invalid formats like invalid@format:tag and local://something
  • Only allows ollama:// protocol for local models

Debug Shell Subcommand (#2566)

  • Added cortex debug shell command to show shell environment information
  • Displays shell name, version, config file, terminal env vars, and path info

Prompts Command (#2569)

  • Added cortex prompts command with subcommands: list, show, add, remove
  • Allows users to manage saved prompts and templates

Ask and Query Aliases (#2575, #2576)

  • Added cortex ask as an alias for cortex run
  • Added cortex query as an alias for cortex run

Token Usage Display (#2577)

  • Added --show-usage flag to cortex run
  • Displays prompt tokens, completion tokens, and total tokens used
  • Includes usage in JSON output when requested

Context Limit Error (#2584)

  • Enhanced ContextWindowExceeded error to include token breakdown
  • Added fields for system_prompt_tokens, tool_definition_tokens, user_prompt_tokens

Line Mode Input (#2593)

  • Added --line-mode flag for processing stdin line-by-line
  • Added --delimiter option for custom line separators

Systemd Signal Handler (#2599)

  • Added proper SIGTERM handling to cortex serve
  • Uses run_with_shutdown for graceful shutdown under systemd

Hook Command (#2614)

  • Added cortex hook command with subcommands: list, install, uninstall, run
  • Allows management of git hooks integration

Note: CI skipped for cost control. Test manually before merge.

…, 2593, 2599, 2614 [skip ci]

Fixes:
- #2564: Add model format validation to reject invalid formats (e.g., invalid@format:tag, local://something)
- #2566: Add 'debug shell' subcommand for shell environment information
- #2569: Add 'prompts' command for managing saved prompts
- #2575: Add 'ask' command as alias for 'run'
- #2576: Add 'query' command as alias for 'run'
- #2577: Add --show-usage flag to display token usage information
- #2584: Enhance ContextWindowExceeded error with detailed token breakdown
- #2593: Add --line-mode flag for processing stdin line-by-line
- #2599: Add SIGTERM handler for graceful shutdown under systemd
- #2614: Add 'hook' command for git hooks integration
echobt pushed a commit that referenced this pull request Jan 27, 2026
## Issues Fixed

### From PR #271 (Issues #2430-2459):
- #2448: Validate URLs for control characters (security)
- #2449: Decode HTML entities in scraped URLs
- #2450: Reject reserved command names for agent names
- #2452: Expand tilde (~) in MCP server command paths
- #2459: Validate that model name is not empty

### From PR #273 (Issues #2564-2614):
- Model format validation improvements

### From PR #279 (Issues #2835-2903):
- #2835: Sandbox exit code preservation (always return original exit code)
- #2843: Empty session ID validation

## Changes

### Agent Creation (#2450)
- Added validation to reject reserved CLI command names as agent names
- Reserved names: help, version, run, exec, login, logout, mcp, agent, etc.

### Scrape Command (#2448, #2449)
- Added validate_url_security() to reject URLs with control characters
- Added decode_html_entities() to properly decode href attributes
- Added comprehensive tests for both functions

### MCP Command (#2452)
- Added tilde expansion in command paths (~/script.sh -> /home/user/script.sh)
- Also expands tilde in command arguments

### Model Validation (#2459)
- Added check for empty model name in TUI mode

### Sandbox (#2835)
- Changed exit behavior to always preserve original command exit code

### Session Handling (#2843)
- Added early validation for empty session IDs

Note: CI skipped for cost control. Test manually before merge.
echobt added a commit that referenced this pull request Jan 27, 2026
## Issues Fixed

### From PR #271 (Issues #2430-2459):
- #2448: Validate URLs for control characters (security)
- #2449: Decode HTML entities in scraped URLs
- #2450: Reject reserved command names for agent names
- #2452: Expand tilde (~) in MCP server command paths
- #2459: Validate that model name is not empty

### From PR #273 (Issues #2564-2614):
- Model format validation improvements

### From PR #279 (Issues #2835-2903):
- #2835: Sandbox exit code preservation (always return original exit code)
- #2843: Empty session ID validation

## Changes

### Agent Creation (#2450)
- Added validation to reject reserved CLI command names as agent names
- Reserved names: help, version, run, exec, login, logout, mcp, agent, etc.

### Scrape Command (#2448, #2449)
- Added validate_url_security() to reject URLs with control characters
- Added decode_html_entities() to properly decode href attributes
- Added comprehensive tests for both functions

### MCP Command (#2452)
- Added tilde expansion in command paths (~/script.sh -> /home/user/script.sh)
- Also expands tilde in command arguments

### Model Validation (#2459)
- Added check for empty model name in TUI mode

### Sandbox (#2835)
- Changed exit behavior to always preserve original command exit code

### Session Handling (#2843)
- Added early validation for empty session IDs

Note: CI skipped for cost control. Test manually before merge.

Co-authored-by: Droid Agent <droid@factory.ai>
@echobt echobt closed this in #366 Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant