Skip to content

Commit aa73ab0

Browse files
Copilotedburns
andauthored
Update documentation for new features: copilotHome, tcpConnectionToken, instructionDirectories, continuePendingWork
Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
1 parent 7378690 commit aa73ab0

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

src/site/markdown/advanced.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,16 @@ This guide covers advanced scenarios for extending and customizing your Copilot
2525
- [Skills Configuration](#Skills_Configuration)
2626
- [Loading Skills](#Loading_Skills)
2727
- [Disabling Skills](#Disabling_Skills)
28+
- [Instruction Directories](#Instruction_Directories)
2829
- [Custom Configuration Directory](#Custom_Configuration_Directory)
2930
- [Session Logging](#Session_Logging)
3031
- [Early Event Registration](#Early_Event_Registration)
3132
- [User Input Handling](#User_Input_Handling)
3233
- [Permission Handling](#Permission_Handling)
3334
- [Session Hooks](#Session_Hooks)
3435
- [Manual Server Control](#Manual_Server_Control)
36+
- [Copilot Home Directory](#Copilot_Home_Directory)
37+
- [TCP Connection Token](#TCP_Connection_Token)
3538
- [Session Context and Filtering](#Session_Context_and_Filtering)
3639
- [Listing Sessions with Context](#Listing_Sessions_with_Context)
3740
- [Filtering Sessions by Context](#Filtering_Sessions_by_Context)
@@ -626,6 +629,28 @@ var session = client.createSession(
626629

627630
---
628631

632+
## Instruction Directories
633+
634+
Specify additional directories to search for custom instruction files. Instruction files (`.instructions.md`) placed in `.github/instructions/` subdirectories of the specified paths will be included in the session's system message:
635+
636+
```java
637+
var session = client.createSession(
638+
new SessionConfig().setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
639+
.setInstructionDirectories(List.of("/path/to/extra/instructions"))
640+
).get();
641+
```
642+
643+
This works with both `createSession` and `resumeSession`:
644+
645+
```java
646+
var resumed = client.resumeSession(sessionId,
647+
new ResumeSessionConfig().setOnPermissionRequest(PermissionHandler.APPROVE_ALL)
648+
.setInstructionDirectories(List.of("/path/to/instructions"))
649+
).get();
650+
```
651+
652+
---
653+
629654
## Custom Configuration Directory
630655

631656
Use a custom configuration directory for session settings:
@@ -830,6 +855,33 @@ client.forceStop().get();
830855
831856
---
832857

858+
## Copilot Home Directory
859+
860+
Configure a custom base directory for Copilot data (session state, config, etc.). This sets the `COPILOT_HOME` environment variable on the spawned CLI process:
861+
862+
```java
863+
var options = new CopilotClientOptions()
864+
.setCopilotHome("/custom/data/dir");
865+
```
866+
867+
When not set, the CLI defaults to `~/.copilot`. This option is only used when the SDK spawns the CLI process; it is ignored when connecting to an external server via `setCliUrl()`.
868+
869+
---
870+
871+
## TCP Connection Token
872+
873+
When the SDK spawns the CLI in TCP mode, a connection token is generated automatically to secure the loopback listener. You can provide your own token:
874+
875+
```java
876+
var options = new CopilotClientOptions()
877+
.setUseStdio(false)
878+
.setTcpConnectionToken("my-secret-token");
879+
```
880+
881+
This cannot be combined with `setUseStdio(true)`. When omitted in TCP mode, the SDK auto-generates a UUID token.
882+
883+
---
884+
833885
## Session Context and Filtering
834886

835887
Track and filter sessions by their working directory context including the current directory, git repository, and branch information.

src/site/markdown/documentation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,13 @@ When resuming a session, you can optionally reconfigure many settings. This is u
644644
| `customAgents` | Configure custom agents |
645645
| `agent` | Pre-select a custom agent at session start |
646646
| `skillDirectories` | Directories to load skills from |
647+
| `instructionDirectories` | Additional directories to search for custom instruction files |
647648
| `disabledSkills` | Skills to disable |
648649
| `infiniteSessions` | Configure infinite session behavior |
649650
| `commands` | Slash command definitions for the resumed session |
650651
| `onElicitationRequest` | Handler for incoming elicitation requests |
651652
| `disableResume` | When `true`, resumes without emitting a `session.resume` event |
653+
| `continuePendingWork` | When `true`, continues pending tool calls/permissions from prior suspend |
652654
| `onEvent` | Event handler registered before session resumption |
653655

654656
**Example: Changing Model on Resume**

0 commit comments

Comments
 (0)