Add redacted session handoff exports#108
Merged
Merged
Conversation
There was a problem hiding this comment.
2 issues found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/codex-claw/src/server/session-bundle.ts">
<violation number="1" location="apps/codex-claw/src/server/session-bundle.ts:52">
P2: Home-directory replacement runs before path redaction, which can leak private subpaths in exported handoff text.</violation>
</file>
<file name="apps/codex-claw/src/routes/api/session-bundle.ts">
<violation number="1" location="apps/codex-claw/src/routes/api/session-bundle.ts:42">
P2: The catch block maps all errors to 404, which hides real server errors and returns incorrect HTTP semantics.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| const replacements = [ | ||
| [path.resolve(paths.stateDir), '$CODEX_CLAW_STATE'], | ||
| [path.resolve(paths.workspace.codexWorkdir), '$WORKSPACE'], | ||
| [os.homedir(), '~'], |
There was a problem hiding this comment.
P2: Home-directory replacement runs before path redaction, which can leak private subpaths in exported handoff text.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/codex-claw/src/server/session-bundle.ts, line 52:
<comment>Home-directory replacement runs before path redaction, which can leak private subpaths in exported handoff text.</comment>
<file context>
@@ -0,0 +1,378 @@
+ const replacements = [
+ [path.resolve(paths.stateDir), '$CODEX_CLAW_STATE'],
+ [path.resolve(paths.workspace.codexWorkdir), '$WORKSPACE'],
+ [os.homedir(), '~'],
+ ] as const
+ let next = value
</file context>
| { | ||
| error: err instanceof Error ? err.message : String(err), | ||
| }, | ||
| { status: 404 }, |
There was a problem hiding this comment.
P2: The catch block maps all errors to 404, which hides real server errors and returns incorrect HTTP semantics.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/codex-claw/src/routes/api/session-bundle.ts, line 42:
<comment>The catch block maps all errors to 404, which hides real server errors and returns incorrect HTTP semantics.</comment>
<file context>
@@ -0,0 +1,48 @@
+ {
+ error: err instanceof Error ? err.message : String(err),
+ },
+ { status: 404 },
+ )
+ }
</file context>
4 tasks
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.
Summary\n- adds a server-side redacted markdown session bundle with prompt, assistant result, tool summaries, changed-file list, and validation commands\n- exposes a download-only handoff API for bundle, issue draft, and PR draft markdown\n- adds export-menu entries for redacted bundle, issue draft, and PR draft generation without posting to GitHub\n- covers redaction of environment values, tokens, private paths, and long secret-like values\n\n## Verification\n- pnpm -C apps/codex-claw lint\n- pnpm -C apps/codex-claw test\n- pnpm -C apps/codex-claw build\n- pnpm pack:codex-claw\n- pnpm smoke:codex-claw:pack\n\nCloses #95
Summary by cubic
Adds server-side redacted session handoff exports and export-menu options to download a bundle, issue draft, or PR draft without publishing to GitHub. Implements Linear #95 with safe, shareable markdown exports.
GET /api/session-bundle?kind=bundle|issue|pr&sessionKey=...&friendlyId=...&download=1returns a markdown file with a sanitized filename.useExportroutes server downloads without any GitHub writes.Written for commit 365f2eb. Summary will update on new commits.