Skip to content

fix(tui): complete absolute paths as paths - #19930

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
helix4u:fix/tui-absolute-path-completion
May 4, 2026
Merged

fix(tui): complete absolute paths as paths#19930
teknium1 merged 1 commit into
NousResearch:mainfrom
helix4u:fix/tui-absolute-path-completion

Conversation

@helix4u

@helix4u helix4u commented May 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a TUI completion routing bug where text beginning with an absolute path, such as /home/d/Desktop/file.md, could enter the slash-command completion path because completion checked only input.startsWith("/").

The submit path already has a stricter slash-command shape check, so this makes completion use the same distinction: real slash commands still use complete.slash, while absolute paths use complete.path.

Related Issue

No GitHub issue found. This came from a Discord support report where an absolute path typed at the start of the TUI prompt appeared to be eaten unless the user prefixed it with a space.

Searched for existing PRs/issues with:

  • prompt starting with / eaten
  • absolute path slash command eaten
  • looksLikeSlashCommand useCompletion
  • complete.slash absolute path

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Updated ui-tui/src/hooks/useCompletion.ts so completion uses looksLikeSlashCommand() instead of treating every leading / as a slash command.
  • Added completionRequestForInput() to keep the completion routing decision testable.
  • Added ui-tui/src/__tests__/useCompletion.test.ts covering slash commands, absolute-path-leading prompts, trailing absolute path tokens, and plain text.

How to Test

  1. cd ui-tui && npm run type-check
  2. cd ui-tui && npm test -- --run src/__tests__/useCompletion.test.ts src/__tests__/useComposerState.test.ts
  3. In the TUI, type an absolute path like /home/d/Desktop/agenda/CrimsonRed/.hermes/plans/2026-05-04-HANDOFF-NEXT.md and press Enter. It should be treated as prompt text/path input, not as a slash command.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Ubuntu/WSL with focused TUI type-check, focused Vitest coverage, and full Python suite attempt through scripts/run_tests.sh -n 4

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

cd ui-tui && npm run type-check passed.

cd ui-tui && npm test -- --run src/__tests__/useCompletion.test.ts src/__tests__/useComposerState.test.ts passed: 2 files, 13 tests.

scripts/run_tests.sh -n 4 failed:

51 failed, 19611 passed, 51 skipped, 222 warnings in 596.24s (0:09:56)

The full-suite failures are outside the files changed by this PR.

