Documentation
¶
Index ¶
- Constants
- func CaptureError(err error, context map[string]interface{})
- func CaptureMessage(msg string)
- func DrainExecIDFromChild() string
- func DrainLiveURLFromChild() string
- func EnvEnabled(key string) bool
- func ExecIDFilePath() string
- func FlushErrorReporting()
- func InitErrorReporting(version string)
- func LiveURLFilePath() string
- func MaskURL(rawURL string) string
- func PersistExecIDForParent(execID string)
- func PersistLiveURLForParent(url string)
- func PidAlive(pid int) bool
- func RecoverPanic()
- func ResetExecIDFileForTest()
- func ResetLiveURLFileForTest()
- type Logger
Constants ¶
const LiveFeedHoldSeconds = 120
LiveFeedHoldSeconds is the post-run sandbox-keepalive window we ask the server to honour when LiveFeed is on. Long enough to absorb network + agent-stream latency between server-side run completion and the moment the client opens /browserfeed; short enough that abandoned sandboxes don't cost much. Server caps this via QMAX_LIVE_FEED_HOLD_MAX_SECONDS (default 600) so a misconfigured client can't pin sandboxes forever.
Variables ¶
This section is empty.
Functions ¶
func CaptureError ¶
CaptureError reports a non-fatal error to Bugsink.
func CaptureMessage ¶
func CaptureMessage(msg string)
CaptureMessage reports an informational message to Bugsink.
func DrainExecIDFromChild ¶
func DrainExecIDFromChild() string
DrainExecIDFromChild reads and removes the execution ID the subprocess wrote. Returns "" when the file is missing or unreadable.
func DrainLiveURLFromChild ¶
func DrainLiveURLFromChild() string
DrainLiveURLFromChild reads any URL the subprocess wrote to the side channel since the last drain, then deletes the file so a stale URL from a previous turn can't auto-launch on the next one. Returns "" when the file is missing, empty, or unreadable.
func EnvEnabled ¶
EnvEnabled returns true when an env var is set to a recognized affirmative.
func ExecIDFilePath ¶
func ExecIDFilePath() string
ExecIDFilePath returns the per-process path for the execution-ID file.
func FlushErrorReporting ¶
func FlushErrorReporting()
FlushErrorReporting flushes pending events before exit.
func InitErrorReporting ¶
func InitErrorReporting(version string)
InitErrorReporting sets up Sentry-compatible error reporting when explicitly enabled via QMAX_CODE_TELEMETRY=1 and QMAX_CODE_TELEMETRY_DSN. Public builds must not report anything unless the user opts in. version is reported as the Sentry release tag.
func LiveURLFilePath ¶
func LiveURLFilePath() string
LiveURLFilePath returns the path to the per-process side-channel file, computing it once per process. Empty string means we couldn't resolve a home directory — caller should treat that as "feature unavailable" rather than failing.
func MaskURL ¶
MaskURL replaces the password component of a URL's user-info with **** for safe display. Returns the input unchanged if it doesn't parse or has no credentials. Use this for URLs shown in pickers, status lines, or logs; for redaction of sensitive output going off-process, use internal/security.RedactSensitive instead.
func PersistExecIDForParent ¶
func PersistExecIDForParent(execID string)
PersistExecIDForParent writes the execution ID to the side channel so the parent can poll for the live_browser_url without blocking the MCP tool call. No-op when QMAX_EXEC_ID_FILE is not set.
func PersistLiveURLForParent ¶
func PersistLiveURLForParent(url string)
PersistLiveURLForParent writes `url` into the side-channel file the parent watches. No-op when the env var isn't set (i.e. we're running in-process mode, where captureLiveURL already wrote to sctx directly). Best-effort: errors are swallowed because failing here would corrupt otherwise-valid tool output.
func PidAlive ¶
PidAlive reports whether a process with the given PID is running. Uses signal 0: no signal is sent but the kernel validates the PID.
func RecoverPanic ¶
func RecoverPanic()
RecoverPanic catches panics and reports them to Bugsink before re-panicking.
func ResetExecIDFileForTest ¶
func ResetExecIDFileForTest()
ResetExecIDFileForTest is the execID equivalent of ResetLiveURLFileForTest.
func ResetLiveURLFileForTest ¶
func ResetLiveURLFileForTest()
ResetLiveURLFileForTest resets the cached singleton path so a test can run LiveURLFilePath() against a fresh sync.Once. Test-only helper exported here because callers live in another package.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides structured JSON logging to a file.