fix: add dry-run discoverability safe repair - #3048
Merged
1 commit merged intoMay 28, 2026
Merged
1 commit merged into
1 commit merged into
Conversation
6267716
Collaborator
|
Shipped in v0.51.154 / Release DZ (stage-batch36, commit 6267716). Thanks for the contribution! |
ai-ag2026
pushed a commit
to ai-ag2026/hermes-webui
that referenced
this pull request
May 28, 2026
# Conflicts: # CHANGELOG.md
ai-ag2026
pushed a commit
to ai-ag2026/hermes-webui
that referenced
this pull request
May 28, 2026
9-PR medium-risk cleanup: - nesquena#3037 routes.py: argv-style prefill hook + env-var override for notes drawer - nesquena#3046 models.py: compression parent not repaired as stale interrupted turn - nesquena#3048 session_discoverability.py: --repair-safe CLI with default dry-run - nesquena#3053 ui.js: streaming KaTeX guard for parser-owned equations - nesquena#3059 models.py: empty partial activity rows excluded from sidebar recency - nesquena#3060 profiles.py: API key writes to .env (chmod 600), not config.yaml - nesquena#3064 routes.py: MEDIA: image tokens allow exact session-referenced paths - nesquena#3069 models.py: cron sessions with project_id surface via Cron Jobs chip - nesquena#3077 gateway_chat.py: HTTP 401 maps to gateway_auth_error event
SysAdminDoc
pushed a commit
to SysAdminDoc/hermes-webui
that referenced
this pull request
Jun 26, 2026
# Conflicts: # CHANGELOG.md
SysAdminDoc
pushed a commit
to SysAdminDoc/hermes-webui
that referenced
this pull request
Jun 26, 2026
9-PR medium-risk cleanup: - nesquena#3037 routes.py: argv-style prefill hook + env-var override for notes drawer - nesquena#3046 models.py: compression parent not repaired as stale interrupted turn - nesquena#3048 session_discoverability.py: --repair-safe CLI with default dry-run - nesquena#3053 ui.js: streaming KaTeX guard for parser-owned equations - nesquena#3059 models.py: empty partial activity rows excluded from sidebar recency - nesquena#3060 profiles.py: API key writes to .env (chmod 600), not config.yaml - nesquena#3064 routes.py: MEDIA: image tokens allow exact session-referenced paths - nesquena#3069 models.py: cron sessions with project_id surface via Cron Jobs chip - nesquena#3077 gateway_chat.py: HTTP 401 maps to gateway_auth_error event
bernyforce
pushed a commit
to bernyforce/hermes-webui
that referenced
this pull request
Jul 29, 2026
# Conflicts: # CHANGELOG.md
bernyforce
pushed a commit
to bernyforce/hermes-webui
that referenced
this pull request
Jul 29, 2026
9-PR medium-risk cleanup: - nesquena#3037 routes.py: argv-style prefill hook + env-var override for notes drawer - nesquena#3046 models.py: compression parent not repaired as stale interrupted turn - nesquena#3048 session_discoverability.py: --repair-safe CLI with default dry-run - nesquena#3053 ui.js: streaming KaTeX guard for parser-owned equations - nesquena#3059 models.py: empty partial activity rows excluded from sidebar recency - nesquena#3060 profiles.py: API key writes to .env (chmod 600), not config.yaml - nesquena#3064 routes.py: MEDIA: image tokens allow exact session-referenced paths - nesquena#3069 models.py: cron sessions with project_id surface via Cron Jobs chip - nesquena#3077 gateway_chat.py: HTTP 401 maps to gateway_auth_error event
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.
Thinking Path
The discoverability audit is intentionally read-only, but its findings identified two deterministic cleanup classes: stale persisted WebUI-as-CLI flags and WebUI-origin
state.dbrows with messages but no sidecar/index entry. Operators need a safe routine that plans those repairs by default and only mutates state with an explicit backup directory.What Changed
repair_session_discoverability()with default dry-run behavior.backup_dirfor apply mode.is_cli_session=truefrom WebUI sidecars and_index.jsonentries.state.dbrows into sidecars and index metadata using the existing state-db sidecar conversion path.python -m api.session_discoverability --repair-safeas a dry-run CLI;--apply --backup-dir <dir>is required for mutation.Why It Matters
This turns the audit's actionable but operator-heavy follow-up into a controlled routine. It still defaults to no mutation, so users can inspect the plan before touching session files or
state.db-derived recovery state.Contract Routing
Task type: runtime/session metadata repair tooling.
Touched areas:
api.session_discoverability, session sidecars,_index.json, state-db-derived sidecar materialization.Relevant public docs:
AGENTS.mdCONTRIBUTING.mddocs/CONTRACTS.mddocs/rfcs/webui-run-state-consistency-contract.mdScope boundaries: no live repair route, no automatic startup repair, no deletion/archive of unsafe rows, no service restart.
Evidence needed before claiming done: regression tests for dry-run/apply gates plus adjacent recovery/discoverability tests.
Verification
python3 -m pytest tests/test_session_discoverability_repair.py -qpython3 -m pytest tests/test_session_discoverability_repair.py tests/test_session_discoverability_audit.py tests/test_session_recovery_api.py -qpython3 -m pytest tests/test_session_discoverability_repair.py tests/test_session_discoverability_audit.py tests/test_session_recovery_api.py tests/test_session_db_sidecar_reconciliation.py -qpython3 -m py_compile api/session_discoverability.py api/session_recovery.py0hitsRisks / Follow-ups
--applymode and only with backups.state_db_messageful_missing_sidecarmaterialization is intentionally limited to WebUI-origin rows with messages; empty/orphan rows remain manual-review territory.Model Used
AI-assisted by OpenAI Codex GPT-5.5 via Hermes/TARS, using local tests and git/GitHub CLI tooling.