Full-suite failure list
FAILED tests/gateway/test_approve_deny_commands.py::TestBlockingApprovalE2E::test_blocking_approval_approve_once
FAILED tests/gateway/test_approve_deny_commands.py::TestBlockingApprovalE2E::test_blocking_approval_deny
FAILED tests/cron/test_cron_script.py::TestBuildJobPromptWithScript::test_script_empty_output_noted
FAILED tests/agent/test_auxiliary_client.py::TestGetTextAuxiliaryClient::test_custom_endpoint_uses_codex_wrapper_when_runtime_requests_responses_api
FAILED tests/gateway/test_config.py::TestLoadGatewayConfig::test_bridges_quoted_false_platform_enabled_from_config_yaml
FAILED tests/agent/test_bedrock_1m_context.py::TestBedrockContext1MBeta::test_build_anthropic_kwargs_includes_1m_for_bedrock_fastmode
FAILED tests/gateway/test_dingtalk.py::TestCardLifecycle::test_final_reply_finalizes_card
FAILED tests/gateway/test_dingtalk.py::TestCardLifecycle::test_intermediate_send_stays_streaming
FAILED tests/gateway/test_dingtalk.py::TestCardLifecycle::test_done_fires_only_when_reply_to_is_set
FAILED tests/gateway/test_dingtalk.py::TestCardLifecycle::test_edit_message_finalize_fires_done
FAILED tests/gateway/test_dingtalk.py::TestCardLifecycle::test_edit_message_finalize_false_tracks_sibling
FAILED tests/gateway/test_dingtalk.py::TestCardLifecycle::test_next_send_auto_closes_sibling_streaming_cards
FAILED tests/gateway/test_dingtalk.py::TestDingTalkAdapterAICards::test_send_uses_ai_card_if_configured
FAILED tests/gateway/test_discord_bot_filter.py::TestDiscordBotFilter::test_default_is_none
FAILED tests/gateway/test_api_server.py::TestAdapterInit::test_default_config
FAILED tests/gateway/test_discord_free_response.py::test_discord_free_channel_skips_auto_thread
FAILED tests/agent/test_curator.py::test_state_atomic_write_no_tmp_leftovers
FAILED tests/hermes_cli/test_gateway_service.py::TestSystemdServiceRefresh::test_run_gateway_refreshes_outdated_unit_on_boot
FAILED tests/hermes_cli/test_model_validation.py::TestValidateCodexAutoCorrection::test_very_different_name_falls_to_suggestions
FAILED tests/gateway/test_teams.py::TestTeamsSend::test_send_typing
FAILED tests/hermes_cli/test_backup.py::TestPreUpdateBackup::test_rotation_keeps_only_n
FAILED tests/hermes_cli/test_update_gateway_restart.py::TestCmdUpdateLaunchdRestart::test_update_restarts_profile_manual_gateways
FAILED tests/hermes_cli/test_update_gateway_restart.py::TestCmdUpdateLaunchdRestart::test_update_profile_manual_gateway_falls_back_to_sigterm
FAILED tests/hermes_cli/test_update_gateway_restart.py::TestServicePidExclusion::test_update_kills_manual_pid_but_not_service_pid
FAILED tests/hermes_cli/test_update_yes_flag.py::TestUpdateYesConfigMigration::test_no_yes_flag_still_prompts_in_tty
FAILED tests/hermes_cli/test_cmd_update.py::TestCmdUpdateBranchFallback::test_update_refreshes_repo_and_tui_node_dependencies
FAILED tests/run_agent/test_concurrent_interrupt.py::test_concurrent_interrupt_cancels_pending
FAILED tests/hermes_cli/test_update_yes_flag.py::TestUpdateYesStashRestore::test_yes_restores_stash_without_prompting
FAILED tests/run_agent/test_concurrent_interrupt.py::test_running_concurrent_worker_sees_is_interrupted
FAILED tests/test_tui_gateway_server.py::test_session_create_drops_pending_title_on_valueerror
FAILED tests/tools/test_browser_chromium_check.py::TestChromiumInstalled::test_false_when_dir_empty
FAILED tests/tools/test_browser_chromium_check.py::TestChromiumInstalled::test_false_when_only_unrelated_browsers
FAILED tests/tools/test_browser_chromium_check.py::TestChromiumInstalled::test_false_when_path_not_a_dir
FAILED tests/tools/test_browser_chromium_check.py::TestCheckBrowserRequirementsChromium::test_local_mode_missing_chromium_returns_false
FAILED tests/tools/test_browser_chromium_check.py::TestRunBrowserCommandChromiumGuard::test_local_mode_missing_chromium_returns_error_immediately
FAILED tests/tools/test_browser_chromium_check.py::TestRunBrowserCommandChromiumGuard::test_docker_hint_mentions_image_pull
FAILED tests/tools/test_browser_chromium_check.py::TestRunBrowserCommandChromiumGuard::test_non_docker_hint_mentions_agent_browser_install
FAILED tests/tools/test_credential_pool_env_fallback.py::TestCredentialPoolSeedsFromDotEnv::test_os_environ_still_wins_over_dotenv
FAILED tests/tools/test_daytona_environment.py::TestExecute::test_custom_cwd_in_command_wrapper
FAILED tests/tools/test_delegate.py::TestDelegationCredentialResolution::test_nous_provider_resolves_nous_credentials
FAILED tests/tools/test_delegate.py::TestDelegationCredentialResolution::test_provider_resolution_uses_runtime_model_when_config_model_missing
FAILED tests/tools/test_delegate.py::TestDelegationCredentialResolution::test_provider_resolves_full_credentials
FAILED tests/tools/test_delegate.py::TestDelegateHeartbeat::test_heartbeat_still_trips_idle_stale_when_no_tool
FAILED tests/tools/test_dockerfile_pid1_reaping.py::test_dockerfile_installs_tui_dependencies
FAILED tests/tools/test_dockerfile_pid1_reaping.py::test_dockerfile_materializes_local_tui_ink_package
FAILED tests/tools/test_skill_provenance.py::test_default_origin_is_foreground
FAILED tests/tools/test_tirith_security.py::TestDiskFailureMarker::test_cosign_missing_marker_clears_when_cosign_appears
FAILED tests/tools/test_vercel_sandbox_environment.py::TestExecute::test_execute_runs_command_from_workspace_root_and_updates_cwd
FAILED tests/tui_gateway/test_goal_command.py::test_goal_bare_shows_status_when_none_set
FAILED tests/tui_gateway/test_goal_command.py::test_goal_whitespace_only_shows_status
FAILED tests/tui_gateway/test_goal_command.py::test_goal_status_alias_shows_status

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels May 4, 2026
@helix4u
helix4u marked this pull request as ready for review May 4, 2026 22:56
@teknium1
teknium1 merged commit b816fd4 into NousResearch:main May 4, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants