You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c19f43c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(read): treat utf-8 pdf names as text and quote pdftotext (#1238)
* fix(read): lead file-inspection diagnosis with the cause
Collapsed tool rows clip to 72 characters, so a long path buried the
gap. The first sentence now names missing extractor, permission
boundary, or malformed file, and the message uses the call path.
* fix(read): treat utf-8 pdf names as text and quote pdftotext
A .pdf suffix without %PDF magic is only malformed when the first chunk
is binary. extractor_ready quotes the path so it pastes into bash.
* test(read): expect quoted call-path in extractor_ready diagnosis
@@ -76,25 +79,25 @@ export function diagnoseBlockedFileInspection(
76
79
return{
77
80
code: "unreadable",
78
81
message:
79
-
`Cannot inspect ${path}: the file is unreadable (filesystem permission denied), not a missing extractor or worker-tool gap. `+
80
-
`Check ownership and mode, or copy the file into a readable workspace path.`,
82
+
`Unreadable file (filesystem permission denied), not a missing extractor or worker-tool gap. `+
83
+
`Check ownership and mode, or copy it into a readable workspace path. File: ${path}`,
81
84
};
82
85
}
83
86
84
87
if(input.kind==="pdf-malformed"){
85
88
return{
86
89
code: "malformed",
87
90
message:
88
-
`Cannot inspect ${path}: the file is not a valid PDF (malformed or unreadable bytes), not a missing extractor or permission boundary. `+
89
-
`Open it in a PDF reader or re-export it, then retry.`,
91
+
`Malformed PDF, not a missing extractor or permission boundary. `+
92
+
`Open it in a PDF reader or re-export it. File: ${path}`,
90
93
};
91
94
}
92
95
93
96
if(input.kind==="binary"){
94
97
return{
95
98
code: "binary",
96
99
message:
97
-
`refusing to read binary file: ${path}. This is a binary file, not a missing-tool or permission failure. `+
100
+
`refusing to read binary file: ${path}. Not a missing-tool or permission failure. `+
98
101
`Use a format-specific extractor if you need text from it.`,
99
102
};
100
103
}
@@ -104,24 +107,22 @@ export function diagnoseBlockedFileInspection(
104
107
return{
105
108
code: "missing_extractor",
106
109
message:
107
-
`Cannot inspect PDF ${path}: ${extractor} is not installed (missing PDF-extraction capability), not a malformed file. `+
108
-
`Install poppler so ${extractor} is on PATH (for example \`brew install poppler\` or \`apt-get install poppler-utils\`), then retry.`,
110
+
`Missing PDF extractor: ${extractor} is not on PATH (capability gap), not a malformed file. `+
111
+
`Install poppler (\`brew install poppler\` or \`apt-get install poppler-utils\`), then retry. File: ${path}`,
109
112
};
110
113
}
111
114
112
115
if(!input.canExecuteHostCommands){
113
116
return{
114
117
code: "permission_boundary",
115
118
message:
116
-
`Cannot inspect PDF ${path}: ${extractor} is installed, but this worker cannot execute it (run_shell is not mounted — a permission boundary, not a malformed file). `+
117
-
`Re-dispatch to a director that mounts run_shell, or grant this worker run_shell, then retry.`,
119
+
`Permission boundary: ${extractor} is installed but this worker cannot execute it (run_shell is not mounted), not a malformed file. `+
120
+
`Re-dispatch to a director that mounts run_shell, or grant this worker run_shell. File: ${path}`,
118
121
};
119
122
}
120
123
121
124
return{
122
125
code: "extractor_ready",
123
-
message:
124
-
`Cannot inspect PDF ${path} as text via read_file. ${extractor} is installed and this session can run host commands. `+
125
-
`Run \`${extractor}${path} -\` via bash to extract text.`,
126
+
message: `read_file cannot decode PDFs. ${extractor} is installed — run \`${extractor}${shellQuote(path)} -\` via bash.`,
0 commit comments