Skip to content

fix: offer one-file approval for blocked terminal text-file links #23

Closed

Description

@johoja12

Clicking an external YAML/text file opens the floating log viewer. Its workspace restriction returns “Path must be within working directory or allowed log directories”, then EventSource reconnects and repeats the error while the status changes to connection error. There is no way to explicitly approve the clicked file.

For blocked absolute paths in Codex sessions, offer Allow this file once in the floating viewer and use the existing guarded file-URI preview resolver. Close the denied stream to avoid repeated permission errors, keep the blocked status visible, and retain backend sensitive-path/symlink/size/CSRF checks. A one-file approval must not widen the log-tail or directory allowlist. Test the click/approval flow and error handling in Chromium.

Activity

  1. johoja12 commented on Oct 26, 2026

    @johoja12
    OwnerAuthor

    Implemented on fix/23-blocked-file-approval, commit 02854212 (not pushed or deployed).

    The reported text/YAML link routes to the floating log viewer. That stream rejects paths outside the workspace/log roots and then EventSource reconnects, appending repeated errors and replacing the permission status with “connection error”.

    Changes:

    • A definitive path-denied SSE message closes that stream and leaves a stable permission needed status with a single error.
    • For an absolute path in a Codex session, show Allow this file once. Only the explicit click calls the existing file-URI resolver with allowUnlistedPath: true, bound to the original session, and opens the read-only attachment preview.
    • Encode URI segments correctly for spaces, # and literal %. No new directory allowance, tail permission or backend bypass. Existing sensitive-path, canonical-path, extension, size and CSRF checks stay in force.
    • Other session modes retain their access restrictions; this reuses the existing Codex-only resolver.

    Verification: 110 existing focused resolver/stream/security/UI tests passed; an additional backend YAML approval case passed (35 route cases including PNG/YAML). Three real Chromium scenarios passed: approved YAML preview, server rejection with no raw read, and no bypass offered for a non-Codex session. Verified one tail request across the reconnect interval, no override before clicking, originating session binding with a different active tab, encoded filename, read-only preview, and no page errors. Typecheck/lint/format/lockfile/frontend syntax/public assets/browser-exclusion checks passed.

    Artifacts: /tmp/codeman-23-blocked.png, /tmp/codeman-23-approved.png, /tmp/codeman-23-browser.log. Production unchanged. Issue stays open pending rollout.

  2. johoja12 commented on Oct 26, 2026

    @johoja12
    OwnerAuthor

    Merged, pushed and deployed via fork PR #24: bf6f0a1b12f2fa0095b6f71366c8a4ff44b31a77 on origin/local. Includes implementation 02854212 and fixture screenshots 2e96ff82. Package version remains 1.45.0 (no COM release requested).

    Upstream PR: Ark0N#720 — branch fix/log-viewer-file-approval, commit b3a56832, based on upstream/master. Upstream lacks the fork's URI resolver, so the minimal UI-only adaptation calls upstream's existing openFilePreview, which registers the selected file quietly through the guarded attachment API. It adds no new endpoint or directory policy. Three upstream browser cases and 69 relevant upstream stream/attachment/path-guard tests pass; static checks pass.

    Fork validation: 111 focused resolver/stream/security/UI cases (110 existing plus added YAML backend case), three Chromium approval/denial/originating-session scenarios, typecheck, lint, format, lockfile, frontend syntax, public assets and browser exclusion checks passed.

    Broader realistic smoke: feature branch and unchanged deployment baseline a3560f93 both produced exactly 110 pass / 2 fail / 1 unconfigured-remote skip. The same existing failures are shell viewport scroll-down returning to late history after reload and shell viewport scroll-up before a dashed divider. No browser page/serious-console errors. Both runs removed their four temporary sessions and stopped their isolated servers. This deployment does not address those existing scrolling failures.

    Production build passed; service active after restart at 2026-10-26 15:20:41 +04, /api/status HTTP 200. Fresh Chromium verification used the real w1-saif session and the reported file path against the real denied tail endpoint. The button appeared and permission status stayed stable. Approval and attachment responses were intercepted with fixtures to verify click, correct originating session/URI/explicit flag, and read-only YAML rendering without granting or reading the actual remote file. No page errors. Screenshots/logs: /tmp/codeman-23-prod-blocked.png, /tmp/codeman-23-prod-approved.png, /tmp/codeman-23-prod-probe.log.

    Users can refresh Codeman, reopen the file link, and click Allow this file once. The one-file resolver still rejects sensitive or otherwise forbidden files. At deployment verification, GitHub PR checks were pending; upstream PR remains open for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions