Repository navigation
fix(shell): cd の存在しないパスで external_directory を要求しない - #60
Open
yukihamada wants to merge 1 commit into
Open
yukihamada wants to merge 1 commit into
yukihamada wants to merge 1 commit into
Conversation
存在しないパスへの cd はシェル内で失敗するだけで何にも触れないが、 パススキャンが親ディレクトリを外部扱いして / 全体の許可を求めていた。 あわせてタイトル生成の失敗を無音にせず警告ログに残す。
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Owner
Author
CI の unit 失敗について(既存の失敗)
今回の差分での検証
|
This branch has not been deployed
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.
内容
cd /privatのように存在しないディレクトリへ移動しようとすると、シェル内で失敗するだけなのにexternal_directoryの許可(/*)を要求していました。原因
packages/sente/src/tool/shell.tsのパススキャンが、対象がディレクトリでない場合にpath.dirname(resolved)を外部ディレクトリとして登録していました。cd /privatは/に解決されるため、ルート全体の許可要求になっていました。修正
cd系コマンド(CWD)で対象が実在するディレクトリでない場合は、スキャン対象に加えないようにしました。cd ../や外部の実在ディレクトリへの移動は従来どおり要求します。Effect.orDie+Effect.ignoreで完全に無音になっていたのを、警告ログに残すよう変更しました。既定タイトルのまま残る原因を追えるようにするためです。検証
does not ask for external_directory when cd targets a missing pathbun test test/tool/shell.test.ts test/session/title.test.ts→ 30 pass / 0 failbun typecheck→ 成功未確認
タイトルが「消える」現象そのものは、手元のログとDBでは再現できませんでした(
failed to generate titleは0件、直近20セッションはすべてタイトルあり)。生成失敗の可視化までを本PRの範囲としています。